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
15 changes: 15 additions & 0 deletions com/alipay/ams/api/model/acquirer_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def __init__(self):
self.__acquirer_reason_description = None # type: str
self.__ptsp_transaction_id = None # type: str
self.__acquirer_card_token = None # type: str
self.__acquirer_fingerprint = None # type: str


@property
Expand Down Expand Up @@ -118,6 +119,16 @@ def acquirer_card_token(self):
@acquirer_card_token.setter
def acquirer_card_token(self, value):
self.__acquirer_card_token = value
@property
def acquirer_fingerprint(self):
"""
An acquirer-generated, irreversible card fingerprint passed through for card identification, reconciliation, and risk deduplication. It is returned only for APO merchants enrolled in fingerprint passthrough when Checkout.com is the acquirer and the original scenario is card vaulting or payment with vaulting. It is not returned in other scenarios and may be empty. Maximum length: 64 characters.
"""
return self.__acquirer_fingerprint

@acquirer_fingerprint.setter
def acquirer_fingerprint(self, value):
self.__acquirer_fingerprint = value



Expand All @@ -144,6 +155,8 @@ def to_ams_dict(self):
params['ptspTransactionId'] = self.ptsp_transaction_id
if hasattr(self, "acquirer_card_token") and self.acquirer_card_token is not None:
params['acquirerCardToken'] = self.acquirer_card_token
if hasattr(self, "acquirer_fingerprint") and self.acquirer_fingerprint is not None:
params['acquirerFingerprint'] = self.acquirer_fingerprint
return params


Expand All @@ -170,3 +183,5 @@ def parse_rsp_body(self, response_body):
self.__ptsp_transaction_id = response_body['ptspTransactionId']
if 'acquirerCardToken' in response_body:
self.__acquirer_card_token = response_body['acquirerCardToken']
if 'acquirerFingerprint' in response_body:
self.__acquirer_fingerprint = response_body['acquirerFingerprint']
37 changes: 37 additions & 0 deletions com/alipay/ams/api/model/automatic_tax.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import json




class AutomaticTax:
def __init__(self):

self.__enabled = None # type: bool


@property
def enabled(self):
"""
Indicates whether automatic tax is enabled for this payment session. This field is required when automaticTax is provided. true enables automatic tax and false disables it for this session when merchant tax settings exist.
"""
return self.__enabled

@enabled.setter
def enabled(self, value):
self.__enabled = value




def to_ams_dict(self):
params = dict()
if hasattr(self, "enabled") and self.enabled is not None:
params['enabled'] = self.enabled
return params


def parse_rsp_body(self, response_body):
if isinstance(response_body, str):
response_body = json.loads(response_body)
if 'enabled' in response_body:
self.__enabled = response_body['enabled']
37 changes: 37 additions & 0 deletions com/alipay/ams/api/model/buyer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import json
from com.alipay.ams.api.model.user_name import UserName
from com.alipay.ams.api.model.amount import Amount
from com.alipay.ams.api.model.buyer_tax_id import BuyerTaxId
from com.alipay.ams.api.model.address import Address



Expand All @@ -19,6 +21,8 @@ def __init__(self):
self.__successful_order_amount = None # type: Amount
self.__date_of_last_paid_purchase = None # type: str
self.__date_of_first_paid_purchase = None # type: str
self.__tax_ids = None # type: [BuyerTaxId]
self.__business_address = None # type: Address


@property
Expand Down Expand Up @@ -131,6 +135,26 @@ def date_of_first_paid_purchase(self):
@date_of_first_paid_purchase.setter
def date_of_first_paid_purchase(self, value):
self.__date_of_first_paid_purchase = value
@property
def tax_ids(self):
"""
For createPaymentSession, these buyer tax IDs are used for B2B or reverse-charge determination when automatic tax is active. If omitted, null, invalid, or unusable, Antom calculates tax as B2C instead of rejecting the payment session. Because Buyer is a shared SDK model, omit this field in APIs that do not explicitly document support. Maximum size: 10.
"""
return self.__tax_ids

@tax_ids.setter
def tax_ids(self, value):
self.__tax_ids = value
@property
def business_address(self):
"""Gets the business_address of this Buyer.

"""
return self.__business_address

@business_address.setter
def business_address(self, value):
self.__business_address = value



