Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Payment Components #162

Merged
Show file tree
Hide file tree
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
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
Loading