Skip to content

Commit 2416fed

Browse files
feat: update payment sessions model with new properties and classes (#190)
* feat: update payment sessions model with new properties and classes - Add WECHATPAY and PAYNOW to PaymentMethodsType enum - Create CustomerSummary class with customer analytics properties - Create SessionPaymentCustomerRequest class with summary property - Update PaymentSessionsRequest to use SessionPaymentCustomerRequest - Update PaymentSessionWithPaymentRequest to use SessionPaymentCustomerRequest - Add payment_type property to SubmitPaymentSessionRequest * fix: remove unused import of PaymentCustomerRequest from sessions.py
1 parent 6d9e1d8 commit 2416fed

1 file changed

Lines changed: 26 additions & 3 deletions

File tree

checkout_sdk/payments/sessions/sessions.py

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from enum import Enum
33

44
from checkout_sdk.common.enums import Currency
5-
from checkout_sdk.payments.payments import PaymentType, BillingDescriptor, PaymentCustomerRequest, ShippingDetails, \
5+
from checkout_sdk.payments.payments import PaymentType, BillingDescriptor, ShippingDetails, \
66
PaymentRecipient, ProcessingSettings, RiskRequest, ThreeDsRequest, PaymentSender
77

88

@@ -27,6 +27,7 @@ class PaymentMethodsType(str, Enum):
2727
MOBILEPAY = 'mobilepay'
2828
MULTIBANCO = 'multibanco'
2929
P24 = 'p24'
30+
PAYNOW = 'paynow'
3031
PAYPAL = 'paypal'
3132
PLAID = 'plaid'
3233
QPAY = 'qpay'
@@ -40,6 +41,7 @@ class PaymentMethodsType(str, Enum):
4041
TRUEMONEY = 'truemoney'
4142
TWINT = 'twint'
4243
VIPPS = 'vipps'
44+
WECHATPAY = 'wechatpay'
4345

4446

4547
class Locale(str, Enum):
@@ -130,6 +132,26 @@ class SessionBilling:
130132
phone: BillingPhone
131133

132134

135+
class CustomerSummary:
136+
registration_date: str
137+
first_transaction_date: str
138+
last_payment_date: str
139+
total_order_count: int
140+
last_payment_amount: float
141+
is_premium_customer: bool
142+
is_returning_customer: bool
143+
lifetime_value: float
144+
145+
146+
class SessionPaymentCustomerRequest:
147+
email: str
148+
name: str
149+
id: str
150+
phone: BillingPhone
151+
tax_number: str
152+
summary: CustomerSummary
153+
154+
133155
class AccountHolder:
134156
type: AccountHolderType
135157

@@ -207,7 +229,7 @@ class PaymentSessionsRequest:
207229
billing_descriptor: BillingDescriptor
208230
reference: str
209231
description: str
210-
customer: PaymentCustomerRequest
232+
customer: SessionPaymentCustomerRequest
211233
shipping: ShippingDetails
212234
recipient: PaymentRecipient
213235
processing: ProcessingSettings
@@ -242,7 +264,7 @@ class PaymentSessionWithPaymentRequest:
242264
billing_descriptor: BillingDescriptor
243265
reference: str
244266
description: str
245-
customer: PaymentCustomerRequest
267+
customer: SessionPaymentCustomerRequest
246268
shipping: ShippingDetails
247269
recipient: PaymentRecipient
248270
processing: ProcessingSettings
@@ -268,3 +290,4 @@ class SubmitPaymentSessionRequest:
268290
items: list # Item
269291
three_ds: ThreeDsRequest
270292
ip_address: str
293+
payment_type: PaymentType

0 commit comments

Comments
 (0)