Skip to content

Commit

Permalink
Update Payment Components
Browse files Browse the repository at this point in the history
  • Loading branch information
armando-rodriguez-cko committed May 13, 2024
1 parent 65f7664 commit d271371
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 3 deletions.
59 changes: 58 additions & 1 deletion checkout_sdk/payments/sessions/sessions.py
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions tests/payments/sessions/payment_sessions_integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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()
Expand Down

0 comments on commit d271371

Please sign in to comment.