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


@property
Expand Down Expand Up @@ -96,6 +98,26 @@ def acquirer_reason_description(self):
@acquirer_reason_description.setter
def acquirer_reason_description(self, value):
self.__acquirer_reason_description = value
@property
def ptsp_transaction_id(self):
"""Gets the ptsp_transaction_id of this AcquirerInfo.

"""
return self.__ptsp_transaction_id

@ptsp_transaction_id.setter
def ptsp_transaction_id(self, value):
self.__ptsp_transaction_id = value
@property
def acquirer_card_token(self):
"""
The card token assigned by the acquirer for card tokenization. Note: This parameter is returned if you integrate the APO product. More information: Maximum length: 64 characters
"""
return self.__acquirer_card_token

@acquirer_card_token.setter
def acquirer_card_token(self, value):
self.__acquirer_card_token = value



Expand All @@ -118,6 +140,10 @@ def to_ams_dict(self):
params['acquirerMerchantName'] = self.acquirer_merchant_name
if hasattr(self, "acquirer_reason_description") and self.acquirer_reason_description is not None:
params['acquirerReasonDescription'] = self.acquirer_reason_description
if hasattr(self, "ptsp_transaction_id") and self.ptsp_transaction_id is not None:
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
return params


Expand All @@ -140,3 +166,7 @@ def parse_rsp_body(self, response_body):
self.__acquirer_merchant_name = response_body['acquirerMerchantName']
if 'acquirerReasonDescription' in response_body:
self.__acquirer_reason_description = response_body['acquirerReasonDescription']
if 'ptspTransactionId' in response_body:
self.__ptsp_transaction_id = response_body['ptspTransactionId']
if 'acquirerCardToken' in response_body:
self.__acquirer_card_token = response_body['acquirerCardToken']
15 changes: 15 additions & 0 deletions com/alipay/ams/api/model/cardholder_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def __init__(self):

self.__card_holder_name = None # type: UserName
self.__bill_address = None # type: Address
self.__display_name = None # type: str


@property
Expand All @@ -32,6 +33,16 @@ def bill_address(self):
@bill_address.setter
def bill_address(self, value):
self.__bill_address = value
@property
def display_name(self):
"""
The name that is displayed on the card
"""
return self.__display_name

@display_name.setter
def display_name(self, value):
self.__display_name = value



Expand All @@ -42,6 +53,8 @@ def to_ams_dict(self):
params['cardHolderName'] = self.card_holder_name
if hasattr(self, "bill_address") and self.bill_address is not None:
params['billAddress'] = self.bill_address
if hasattr(self, "display_name") and self.display_name is not None:
params['displayName'] = self.display_name
return params


Expand All @@ -54,3 +67,5 @@ def parse_rsp_body(self, response_body):
if 'billAddress' in response_body:
self.__bill_address = Address()
self.__bill_address.parse_rsp_body(response_body['billAddress'])
if 'displayName' in response_body:
self.__display_name = response_body['displayName']
15 changes: 15 additions & 0 deletions com/alipay/ams/api/model/payment_result_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def __init__(self):
self.__exemption_requested = None # type: str
self.__credential_type_used = None # type: str
self.__rrn = None # type: str
self.__user_authorization_status = None # type: str


@property
Expand Down Expand Up @@ -297,6 +298,16 @@ def rrn(self):
@rrn.setter
def rrn(self, value):
self.__rrn = value
@property
def user_authorization_status(self):
"""
交易中用户是否授权绑定,当用户使用PAYPAY支付并且指定支付要素smartPaymentEnabled=true的情况下才会返回。 ● AUTHORIZED - 用户发起交易时时已授权,直接付款 ● UNAUTHORIZED - 用户发起交易时未授权,现授权后付款
"""
return self.__user_authorization_status

@user_authorization_status.setter
def user_authorization_status(self, value):
self.__user_authorization_status = value



