Skip to content

Commit eb9388c

Browse files
Update Payment Components
1 parent 65f7664 commit eb9388c

File tree

2 files changed

+60
-2
lines changed

2 files changed

+60
-2
lines changed
Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,73 @@
1+
from datetime import datetime
2+
from enum import Enum
3+
14
from checkout_sdk.common.common import Address, CustomerRequest
25
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'
329

430

531
class Billing:
632
address: Address
733

834

35+
class Card:
36+
store_payment_details: StorePaymentDetails
37+
38+
39+
class PaymentMethodConfiguration:
40+
card: Card
41+
42+
943
class PaymentSessionsRequest:
1044
amount: int
1145
currency: Currency
46+
payment_type: PaymentType
47+
billing: BillingInformation
48+
billing_descriptor: BillingDescriptor
1249
reference: str
13-
billing: Billing
50+
description: str
51+
customer: PaymentCustomerRequest
1452
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
1566
success_url: str
1667
failure_url: str
68+
metadata: dict
69+
locale: str
70+
three_ds: ThreeDsRequest
71+
sender: PaymentSender
72+
capture: bool
73+
ip_address: str

tests/payments/sessions/payment_sessions_integration_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from checkout_sdk.common.common import CustomerRequest
44
from checkout_sdk.common.enums import Currency
5+
from checkout_sdk.payments.payments_previous import BillingInformation
56
from checkout_sdk.payments.sessions.sessions import PaymentSessionsRequest, Billing
67
from tests.checkout_test_utils import assert_response, address
78

@@ -18,7 +19,7 @@ def test_should_create_payment_sessions(default_api):
1819

1920

2021
def create_payment_sessions_request():
21-
billing = Billing()
22+
billing = BillingInformation()
2223
billing.address = address()
2324

2425
customer = CustomerRequest()

0 commit comments

Comments
 (0)