diff --git a/checkout_sdk/payments/sessions/sessions.py b/checkout_sdk/payments/sessions/sessions.py index 7115708a..2c8a1dee 100644 --- a/checkout_sdk/payments/sessions/sessions.py +++ b/checkout_sdk/payments/sessions/sessions.py @@ -1,16 +1,73 @@ +from datetime import datetime +from enum import Enum + from checkout_sdk.common.common import Address, CustomerRequest from checkout_sdk.common.enums import Currency +from checkout_sdk.payments.payments import PaymentType, BillingDescriptor, PaymentCustomerRequest, ShippingDetails, \ + PaymentRecipient, ProcessingSettings, RiskRequest, PaymentRetryRequest, ThreeDsRequest, PaymentSender +from checkout_sdk.payments.payments_previous import BillingInformation + + +class PaymentMethodsType(str, Enum): + APPLEPAY = 'applepay' + BANCONTACT = 'bancontact' + CARD = 'card' + EPS = 'eps' + GIROPAY = 'giropay' + GOOGLEPAY = 'googlepay' + IDEAL = 'ideal' + KNET = 'knet' + MULTIBANCO = 'multibanco' + PRZELEWY24 = 'p24' + PAYPAL = 'paypal' + SOFORT = 'sofort' + + +class StorePaymentDetails(str, Enum): + DISABLED = 'disabled' + ENABLED = 'enabled' class Billing: address: Address +class Card: + store_payment_details: StorePaymentDetails + + +class PaymentMethodConfiguration: + card: Card + + class PaymentSessionsRequest: amount: int currency: Currency + payment_type: PaymentType + billing: BillingInformation + billing_descriptor: BillingDescriptor reference: str - billing: Billing + description: str + customer: PaymentCustomerRequest customer: CustomerRequest + shipping: ShippingDetails + recipient: PaymentRecipient + processing: ProcessingSettings + processing_channel_id: str + expires_on: datetime + payment_method_configuration: PaymentMethodConfiguration + enabled_payment_methods: PaymentMethodsType + disabled_payment_methods: PaymentMethodsType + items: list # payments.Product + amount_allocations: list # values of AmountAllocations + risk: RiskRequest + customer_retry: PaymentRetryRequest + display_name: str success_url: str failure_url: str + metadata: dict + locale: str + three_ds: ThreeDsRequest + sender: PaymentSender + capture: bool + ip_address: str diff --git a/tests/payments/sessions/payment_sessions_integration_test.py b/tests/payments/sessions/payment_sessions_integration_test.py index 2387c094..3d52c79f 100644 --- a/tests/payments/sessions/payment_sessions_integration_test.py +++ b/tests/payments/sessions/payment_sessions_integration_test.py @@ -2,7 +2,8 @@ from checkout_sdk.common.common import CustomerRequest from checkout_sdk.common.enums import Currency -from checkout_sdk.payments.sessions.sessions import PaymentSessionsRequest, Billing +from checkout_sdk.payments.payments_previous import BillingInformation +from checkout_sdk.payments.sessions.sessions import PaymentSessionsRequest from tests.checkout_test_utils import assert_response, address @@ -18,7 +19,7 @@ def test_should_create_payment_sessions(default_api): def create_payment_sessions_request(): - billing = Billing() + billing = BillingInformation() billing.address = address() customer = CustomerRequest()