Expand Down Expand Up @@ -355,6 +366,8 @@ def to_ams_dict(self):
params['credentialTypeUsed'] = self.credential_type_used
if hasattr(self, "rrn") and self.rrn is not None:
params['rrn'] = self.rrn
if hasattr(self, "user_authorization_status") and self.user_authorization_status is not None:
params['userAuthorizationStatus'] = self.user_authorization_status
return params


Expand Down Expand Up @@ -416,3 +429,5 @@ def parse_rsp_body(self, response_body):
self.__credential_type_used = response_body['credentialTypeUsed']
if 'rrn' in response_body:
self.__rrn = response_body['rrn']
if 'userAuthorizationStatus' in response_body:
self.__user_authorization_status = response_body['userAuthorizationStatus']
54 changes: 54 additions & 0 deletions com/alipay/ams/api/model/proration_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import json
from com.alipay.ams.api.model.amount import Amount




class ProrationSettings:
def __init__(self):

self.__proration_mode = None # type: str
self.__custom_amount = None # type: Amount


@property
def proration_mode(self):
"""
用于标识\"扣差价\"或者\"退差价\"场景。有差价处理需求场景必传。 取值范围: - IMMEDIATE_PAY_CUSTOM_AMOUNT:商户指定金额扣款模式,在这个模式下商户可以用customAmount的指定金额扣差价,差价需要商户提前算好 - IMMEDIATE_REFUND_CUSTOM_AMOUNT:商户指定金额退款模式,在这个模式下商户可以用customAmount的指定金额来退差价,差价需要商户提前算好
"""
return self.__proration_mode

@proration_mode.setter
def proration_mode(self, value):
self.__proration_mode = value
@property
def custom_amount(self):
"""Gets the custom_amount of this ProrationSettings.

"""
return self.__custom_amount

@custom_amount.setter
def custom_amount(self, value):
self.__custom_amount = value




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


def parse_rsp_body(self, response_body):
if isinstance(response_body, str):
response_body = json.loads(response_body)
if 'prorationMode' in response_body:
self.__proration_mode = response_body['prorationMode']
if 'customAmount' in response_body:
self.__custom_amount = Amount()
self.__custom_amount.parse_rsp_body(response_body['customAmount'])
67 changes: 67 additions & 0 deletions com/alipay/ams/api/model/refund_from_method.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import json




class RefundFromMethod:
def __init__(self):

self.__grant_token = None # type: str
self.__refund_from_method_type = None # type: str
self.__customer_id = None # type: str


@property
def grant_token(self):
"""
Represents the authentication token received from the supplier, used to authorize and securely perform fund deduction operations.
"""
return self.__grant_token

@grant_token.setter
def grant_token(self, value):
self.__grant_token = value
@property
def refund_from_method_type(self):
"""
Represents the payment method type used by merchant during payment
"""
return self.__refund_from_method_type

@refund_from_method_type.setter
def refund_from_method_type(self, value):
self.__refund_from_method_type = value
@property
def customer_id(self):
"""
The payee/supplier represented by ABA customer ID to get the refund from
"""
return self.__customer_id

@customer_id.setter
def customer_id(self, value):
self.__customer_id = value




def to_ams_dict(self):
params = dict()
if hasattr(self, "grant_token") and self.grant_token is not None:
params['grantToken'] = self.grant_token
if hasattr(self, "refund_from_method_type") and self.refund_from_method_type is not None:
params['refundFromMethodType'] = self.refund_from_method_type
if hasattr(self, "customer_id") and self.customer_id is not None:
params['customerId'] = self.customer_id
return params


def parse_rsp_body(self, response_body):
if isinstance(response_body, str):
response_body = json.loads(response_body)
if 'grantToken' in response_body:
self.__grant_token = response_body['grantToken']
if 'refundFromMethodType' in response_body:
self.__refund_from_method_type = response_body['refundFromMethodType']
if 'customerId' in response_body:
self.__customer_id = response_body['customerId']
Loading