Skip to content

Commit

Permalink
Accounts, Payment Sessions and Account Holder APM updates (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
armando-rodriguez-cko authored Oct 9, 2024
1 parent 38fdc3b commit bd6c2ae
Show file tree
Hide file tree
Showing 16 changed files with 441 additions and 49 deletions.
99 changes: 97 additions & 2 deletions checkout_sdk/accounts/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,14 @@ class EntityEmailAddresses:
primary: str


class Invitee:
email: str


class ContactDetails:
phone: Phone
email_addresses: EntityEmailAddresses
invitee: Invitee


class Profile:
Expand Down Expand Up @@ -97,10 +102,73 @@ class TaxVerification:
front: str


class ArticlesOfAssociationType(str, Enum):
MEMORANDUM_OF_ASSOCIATION = "memorandum_of_association"
ARTICLES_OF_ASSOCIATION = "articles_of_association"


class BankVerificationType(str, Enum):
BANK_STATEMENT = 'bank_statement'


class BankVerification:
type: BankVerificationType
front: str


class ShareholderStructureType(str, Enum):
CERTIFIED_SHAREHOLDER_STRUCTURE = 'certified_shareholder_structure'


class ShareholderStructure:
type: ShareholderStructureType
front: str


class ProofOfLegalityType(str, Enum):
PROOF_OF_LEGALITY = 'proof_of_legality'


class ProofOfLegality:
type: ProofOfLegalityType
front: str


class ProofOfPrincipalAddressType(str, Enum):
PROOF_OF_ADDRESS = 'proof_of_address'


class ProofOfPrincipalAddress:
type: ProofOfPrincipalAddressType
front: str


class AdditionalDocument:
front: str


class FinancialVerificationType(str, Enum):
FINANCIAL_STATEMENT = 'financial_statement'


class FinancialVerification:
type: FinancialVerificationType
front: str


class OnboardSubEntityDocuments:
identity_verification: EntityIdentificationDocument
company_verification: CompanyVerification
articles_of_association: ArticlesOfAssociationType
bank_verification: BankVerification
shareholder_structure: ShareholderStructure
proof_of_legality: ProofOfLegality
proof_of_principal_address: ProofOfPrincipalAddress
additional_document_1: AdditionalDocument
additional_document_2: AdditionalDocument
additional_document_3: AdditionalDocument
tax_verification: TaxVerification
financial_verification: FinancialVerification


class EntityRepresentative:
Expand Down Expand Up @@ -129,16 +197,25 @@ class EntityFinancialDetails:
currency: Currency


class DateOfIncorporation:
month: int
year: int


class Company:
business_registration_number: str
business_type: BusinessType
legal_name: str
trading_name: str
business_registration_number: str
date_of_incorporation: DateOfIncorporation
regulatory_licence_number: str
principal_address: Address
registered_address: Address
document: EntityDocument
representatives: list # EntityRepresentative
document: EntityDocument
financial_details: EntityFinancialDetails
business_type: BusinessType


class Identification:
Expand All @@ -159,13 +236,31 @@ class Individual:
financial_details: EntityFinancialDetails


class ProcessingDetails:
settlement_country: str
target_countries: list # str
annual_processing_volume: int
average_transaction_value: int
highest_transaction_value: int
currency: Currency


class AdditionalInfo:
field1: str
field2: str
field3: str


class OnboardEntityRequest:
reference: str
contact_details: ContactDetails
is_draft: bool
profile: Profile
contact_details: ContactDetails
company: Company
processing_details: ProcessingDetails
individual: Individual
documents: OnboardSubEntityDocuments
additional_info: AdditionalInfo


class InstrumentDocument:
Expand Down
2 changes: 1 addition & 1 deletion checkout_sdk/checkout_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ def __init__(self, configuration: CheckoutConfiguration):
self.financial = FinancialClient(api_client=base_api_client, configuration=configuration)
self.issuing = IssuingClient(api_client=base_api_client, configuration=configuration)
self.contexts = PaymentContextsClient(api_client=base_api_client, configuration=configuration)
self.sessions = PaymentSessionsClient(api_client=base_api_client, configuration=configuration)
self.payment_sessions = PaymentSessionsClient(api_client=base_api_client, configuration=configuration)
27 changes: 23 additions & 4 deletions checkout_sdk/common/common.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime
from enum import Enum

from checkout_sdk.common.enums import AccountHolderIdentificationType, AccountHolderType, Country
from checkout_sdk.common.enums import AccountHolderIdentificationType, AccountHolderType, Country, AccountType


class Address:
Expand All @@ -25,6 +25,10 @@ class CustomerRequest:
phone: Phone


class CustomerRetry:
max_attempts: int


class ResidentialStatusType(str, Enum):
RESIDENT = 'resident'
NON_RESIDENT = 'non_resident'
Expand All @@ -39,8 +43,12 @@ class AccountHolderIdentification:

class AccountHolder:
type: AccountHolderType
full_name: str
first_name: str
middle_name: str
last_name: str
email: str
gender: str
company_name: str
tax_id: str
date_of_birth: str
Expand All @@ -49,9 +57,7 @@ class AccountHolder:
billing_address: Address
phone: Phone
identification: AccountHolderIdentification
email: str
gender: str
middle_name: str
account_name_inquiry: bool


class BankDetails:
Expand Down Expand Up @@ -113,3 +119,16 @@ class ShippingInfo:
class QueryFilterDateRange:
from_: datetime
to: datetime


class Destination:
account_type: AccountType
account_number: str
bank_code: str
branch_code: str
iban: str
bban: str
swift_bic: str
country: Country
account_holder: AccountHolder
bank: BankDetails
34 changes: 34 additions & 0 deletions checkout_sdk/common/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,11 @@ class PaymentSourceType(str, Enum):
TRUSTLY = 'trustly'
CVCONNECT = 'cvconnect'
SEPA = 'sepa'
ACH = 'ach'
BIZUM = 'bizum'
OCTOPUS = 'octopus'
PLAID = 'plaid'
SEQURA = 'sequra'


class ChallengeIndicator(str, Enum):
Expand Down Expand Up @@ -515,3 +520,32 @@ class DocumentType(str, Enum):
CITIZEN_CARD = 'citizen_card'
RESIDENCE_PERMIT = 'residence_permit'
ELECTORAL_ID = 'electoral_id'


class AccountChangeIndicatorType(str, Enum):
THIS_TRANSACTION = "this_transaction"
LESS_THAN_THIRTY_DAYS = "less_than_thirty_days"
THIRTY_TO_SIXTY_DAYS = "thirty_to_sixty_days"
MORE_THAN_SIXTY_DAYS = "more_than_sixty_days"


class AccountPasswordChangeIndicatorType(str, Enum):
NO_CHANGE = "no_change"
THIS_TRANSACTION = "this_transaction"
LESS_THAN_THIRTY_DAYS = "less_than_thirty_days"
THIRTY_TO_SIXTY_DAYS = "thirty_to_sixty_days"
MORE_THAN_SIXTY_DAYS = "more_than_sixty_days"


class AccountTypeCardProductType(str, Enum):
CREDIT = "credit"
DEBIT = "debit"
NOT_APPLICABLE = "not_applicable"


class CardholderAccountAgeIndicatorType(str, Enum):
LESS_THAN_THIRTY_DAYS = "less_than_thirty_days"
MORE_THAN_SIXTY_DAYS = "more_than_sixty_days"
NO_ACCOUNT = "no_account"
THIRTY_TO_SIXTY_DAYS = "thirty_to_sixty_days"
THIS_TRANSACTION = "this_transaction"
12 changes: 7 additions & 5 deletions checkout_sdk/payments/hosted/hosted_payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@
from checkout_sdk.common.common import CustomerRequest
from checkout_sdk.common.enums import Currency
from checkout_sdk.payments.payments import BillingDescriptor, PaymentType, ShippingDetails, ThreeDsRequest, \
RiskRequest, PaymentRecipient, ProcessingSettings
RiskRequest, PaymentRecipient, ProcessingSettings, PaymentSender, PaymentRetryRequest
from checkout_sdk.payments.payments_previous import BillingInformation


class HostedPaymentsSessionRequest:
payment_type: PaymentType.REGULAR
amount: int
currency: Currency
payment_type: PaymentType.REGULAR
payment_ip: str
billing_descriptor: BillingDescriptor
reference: str
description: str
display_name: str
processing_channel_id: str
amount_allocations: list # values of AmountAllocations
customer: CustomerRequest
shipping: ShippingDetails
billing: BillingInformation
Expand All @@ -24,6 +27,8 @@ class HostedPaymentsSessionRequest:
disabled_payment_methods: list # PaymentSourceType
products: list # common.Product
risk: RiskRequest
customer_retry: PaymentRetryRequest
sender: PaymentSender
success_url: str
cancel_url: str
failure_url: str
Expand All @@ -32,6 +37,3 @@ class HostedPaymentsSessionRequest:
three_ds: ThreeDsRequest
capture: bool
capture_on: datetime
# Not available on Previous
processing_channel_id: str
amount_allocations: list # values of AmountAllocations
14 changes: 9 additions & 5 deletions checkout_sdk/payments/links/payments_links.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
from datetime import datetime

from checkout_sdk.common.common import CustomerRequest
from checkout_sdk.common.common import CustomerRequest, CustomerRetry
from checkout_sdk.common.enums import Currency
from checkout_sdk.payments.payments import BillingDescriptor, PaymentType, ShippingDetails, ThreeDsRequest, \
RiskRequest, PaymentRecipient, ProcessingSettings
RiskRequest, PaymentRecipient, ProcessingSettings, PaymentSender
from checkout_sdk.payments.payments_previous import BillingInformation


class PaymentLinkRequest:
payment_type: PaymentType.REGULAR
amount: int
currency: Currency
payment_type: PaymentType.REGULAR
payment_ip: str
billing_descriptor: BillingDescriptor
reference: str
description: str
display_name: str
processing_channel_id: str
amount_allocations: list # values of AmountAllocations
expires_in: int
customer: CustomerRequest
shipping: ShippingDetails
billing: BillingInformation
recipient: PaymentRecipient
processing: ProcessingSettings
allow_payment_methods: list # PaymentSourceType
disabled_payment_methods: list # PaymentSourceType
products: list # common.Product
metadata: dict
three_ds: ThreeDsRequest
risk: RiskRequest
customer_retry: CustomerRetry
sender: PaymentSender
return_url: str
locale: str
capture: bool
capture_on: datetime
processing_channel_id: str
amount_allocations: list # values of AmountAllocations
Loading

0 comments on commit bd6c2ae

Please sign in to comment.