Skip to content
Open
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
2 changes: 2 additions & 0 deletions checkout_sdk/checkout_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from checkout_sdk.reports.reports_client import ReportsClient
from checkout_sdk.metadata.metadata_client import CardMetadataClient
from checkout_sdk.forward.forward_client import ForwardClient
from checkout_sdk.payments.setups.setups_client import PaymentSetupsClient


def _base_api_client(configuration: CheckoutConfiguration) -> ApiClient:
Expand Down Expand Up @@ -76,3 +77,4 @@ def __init__(self, configuration: CheckoutConfiguration):
self.contexts = PaymentContextsClient(api_client=base_api_client, configuration=configuration)
self.payment_sessions = PaymentSessionsClient(api_client=base_api_client, configuration=configuration)
self.forward = ForwardClient(api_client=base_api_client, configuration=configuration)
self.setups = PaymentSetupsClient(api_client=base_api_client, configuration=configuration)
12 changes: 12 additions & 0 deletions checkout_sdk/payments/payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,21 @@ class ProcessingSettings:
surcharge_amount: int
pan_preference: PanPreference
provision_network_token: bool
affiliate_id: str
affiliate_url: str


class ProductSubType (str, Enum):
BLOCKCHAIN = 'BLOCKCHAIN'
CBDC = 'CBDC'
CRYPTOCURRENCY = 'CRYPTOCURRENCY'
NFT = 'NFT'
STABLECOIN = 'STABLECOIN'


class Product:
type: str
sub_type: list # ProductSubType
name: str
quantity: int
unit_price: int
Expand Down
4 changes: 4 additions & 0 deletions checkout_sdk/payments/setups/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .setups import *
from .setups_client import PaymentSetupsClient

__all__ = ['PaymentSetupsClient']
355 changes: 355 additions & 0 deletions checkout_sdk/payments/setups/setups.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,355 @@
from __future__ import absolute_import
from datetime import datetime
from enum import Enum

from checkout_sdk.common.common import Address, Phone, CustomerRetry
from checkout_sdk.common.enums import Currency, Country
from checkout_sdk.payments.payments import PaymentType, ShippingDetails
from checkout_sdk.payments.contexts.contexts import PaymentContextsItems, PaymentContextsTicket, PaymentContextsPassenger, PaymentContextsFlightLegDetails


# Enums
class PaymentMethodInitialization(str, Enum):
DISABLED = 'disabled'
ENABLED = 'enabled'


class PaymentMethodStatus(str, Enum):
"""Payment method status for responses"""
AVAILABLE = 'available'
REQUIRES_ACTION = 'requires_action'
UNAVAILABLE = 'unavailable'


class PaymentMethodOptionStatus(str, Enum):
"""Payment method option status for responses"""
UNAVAILABLE = 'unavailable'
ACTION_REQUIRED = 'action_required'
PENDING = 'pending'
READY = 'ready'


class PaymentStatus(str, Enum):
"""Payment status for confirm responses"""
AUTHORIZED = 'Authorized'
PENDING = 'Pending'
CARD_VERIFIED = 'Card Verified'
DECLINED = 'Declined'
RETRY_SCHEDULED = 'Retry Scheduled'


# Customer entities
class CustomerEmail:
def __init__(self):
self.address: str = None

Check warning on line 44 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC71m&open=AZsOKhLiay2GX59KC71m&pullRequest=196
self.verified: bool = None

Check warning on line 45 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "bool" with "Optional[bool]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC71n&open=AZsOKhLiay2GX59KC71n&pullRequest=196


class CustomerDevice:
def __init__(self):
self.locale: str = None


class MerchantAccount:
def __init__(self):
self.id: str = None
self.registration_date: datetime = None

Check warning on line 56 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "datetime" with "Optional[datetime]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC71q&open=AZsOKhLiay2GX59KC71q&pullRequest=196
self.last_modified: datetime = None

Check warning on line 57 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "datetime" with "Optional[datetime]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC71r&open=AZsOKhLiay2GX59KC71r&pullRequest=196
self.returning_customer: bool = None
self.first_transaction_date: datetime = None

Check warning on line 59 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "datetime" with "Optional[datetime]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC71t&open=AZsOKhLiay2GX59KC71t&pullRequest=196
self.last_transaction_date: datetime = None

Check warning on line 60 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "datetime" with "Optional[datetime]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC71u&open=AZsOKhLiay2GX59KC71u&pullRequest=196
self.total_order_count: int = None
self.last_payment_amount: int = None # Using int for consistency with amount fields


