Actions
components.payment_gateway.subcomponents.rules.business_logic.actions.expense_limit_rule_actions ¶
ExpenseLimitRuleActions ¶
This class contains all the actions related to expense limit rules.
Implements the following Nullable patterns: - Nullables: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#nullables ⧉ - Parameterless instantiation: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#instantiation ⧉
Source code in components/payment_gateway/subcomponents/rules/business_logic/actions/expense_limit_rule_actions.py
create
classmethod
¶
Normal factory
Source code in components/payment_gateway/subcomponents/rules/business_logic/actions/expense_limit_rule_actions.py
create_expense_limit_rule ¶
create_expense_limit_rule(
session,
/,
description,
reference,
card_id,
amount,
currency,
period,
criteria,
first_day=None,
is_active=False,
start=None,
end=None,
)
Create an expense limit rule for a card.
Source code in components/payment_gateway/subcomponents/rules/business_logic/actions/expense_limit_rule_actions.py
create_null
classmethod
¶
Null factory
Source code in components/payment_gateway/subcomponents/rules/business_logic/actions/expense_limit_rule_actions.py
set_expense_limit_rule_status ¶
Activate or deactivate an expense limit rule.
Activating a rule will also set the start date to the current date.
Source code in components/payment_gateway/subcomponents/rules/business_logic/actions/expense_limit_rule_actions.py
set_expense_limit_rule_validity_period ¶
Set an expense limit rule validity period.
Source code in components/payment_gateway/subcomponents/rules/business_logic/actions/expense_limit_rule_actions.py
terminate_expense_limit_rule ¶
Terminate an expense limit rule.
The operation is idempotent, i.e. it has no effect on already terminated entities.
Rules in terminal state cannot be modified or used anymore. Any attempt
to use or retrieve a terminated expense limit rule will raise an
ExpenseLimitRuleTerminatedException.
Source code in components/payment_gateway/subcomponents/rules/business_logic/actions/expense_limit_rule_actions.py
update_expense_limit_rule_amount ¶
Update the amount of an expense limit rule.
This operation can be safely performed in the middle of a validity period. The new limit will be applied to all future transactions.
Source code in components/payment_gateway/subcomponents/rules/business_logic/actions/expense_limit_rule_actions.py
update_expense_limit_rule_criteria ¶
Update the criteria of an expense limit rule.
Warning: we don't know yet how this will behave when performed in the middle of a validity period with respect to the cumulated amount so far. Use with caution.
Source code in components/payment_gateway/subcomponents/rules/business_logic/actions/expense_limit_rule_actions.py
components.payment_gateway.subcomponents.rules.business_logic.actions.usage_restriction_rule_actions ¶
UsageRestrictionRuleActions ¶
This class contains all the actions related to usage restriction rules.
Implements the following Nullable patterns: - Nullables: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#nullables ⧉ - Parameterless instantiation: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#instantiation ⧉
Source code in components/payment_gateway/subcomponents/rules/business_logic/actions/usage_restriction_rule_actions.py
create
classmethod
¶
Normal factory
Source code in components/payment_gateway/subcomponents/rules/business_logic/actions/usage_restriction_rule_actions.py
create_null
classmethod
¶
Null factory
Source code in components/payment_gateway/subcomponents/rules/business_logic/actions/usage_restriction_rule_actions.py
create_usage_restriction_rule ¶
create_usage_restriction_rule(
session,
/,
description,
reference,
account_id,
criteria,
is_active=False,
start=None,
end=None,
)
Create a usage restriction rule for an account.
Source code in components/payment_gateway/subcomponents/rules/business_logic/actions/usage_restriction_rule_actions.py
set_usage_restriction_rule_status ¶
Activate or deactivate a usage restriction rule.
Activating a rule will also set the start date to the current date.
Source code in components/payment_gateway/subcomponents/rules/business_logic/actions/usage_restriction_rule_actions.py
set_usage_restriction_rule_validity_period ¶
Set a usage restriction rule validity period.
Source code in components/payment_gateway/subcomponents/rules/business_logic/actions/usage_restriction_rule_actions.py
terminate_usage_restriction_rule ¶
Terminate a usage restriction rule.
The operation is idempotent, i.e. it has no effect on already terminated entities.
Rules in terminal state cannot be modified or used anymore. Any attempt
to use or retrieve a terminated usage restriction rule will raise a
UsageRestrictionRuleTerminatedException.
Source code in components/payment_gateway/subcomponents/rules/business_logic/actions/usage_restriction_rule_actions.py
update_usage_restriction_rule_criteria ¶
Update the criteria of a usage restriction rule.