Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions checkout_sdk/payments/sessions/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -27,6 +27,7 @@ class PaymentMethodsType(str, Enum):
MOBILEPAY = 'mobilepay'
MULTIBANCO = 'multibanco'
P24 = 'p24'
PAYNOW = 'paynow'
PAYPAL = 'paypal'
PLAID = 'plaid'
QPAY = 'qpay'
Expand All @@ -40,6 +41,7 @@ class PaymentMethodsType(str, Enum):
TRUEMONEY = 'truemoney'
TWINT = 'twint'
VIPPS = 'vipps'
WECHATPAY = 'wechatpay'


class Locale(str, Enum):
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -207,7 +229,7 @@ class PaymentSessionsRequest:
billing_descriptor: BillingDescriptor
reference: str
description: str
customer: PaymentCustomerRequest
customer: SessionPaymentCustomerRequest
shipping: ShippingDetails
recipient: PaymentRecipient
processing: ProcessingSettings
Expand Down Expand Up @@ -242,7 +264,7 @@ class PaymentSessionWithPaymentRequest:
billing_descriptor: BillingDescriptor
reference: str
description: str
customer: PaymentCustomerRequest
customer: SessionPaymentCustomerRequest
shipping: ShippingDetails
recipient: PaymentRecipient
processing: ProcessingSettings
Expand All @@ -268,3 +290,4 @@ class SubmitPaymentSessionRequest:
items: list # Item
three_ds: ThreeDsRequest
ip_address: str
payment_type: PaymentType