class Customer:
def __init__(self):
self.email: CustomerEmail = None
self.name: str = None
self.phone: Phone = None
self.device: CustomerDevice = None
self.merchant_account: MerchantAccount = None

Check warning on line 71 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "MerchantAccount" with "Optional[MerchantAccount]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC711&open=AZsOKhLiay2GX59KC711&pullRequest=196


# Payment Method Common entities
class PaymentMethodAction:
def __init__(self):
self.type: str = None

Check warning on line 77 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC712&open=AZsOKhLiay2GX59KC712&pullRequest=196
self.client_token: str = None
self.session_id: str = None

Check warning on line 79 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC714&open=AZsOKhLiay2GX59KC714&pullRequest=196


class PaymentMethodOption:
def __init__(self):
self.id: str = None

Check warning on line 84 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC715&open=AZsOKhLiay2GX59KC715&pullRequest=196
self.status: PaymentMethodOptionStatus = None # Enum: unavailable, action_required, pending, ready (for responses)
self.flags: list = None # list of str - error codes or indicators that highlight missing/invalid info
self.action: PaymentMethodAction = None


class PaymentMethodOptions:
def __init__(self):
self.sdk: PaymentMethodOption = None
self.pay_in_full: PaymentMethodOption = None
self.installments: PaymentMethodOption = None

Check warning on line 94 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "PaymentMethodOption" with "Optional[PaymentMethodOption]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC71_&open=AZsOKhLiay2GX59KC71_&pullRequest=196
self.pay_now: PaymentMethodOption = None


class PaymentMethodBase:
def __init__(self):
self.status: PaymentMethodStatus = None # Enum: available, requires_action, unavailable (for responses)
self.flags: list = None # list of str - error codes or indicators
self.initialization: PaymentMethodInitialization = PaymentMethodInitialization.DISABLED


# Klarna entities
class KlarnaAccountHolder:
def __init__(self):
self.billing_address: Address = None

Check warning on line 108 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "Address" with "Optional[Address]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC72D&open=AZsOKhLiay2GX59KC72D&pullRequest=196


class Klarna(PaymentMethodBase):
def __init__(self):
super().__init__()
self.account_holder: KlarnaAccountHolder = None

Check warning on line 114 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "KlarnaAccountHolder" with "Optional[KlarnaAccountHolder]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC72E&open=AZsOKhLiay2GX59KC72E&pullRequest=196
self.payment_method_options: PaymentMethodOptions = None

Check warning on line 115 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "PaymentMethodOptions" with "Optional[PaymentMethodOptions]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC72F&open=AZsOKhLiay2GX59KC72F&pullRequest=196


# Stcpay entities
class Stcpay(PaymentMethodBase):
def __init__(self):
super().__init__()
self.otp: str = None

Check warning on line 122 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC72G&open=AZsOKhLiay2GX59KC72G&pullRequest=196
self.payment_method_options: PaymentMethodOptions = None


# Tabby entities
class Tabby(PaymentMethodBase):
def __init__(self):
super().__init__()
self.payment_method_options: PaymentMethodOptions = None


# Bizum entities
class Bizum(PaymentMethodBase):
def __init__(self):
super().__init__()
self.payment_method_options: PaymentMethodOptions = None

Check warning on line 137 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "PaymentMethodOptions" with "Optional[PaymentMethodOptions]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC72J&open=AZsOKhLiay2GX59KC72J&pullRequest=196


class PaymentMethods:
def __init__(self):
self.klarna: Klarna = None
self.stcpay: Stcpay = None
self.tabby: Tabby = None
self.bizum: Bizum = None


# Settings entity
class Settings:
def __init__(self):
self.success_url: str = None
self.failure_url: str = None


# Order entities
class OrderSubMerchant:
def __init__(self):
self.id: str = None
self.product_category: str = None
self.number_of_trades: int = None

Check warning on line 160 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "int" with "Optional[int]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC72S&open=AZsOKhLiay2GX59KC72S&pullRequest=196
self.registration_date: datetime = None


class Order:
def __init__(self):
self.items: list = None # list of PaymentContextsItems (reused from contexts)
self.shipping = None # ShippingDetails (reused from common)
self.sub_merchants: list = None # list of OrderSubMerchant
self.discount_amount: int = None