Expand Down Expand Up @@ -159,6 +183,10 @@ def to_ams_dict(self):
params['dateOfLastPaidPurchase'] = self.date_of_last_paid_purchase
if hasattr(self, "date_of_first_paid_purchase") and self.date_of_first_paid_purchase is not None:
params['dateOfFirstPaidPurchase'] = self.date_of_first_paid_purchase
if hasattr(self, "tax_ids") and self.tax_ids is not None:
params['taxIds'] = self.tax_ids
if hasattr(self, "business_address") and self.business_address is not None:
params['businessAddress'] = self.business_address
return params


Expand Down Expand Up @@ -189,3 +217,12 @@ def parse_rsp_body(self, response_body):
self.__date_of_last_paid_purchase = response_body['dateOfLastPaidPurchase']
if 'dateOfFirstPaidPurchase' in response_body:
self.__date_of_first_paid_purchase = response_body['dateOfFirstPaidPurchase']
if 'taxIds' in response_body:
self.__tax_ids = []
for item in response_body['taxIds']:
obj = BuyerTaxId()
obj.parse_rsp_body(item)
self.__tax_ids.append(obj)
if 'businessAddress' in response_body:
self.__business_address = Address()
self.__business_address.parse_rsp_body(response_body['businessAddress'])
67 changes: 67 additions & 0 deletions com/alipay/ams/api/model/buyer_tax_id.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import json




class BuyerTaxId:
def __init__(self):

self.__country = None # type: str
self.__region = None # type: str
self.__value = None # type: str


@property
def country(self):
"""
The two-letter ISO 3166-1 alpha-2 country or region code used to validate the tax ID. Maximum length: 2 characters.
"""
return self.__country

@country.setter
def country(self, value):
self.__country = value
@property
def region(self):
"""
The two-character country-specific subdivision code. Required only when the applicable tax authority or country or region rule requires subdivision-level identification. Maximum length: 2 characters.
"""
return self.__region

@region.setter
def region(self, value):
self.__region = value
@property
def value(self):
"""
The buyer tax ID value. The accepted format is country-specific. Maximum length: 64 characters.
"""
return self.__value

@value.setter
def value(self, value):
self.__value = value




def to_ams_dict(self):
params = dict()
if hasattr(self, "country") and self.country is not None:
params['country'] = self.country
if hasattr(self, "region") and self.region is not None:
params['region'] = self.region
if hasattr(self, "value") and self.value is not None:
params['value'] = self.value
return params


def parse_rsp_body(self, response_body):
if isinstance(response_body, str):
response_body = json.loads(response_body)
if 'country' in response_body:
self.__country = response_body['country']
if 'region' in response_body:
self.__region = response_body['region']
if 'value' in response_body:
self.__value = response_body['value']
30 changes: 30 additions & 0 deletions com/alipay/ams/api/model/goods.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def __init__(self):
self.__goods_discount_amount = None # type: Amount
self.__goods_ends_on_time = None # type: str
self.__cross_sell = None # type: Goods
self.__tax_code = None # type: str
self.__tax_behavior = None # type: str


@property
Expand Down Expand Up @@ -164,6 +166,26 @@ def cross_sell(self):
@cross_sell.setter
def cross_sell(self, value):
self.__cross_sell = value
@property
def tax_code(self):
"""
For createPaymentSession, this is the product tax code used by Antom GlobalTax to classify the goods line. When automatic tax is active, omit it to use the merchant default tax code. Because Goods is a shared SDK model, omit this field in APIs that do not explicitly document support. Maximum length: 64 characters.
"""
return self.__tax_code

@tax_code.setter
def tax_code(self, value):
self.__tax_code = value
@property
def tax_behavior(self):
"""
For createPaymentSession, this value indicates whether the goods-line price excludes or includes tax. Supported values are EXCLUSIVE and INCLUSIVE. When automatic tax is active, omit it to use the merchant tax behavior settings. Because Goods is a shared SDK model, omit this field in APIs that do not explicitly document support. Maximum length: 16 characters.
"""
return self.__tax_behavior

@tax_behavior.setter
def tax_behavior(self, value):
self.__tax_behavior = value



Expand Down Expand Up @@ -198,6 +220,10 @@ def to_ams_dict(self):
params['goodsEndsOnTime'] = self.goods_ends_on_time
if hasattr(self, "cross_sell") and self.cross_sell is not None:
params['crossSell'] = self.cross_sell
if hasattr(self, "tax_code") and self.tax_code is not None:
params['taxCode'] = self.tax_code
if hasattr(self, "tax_behavior") and self.tax_behavior is not None:
params['taxBehavior'] = self.tax_behavior
return params


