components.payment_gateway.public.entities ¶
This module defines all the common entities that don't belong to a specific subcomponent. It also exports all the public entities from all the subcomponents.
Attributes¶
OrganizationType
module-attribute
¶
OrganizationType = Literal[
"associationIncorporated",
"governmentalOrganization",
"listedPublicCompany",
"nonProfit",
"partnershipIncorporated",
"privateCompany",
]
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.
Transfer
module-attribute
¶
TransferId
module-attribute
¶
UsageRestrictionRuleId
module-attribute
¶
Classes¶
Account
dataclass
¶
AccountHolder
dataclass
¶
AccountTransfer
dataclass
¶
AccountTransfer(
id,
direction,
reference,
effective_date,
account_id,
transfer_history_id,
updates,
events,
raw,
)
Attributes¶
BalanceInformation
dataclass
¶
BankTransfer
dataclass
¶
BankTransfer(
id,
external_id,
direction,
effective_date,
account_id,
transfer_history_id,
updates,
events,
sepa_mandate_id,
sepa_beneficiary_id,
raw,
)
Attributes¶
BankTransferAccount
dataclass
¶
BankTransferAccount(
bank_transfer_account_id,
bank_transfer_account_info,
bank_transfer_account_type,
)
Represents a bank account to which a bank transfer can be made (ex: BankAccountInfo in Canada).
Card
dataclass
¶
Card(
id,
card_holder_id,
account_id,
form_factor,
display_name,
expiration_year,
expiration_month,
last_four_digits,
status,
external_id,
description,
reference,
issued_at=isodatetime_field(),
issuance_reason=None,
suspension_source=None,
)
Card entity.
Attributes¶
external_id
instance-attribute
¶
Opaque identifier of the card in the payment service provider.
issuance_reason
class-attribute
instance-attribute
¶
Reason for issuing the card.
issued_at
class-attribute
instance-attribute
¶
Date and time when the card was issued.
suspension_source
class-attribute
instance-attribute
¶
Who initiated the suspension of the card.
CardIssuingConfiguration
dataclass
¶
CardOrder
dataclass
¶
CardPaymentMerchant
dataclass
¶
CardProvisioning
dataclass
¶
CardProvisioning(
id,
card_id,
external_id,
provisioning_type,
provisioning_date,
wallet_provider,
provider,
)
CardProvisioning entity
Attributes¶
CardRevealPANData
dataclass
¶
CardRevealPINData
dataclass
¶
CardShipmentInfo
dataclass
¶
CardShipmentInfo(
first_name,
last_name,
address_line1,
postal_code,
city,
country,
phone_number=None,
address_line2=None,
state_or_province=None,
)
Name and address to which a physical card will be shipped.
Attributes¶
CardTransfer
dataclass
¶
CardTransfer(
id,
effective_date,
merchant,
card_id,
account_id,
updates,
events,
raw,
transfer_history_id,
)
Attributes¶
CountryCriterion
dataclass
¶
CurrencyCriterion
dataclass
¶
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.
InternalTransfer
dataclass
¶
Ledger
dataclass
¶
LedgerEntry
dataclass
¶
LedgerEntry(
ledger_id,
opening_balance,
amount,
ending_balance,
occurred_at,
created_at,
description,
reference,
metadata,
)
Attributes¶
LegalEntityAddressParams
dataclass
¶
LegalEntityOnboardResult
dataclass
¶
MCCCriterion
dataclass
¶
MerchantCriterion
dataclass
¶
MerchantIdPair
dataclass
¶
MerchantInfo
dataclass
¶
MerchantInfo(
merchant_id,
acquirer_id=None,
mcc=None,
name=None,
postal_code=None,
city=None,
country=None,
)
Info about a merchant identified by its Merchant ID.
This is the (possibly incomplete) information we store about the merchant in our merchant registry. We try to keep it up-to-date with the information we receive from the PSP, using the Merchant ID as the key.
Note
Some fields may be None for various reasons: - They might not be relevant for the merchant (e.g. e-commerce platforms may not have a postal code) - They were missing from the events we received from the PSP, although we try to augment them as we go
PendingTransaction
dataclass
¶
PendingTransactionMerchantInfo
dataclass
¶
PendingTransactionMerchantInfo(
merchant_id,
acquirer_id,
mcc,
name,
country,
postal_code=None,
city=None,
)
Merchant information for a pending transaction.
Note
All fields are always present during authorization, those which are None might simply be irrelevant for the merchant (e.g. e-commerce platforms may not have a postal code)
Attributes¶
ProcessingTypeCriterion
dataclass
¶
RecipientAddress
dataclass
¶
RecipientUser
dataclass
¶
SepaMandate
dataclass
¶
SepaMandate(
id,
provider,
external_id,
account_holder_id,
sepa_creditor_identifier,
unique_mandate_reference,
debtor_name,
debtor_iban,
issued_at,
status,
)
Attributes¶
TransferEvent
dataclass
¶
TransferRulesEvaluation
dataclass
¶
TransferTransactionRule
dataclass
¶
TransferUpdate
dataclass
¶
TransferUpdate(
id,
transfer_id,
transfer_type,
direction,
sequence_number,
occurred_at,
amount,
currency,
status,
provider,
external_transaction_id=None,
external_transfer_id=None,
raw=None,
)
Attributes¶
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.
WebhookLog
dataclass
¶
WebhookLogExtended
dataclass
¶
WebhookLogExtended(
id,
payload,
transfer_id,
transfer_external_id,
transfer_status,
transfer_type,
account_id,
account_external_id,
payment_instrument_external_id,
card_holder_id,
amount,
payment_date,
history,
rules,
)
Bases: WebhookLog
This class extends the WebhookLog class with additional fields that are not present in the WebhookLog class.
It is used to represent the webhook log with additional fields to easily access important informations to be used in the business logic.