# Industry entities (reusing from contexts where possible)
class AirlineData:
def __init__(self):
self.ticket = None # PaymentContextsTicket (reused from contexts)
self.passengers: list = None # list of PaymentContextsPassenger (reused from contexts)
self.flight_leg_details: list = None # list of PaymentContextsFlightLegDetails (reused from contexts)


class Industry:
def __init__(self):
self.airline_data: AirlineData = None

Check warning on line 182 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "AirlineData" with "Optional[AirlineData]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC72Z&open=AZsOKhLiay2GX59KC72Z&pullRequest=196
self.accommodation_data: list = None # list of AccommodationData (reused from contexts)


# Main Request and Response classes
class PaymentSetupsRequest:
def __init__(self):
self.processing_channel_id: str = None

Check warning on line 189 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC72b&open=AZsOKhLiay2GX59KC72b&pullRequest=196
self.amount: int = None
self.currency: Currency = None

Check warning on line 191 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "Currency" with "Optional[Currency]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC72d&open=AZsOKhLiay2GX59KC72d&pullRequest=196
self.payment_type: PaymentType = None
self.reference: str = None
self.description: str = None
self.payment_methods: PaymentMethods = None
self.settings: Settings = None
self.customer: Customer = None
self.order: Order = None

Check warning on line 198 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "Order" with "Optional[Order]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC72k&open=AZsOKhLiay2GX59KC72k&pullRequest=196
self.industry: Industry = None

Check warning on line 199 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "Industry" with "Optional[Industry]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC72l&open=AZsOKhLiay2GX59KC72l&pullRequest=196


class PaymentSetupsResponse:
def __init__(self):
self.id: str = None
self.processing_channel_id: str = None
self.amount: int = None
self.currency: Currency = None
self.payment_type: PaymentType = None
self.reference: str = None
self.description: str = None

Check warning on line 210 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC72s&open=AZsOKhLiay2GX59KC72s&pullRequest=196
self.payment_methods: PaymentMethods = None

Check warning on line 211 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "PaymentMethods" with "Optional[PaymentMethods]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC72t&open=AZsOKhLiay2GX59KC72t&pullRequest=196
self.settings: Settings = None
self.customer: Customer = None

Check warning on line 213 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "Customer" with "Optional[Customer]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC72v&open=AZsOKhLiay2GX59KC72v&pullRequest=196
self.order: Order = None

Check warning on line 214 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "Order" with "Optional[Order]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC72w&open=AZsOKhLiay2GX59KC72w&pullRequest=196
self.industry: Industry = None


# Customer Response for Confirm
class CustomerResponse:
def __init__(self):
self.id: str = None
self.email: str = None

Check warning on line 222 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC72z&open=AZsOKhLiay2GX59KC72z&pullRequest=196
self.name: str = None
self.phone: Phone = None
self.summary = None # Customer summary object for risk assessment


# Source for Confirm Response
class PaymentSetupSource:
def __init__(self):
self.type: str = None
self.id: str = None

Check warning on line 232 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC723&open=AZsOKhLiay2GX59KC723&pullRequest=196
self.expiry_month: int = None
self.expiry_year: int = None

Check warning on line 234 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "int" with "Optional[int]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC725&open=AZsOKhLiay2GX59KC725&pullRequest=196
self.last4: str = None
self.fingerprint: str = None

Check warning on line 236 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC727&open=AZsOKhLiay2GX59KC727&pullRequest=196
self.bin: str = None
self.billing_address: Address = None
self.phone: Phone = None
self.name: str = None

Check warning on line 240 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC72_&open=AZsOKhLiay2GX59KC72_&pullRequest=196
self.scheme: str = None
self.scheme_local: str = None

Check warning on line 242 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC73B&open=AZsOKhLiay2GX59KC73B&pullRequest=196
self.local_schemes: list = None # list of str
self.card_type: str = None
self.card_category: str = None
self.card_wallet_type: str = None
self.issuer: str = None
self.issuer_country: Country = None
self.product_id: str = None

Check warning on line 249 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC73I&open=AZsOKhLiay2GX59KC73I&pullRequest=196
self.product_type: str = None
self.avs_check: str = None
self.cvv_check: str = None
self.payment_account_reference: str = None

Check warning on line 253 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC73M&open=AZsOKhLiay2GX59KC73M&pullRequest=196
self.encrypted_card_number: str = None

Check warning on line 254 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC73N&open=AZsOKhLiay2GX59KC73N&pullRequest=196
self.account_update_status: str = None

Check warning on line 255 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC73O&open=AZsOKhLiay2GX59KC73O&pullRequest=196
self.account_update_failure_code: str = None
self.account_holder = None # Can be various types based on account holder type


