Entities
RuleCriterion
module-attribute
¶
RuleCriterion = (
CountryCriterion
| ProcessingTypeCriterion
| MCCCriterion
| MerchantCriterion
| CurrencyCriterion
)
Criterion to match against a payment.
All criteria must be met for a rule to apply.
The order of the criteria doesn't matter, however each type of criterion should be used at most once.
UsageRestrictionRuleId
module-attribute
¶
CountryCriterion
dataclass
¶
CurrencyCriterion
dataclass
¶
Bases: DataClassJsonMixin
Matches payments against the card currency.
ExpenseLimitRule
dataclass
¶
ExpenseLimitRule(
id,
card_id,
description,
reference,
amount,
currency,
period,
criteria,
is_active,
first_day,
start,
end,
external_id,
)
Expense limit rule that applies on payments made with a card.
Expense limits set a limit on the total amount that can be spent with a card over a given period (day, month, ...). Once this limit is reached, the card can't be used anymore until the period ends.
Expense limits are immutable except for their amount once created, they can't be changed or deleted. However, they can be activated or deactivated at any time.
The amount can also be changed at any time, however this can have unexpected effects in the middle of a validity period (for example, monthly expense caps). It is best to change the amount outside at the beginning or end of a period or on an inactive one.
All criteria must be met for the rule to apply.
All active rules apply simultaneously on each payment made with the card. The order in which they are created doesn't matter. If a payment exceeds any active limit then it is blocked.
external_id
instance-attribute
¶
Opaque identifier of the rule in the payment service provider.
MCCCriterion
dataclass
¶
MerchantCriterion
dataclass
¶
Bases: DataClassJsonMixin
Matches payments based on the merchant identifiers.
__eq__ ¶
Source code in components/payment_gateway/subcomponents/rules/protected/entities.py
MerchantIdPair
dataclass
¶
Bases: DataClassJsonMixin
Merchant identifiers.
__eq__ ¶
Source code in components/payment_gateway/subcomponents/rules/protected/entities.py
ProcessingTypeCriterion
dataclass
¶
UsageRestrictionRule
dataclass
¶
UsageRestrictionRule(
id,
account_id,
description,
reference,
criteria,
is_active,
start,
end,
external_id,
)
Usage restriction rule that applies on payments made with any card linked to an account.
Usage restrictions are immutable; once created, they can't be changed or deleted. However, they can be activated or deactivated at any time.
All criteria must be met for the rule to apply.
All active rules apply simultaneously on each payment made with a card linked to the account. The order in which they are created doesn't matter. If a payment matches any active rule then it is blocked.
external_id
instance-attribute
¶
Opaque identifier of the rule in the payment service provider.