|
| 1 | +from datetime import datetime |
| 2 | +from enum import Enum |
| 3 | + |
1 | 4 | from checkout_sdk.common.common import Address, CustomerRequest
|
2 | 5 | from checkout_sdk.common.enums import Currency
|
| 6 | +from checkout_sdk.payments.payments import PaymentType, BillingDescriptor, PaymentCustomerRequest, ShippingDetails, \ |
| 7 | + PaymentRecipient, ProcessingSettings, RiskRequest, PaymentRetryRequest, ThreeDsRequest, PaymentSender |
| 8 | +from checkout_sdk.payments.payments_previous import BillingInformation |
| 9 | + |
| 10 | + |
| 11 | +class PaymentMethodsType(str, Enum): |
| 12 | + APPLEPAY = 'applepay' |
| 13 | + BANCONTACT = 'bancontact' |
| 14 | + CARD = 'card' |
| 15 | + EPS = 'eps' |
| 16 | + GIROPAY = 'giropay' |
| 17 | + GOOGLEPAY = 'googlepay' |
| 18 | + IDEAL = 'ideal' |
| 19 | + KNET = 'knet' |
| 20 | + MULTIBANCO = 'multibanco' |
| 21 | + PRZELEWY24 = 'p24' |
| 22 | + PAYPAL = 'paypal' |
| 23 | + SOFORT = 'sofort' |
| 24 | + |
| 25 | + |
| 26 | +class StorePaymentDetails(str, Enum): |
| 27 | + DISABLED = 'disabled' |
| 28 | + ENABLED = 'enabled' |
3 | 29 |
|
4 | 30 |
|
5 | 31 | class Billing:
|
6 | 32 | address: Address
|
7 | 33 |
|
8 | 34 |
|
| 35 | +class Card: |
| 36 | + store_payment_details: StorePaymentDetails |
| 37 | + |
| 38 | + |
| 39 | +class PaymentMethodConfiguration: |
| 40 | + card: Card |
| 41 | + |
| 42 | + |
9 | 43 | class PaymentSessionsRequest:
|
10 | 44 | amount: int
|
11 | 45 | currency: Currency
|
| 46 | + payment_type: PaymentType |
| 47 | + billing: BillingInformation |
| 48 | + billing_descriptor: BillingDescriptor |
12 | 49 | reference: str
|
13 |
| - billing: Billing |
| 50 | + description: str |
| 51 | + customer: PaymentCustomerRequest |
14 | 52 | customer: CustomerRequest
|
| 53 | + shipping: ShippingDetails |
| 54 | + recipient: PaymentRecipient |
| 55 | + processing: ProcessingSettings |
| 56 | + processing_channel_id: str |
| 57 | + expires_on: datetime |
| 58 | + payment_method_configuration: PaymentMethodConfiguration |
| 59 | + enabled_payment_methods: PaymentMethodsType |
| 60 | + disabled_payment_methods: PaymentMethodsType |
| 61 | + items: list # payments.Product |
| 62 | + amount_allocations: list # values of AmountAllocations |
| 63 | + risk: RiskRequest |
| 64 | + customer_retry: PaymentRetryRequest |
| 65 | + display_name: str |
15 | 66 | success_url: str
|
16 | 67 | failure_url: str
|
| 68 | + metadata: dict |
| 69 | + locale: str |
| 70 | + three_ds: ThreeDsRequest |
| 71 | + sender: PaymentSender |
| 72 | + capture: bool |
| 73 | + ip_address: str |
0 commit comments