# Nested classes for Confirm Response (reusing from payments)
class Risk:
def __init__(self):
self.flagged: bool = None
self.score: int = None


class ThreeDs:
def __init__(self):
self.downgraded: bool = None

Check warning on line 269 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "bool" with "Optional[bool]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC73S&open=AZsOKhLiay2GX59KC73S&pullRequest=196
self.enrolled: str = None
self.upgrade_reason: str = None

Check warning on line 271 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC73U&open=AZsOKhLiay2GX59KC73U&pullRequest=196


class Processing:
def __init__(self):
self.retrieval_reference_number: str = None
self.acquirer_transaction_id: str = None
self.recommendation_code: str = None
self.scheme: str = None # The scheme the transaction was processed with
self.partner_merchant_advice_code: str = None
self.partner_response_code: str = None
self.partner_order_id: str = None
self.partner_payment_id: str = None
self.partner_status: str = None
self.partner_transaction_id: str = None
self.partner_error_codes: list = None # list of str
self.partner_error_message: str = None

Check warning on line 287 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC73g&open=AZsOKhLiay2GX59KC73g&pullRequest=196
self.partner_authorization_code: str = None

Check warning on line 288 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC73h&open=AZsOKhLiay2GX59KC73h&pullRequest=196
self.partner_authorization_response_code: str = None
self.surcharge_amount: int = None
self.pan_type_processed: str = None
self.cko_network_token_available: bool = None

Check warning on line 292 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "bool" with "Optional[bool]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC73l&open=AZsOKhLiay2GX59KC73l&pullRequest=196
self.purchase_country: str = None

Check warning on line 293 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC73m&open=AZsOKhLiay2GX59KC73m&pullRequest=196
self.foreign_retailer_amount: int = None


# Additional classes for Confirm Response (reusing from common)
class Balances:
def __init__(self):
self.total_authorized: int = None
self.total_voided: int = None
self.available_to_void: int = None
self.total_captured: int = None

Check warning on line 303 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "int" with "Optional[int]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC73r&open=AZsOKhLiay2GX59KC73r&pullRequest=196
self.available_to_capture: int = None
self.total_refunded: int = None
self.available_to_refund: int = None


class Subscription:
def __init__(self):
self.id: str = None

Check warning on line 311 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC73v&open=AZsOKhLiay2GX59KC73v&pullRequest=196


class Retry(CustomerRetry):
def __init__(self):
super().__init__()
self.ends_on: datetime = None
self.next_attempt_on: datetime = None


# Confirm Response
class PaymentSetupsConfirmResponse:
def __init__(self):
self.id: str = None
self.action_id: str = None
self.amount: int = None
self.currency: Currency = None
self.approved: bool = None

Check warning on line 328 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "bool" with "Optional[bool]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC732&open=AZsOKhLiay2GX59KC732&pullRequest=196
self.status: str = None
self.response_code: str = None
self.processed_on: datetime = None

Check warning on line 331 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "datetime" with "Optional[datetime]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC735&open=AZsOKhLiay2GX59KC735&pullRequest=196
self.amount_requested: int = None
self.auth_code: str = None
self.response_summary: str = None

Check warning on line 334 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC738&open=AZsOKhLiay2GX59KC738&pullRequest=196
self.expires_on: str = None
self.threeds: ThreeDs = None

Check warning on line 336 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "ThreeDs" with "Optional[ThreeDs]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC73-&open=AZsOKhLiay2GX59KC73-&pullRequest=196
self.risk: Risk = None
self.source: PaymentSetupSource = None
self.customer: CustomerResponse = None
self.balances: Balances = None

Check warning on line 340 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "Balances" with "Optional[Balances]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC74C&open=AZsOKhLiay2GX59KC74C&pullRequest=196
self.reference: str = None
self.subscription: Subscription = None
self.processing: Processing = None
self.eci: str = None
self.scheme_id: str = None

Check warning on line 345 in checkout_sdk/payments/setups/setups.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the type hint "str" with "Optional[str]" or don't assign "None" to this expression

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-python&issues=AZsOKhLiay2GX59KC74H&open=AZsOKhLiay2GX59KC74H&pullRequest=196
self.retry: Retry = None

@property
def threeds_3ds(self):
"""API spec uses '3ds' as field name - this provides compatibility"""
return self.threeds

@threeds_3ds.setter
def threeds_3ds(self, value):
self.threeds = value
Loading
Loading