Expand Down Expand Up @@ -235,3 +261,7 @@ def parse_rsp_body(self, response_body):
if 'crossSell' in response_body:
self.__cross_sell = Goods()
self.__cross_sell.parse_rsp_body(response_body['crossSell'])
if 'taxCode' in response_body:
self.__tax_code = response_body['taxCode']
if 'taxBehavior' in response_body:
self.__tax_behavior = response_body['taxBehavior']
15 changes: 15 additions & 0 deletions com/alipay/ams/api/model/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def __init__(self):
self.__need_declaration = None # type: bool
self.__declaration = None # type: Declaration
self.__order_type = None # type: str
self.__tax_calculation_id = None # type: str


@property
Expand Down Expand Up @@ -207,6 +208,16 @@ def order_type(self):
@order_type.setter
def order_type(self, value):
self.__order_type = value
@property
def tax_calculation_id(self):
"""
For the pay API, this is the tax calculation ID returned by the Tax calculate API. It associates the order with a valid, unexpired tax calculation; omit it for the existing non-tax flow. Because Order is a shared SDK model, omit this field in APIs that do not explicitly document support. Maximum length: 64 characters.
"""
return self.__tax_calculation_id

@tax_calculation_id.setter
def tax_calculation_id(self, value):
self.__tax_calculation_id = value



Expand Down Expand Up @@ -247,6 +258,8 @@ def to_ams_dict(self):
params['declaration'] = self.declaration
if hasattr(self, "order_type") and self.order_type is not None:
params['orderType'] = self.order_type
if hasattr(self, "tax_calculation_id") and self.tax_calculation_id is not None:
params['taxCalculationId'] = self.tax_calculation_id
return params


Expand Down Expand Up @@ -302,3 +315,5 @@ def parse_rsp_body(self, response_body):
self.__declaration.parse_rsp_body(response_body['declaration'])
if 'orderType' in response_body:
self.__order_type = response_body['orderType']
if 'taxCalculationId' in response_body:
self.__tax_calculation_id = response_body['taxCalculationId']
30 changes: 30 additions & 0 deletions com/alipay/ams/api/model/shipping.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def __init__(self):
self.__shipping_number = None # type: str
self.__notes = None # type: str
self.__tracking_url = None # type: str
self.__tax_code = None # type: str
self.__tax_behavior = None # type: str


@property
Expand Down Expand Up @@ -144,6 +146,26 @@ def tracking_url(self):
@tracking_url.setter
def tracking_url(self, value):
self.__tracking_url = value
@property
def tax_code(self):
"""
For createPaymentSession, this is the tax code used by Antom GlobalTax to classify shipping. When automatic tax is active, omit it to use the default shipping tax code. Because Shipping is a shared SDK model, omit this field in APIs that do not explicitly document support. Maximum length: 64 characters.
"""
return self.__tax_code

@tax_code.setter
def tax_code(self, value):
self.__tax_code = value
@property
def tax_behavior(self):
"""
For createPaymentSession, this value indicates whether the shipping fee excludes or includes tax. Supported values are EXCLUSIVE and INCLUSIVE. When automatic tax is active, omit it to use the merchant tax behavior settings. Because Shipping is a shared SDK model, omit this field in APIs that do not explicitly document support. Maximum length: 16 characters.
"""
return self.__tax_behavior

@tax_behavior.setter
def tax_behavior(self, value):
self.__tax_behavior = value



Expand Down Expand Up @@ -174,6 +196,10 @@ def to_ams_dict(self):
params['notes'] = self.notes
if hasattr(self, "tracking_url") and self.tracking_url is not None:
params['trackingUrl'] = self.tracking_url
if hasattr(self, "tax_code") and self.tax_code is not None:
params['taxCode'] = self.tax_code
if hasattr(self, "tax_behavior") and self.tax_behavior is not None:
params['taxBehavior'] = self.tax_behavior
return params


Expand Down Expand Up @@ -208,3 +234,7 @@ def parse_rsp_body(self, response_body):
self.__notes = response_body['notes']
if 'trackingUrl' in response_body:
self.__tracking_url = response_body['trackingUrl']
if 'taxCode' in response_body:
self.__tax_code = response_body['taxCode']
if 'taxBehavior' in response_body:
self.__tax_behavior = response_body['taxBehavior']
Loading