From c0ede66abe8d50de806c43634068a87e265d5db3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Rodr=C3=ADguez?= <127134616+armando-rodriguez-cko@users.noreply.github.com> Date: Fri, 7 Nov 2025 13:22:02 +0100 Subject: [PATCH 1/2] 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 --- checkout_sdk/payments/sessions/sessions.py | 27 ++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/checkout_sdk/payments/sessions/sessions.py b/checkout_sdk/payments/sessions/sessions.py index 924d1e3..7823665 100644 --- a/checkout_sdk/payments/sessions/sessions.py +++ b/checkout_sdk/payments/sessions/sessions.py @@ -27,6 +27,7 @@ class PaymentMethodsType(str, Enum): MOBILEPAY = 'mobilepay' MULTIBANCO = 'multibanco' P24 = 'p24' + PAYNOW = 'paynow' PAYPAL = 'paypal' PLAID = 'plaid' QPAY = 'qpay' @@ -40,6 +41,7 @@ class PaymentMethodsType(str, Enum): TRUEMONEY = 'truemoney' TWINT = 'twint' VIPPS = 'vipps' + WECHATPAY = 'wechatpay' class Locale(str, Enum): @@ -130,6 +132,26 @@ class SessionBilling: phone: BillingPhone +class CustomerSummary: + registration_date: str + first_transaction_date: str + last_payment_date: str + total_order_count: int + last_payment_amount: float + is_premium_customer: bool + is_returning_customer: bool + lifetime_value: float + + +class SessionPaymentCustomerRequest: + email: str + name: str + id: str + phone: BillingPhone + tax_number: str + summary: CustomerSummary + + class AccountHolder: type: AccountHolderType @@ -207,7 +229,7 @@ class PaymentSessionsRequest: billing_descriptor: BillingDescriptor reference: str description: str - customer: PaymentCustomerRequest + customer: SessionPaymentCustomerRequest shipping: ShippingDetails recipient: PaymentRecipient processing: ProcessingSettings @@ -242,7 +264,7 @@ class PaymentSessionWithPaymentRequest: billing_descriptor: BillingDescriptor reference: str description: str - customer: PaymentCustomerRequest + customer: SessionPaymentCustomerRequest shipping: ShippingDetails recipient: PaymentRecipient processing: ProcessingSettings @@ -268,3 +290,4 @@ class SubmitPaymentSessionRequest: items: list # Item three_ds: ThreeDsRequest ip_address: str + payment_type: PaymentType From b6156bb25f299ca5299f2cc96a3ef97ce42a151f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Rodr=C3=ADguez?= <127134616+armando-rodriguez-cko@users.noreply.github.com> Date: Fri, 7 Nov 2025 13:30:06 +0100 Subject: [PATCH 2/2] fix: remove unused import of PaymentCustomerRequest from sessions.py --- checkout_sdk/payments/sessions/sessions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checkout_sdk/payments/sessions/sessions.py b/checkout_sdk/payments/sessions/sessions.py index 7823665..a4c5f47 100644 --- a/checkout_sdk/payments/sessions/sessions.py +++ b/checkout_sdk/payments/sessions/sessions.py @@ -2,7 +2,7 @@ from enum import Enum from checkout_sdk.common.enums import Currency -from checkout_sdk.payments.payments import PaymentType, BillingDescriptor, PaymentCustomerRequest, ShippingDetails, \ +from checkout_sdk.payments.payments import PaymentType, BillingDescriptor, ShippingDetails, \ PaymentRecipient, ProcessingSettings, RiskRequest, ThreeDsRequest, PaymentSender