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']
16 changes: 8 additions & 8 deletions com/alipay/ams/api/model/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def __init__(self):

@property
def card_no(self):
"""Gets the card_no of this Card.

"""
The card number.
"""
return self.__card_no

Expand All @@ -26,8 +26,8 @@ def card_no(self, value):
self.__card_no = value
@property
def cvv(self):
"""Gets the cvv of this Card.

"""
The card verification value (CVV), which is also known as a card security code (CSC) or a card verification code (CVC).Specify this parameter when the value of paymentMethodRegion is GLOBAL, BR, CL, MX, or PE.
"""
return self.__cvv

Expand All @@ -36,8 +36,8 @@ def cvv(self, value):
self.__cvv = value
@property
def expiry_year(self):
"""Gets the expiry_year of this Card.

"""
The year the card expires. Pass in the last two digits of the year number. For example, if the expiry year is 2025, the value of this parameter is ​25​.
"""
return self.__expiry_year

Expand All @@ -46,8 +46,8 @@ def expiry_year(self, value):
self.__expiry_year = value
@property
def expiry_month(self):
"""Gets the expiry_month of this Card.

"""
The month the card expires. Pass in two digits representing the month. For example, if the expiry month is February, the value of this parameter is ​02​.
"""
return self.__expiry_month

Expand Down
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']
6 changes: 3 additions & 3 deletions com/alipay/ams/api/model/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def device_token_id(self, value):
@property
def client_ip(self):
"""
Client IP address of the device.
The IP address of the client device. Note: Specify this parameter when one of the following conditions is met: You require risk control. The value of paymentMethodType is CARD. Providing this information helps to increase the accuracy of anti-money laundering and fraud detection, and increase payment success rates.
"""
return self.__client_ip

Expand Down Expand Up @@ -193,7 +193,7 @@ def device_model(self, value):
@property
def device_language(self):
"""
Device language of the user.
The language of the device where the user places an order. Note: Specify this parameter if you require risk control. Providing this information helps to identify black-market behavior.
"""
return self.__device_language

Expand All @@ -203,7 +203,7 @@ def device_language(self, value):
@property
def device_id(self):
"""
Device ID of the user.
The unique ID of the device the user places an order with. Note: Specify this parameter if you require risk control. This parameter can be used to build a trusted relationship between users and commonly used devices, thereby reducing risk control interruptions and increasing the payment success rate.
"""
return self.__device_id

Expand Down
82 changes: 82 additions & 0 deletions com/alipay/ams/api/model/paginator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import json




class Paginator:
def __init__(self):

self.__current_page = None # type: int
self.__page_size = None # type: int
self.__total_page = None # type: int
self.__total_count = None # type: int


@property
def current_page(self):
"""
The current page number, start from 1.
"""
return self.__current_page

@current_page.setter
def current_page(self, value):
self.__current_page = value
@property
def page_size(self):
"""
The maximum records returned per page.
"""
return self.__page_size

@page_size.setter
def page_size(self, value):
self.__page_size = value
@property
def total_page(self):
"""
Total number of pages.
"""
return self.__total_page

@total_page.setter
def total_page(self, value):
self.__total_page = value
@property
def total_count(self):
"""
Total items that match the criteria.
"""
return self.__total_count

@total_count.setter
def total_count(self, value):
self.__total_count = value




def to_ams_dict(self):
params = dict()
if hasattr(self, "current_page") and self.current_page is not None:
params['currentPage'] = self.current_page
if hasattr(self, "page_size") and self.page_size is not None:
params['pageSize'] = self.page_size
if hasattr(self, "total_page") and self.total_page is not None:
params['totalPage'] = self.total_page
if hasattr(self, "total_count") and self.total_count is not None:
params['totalCount'] = self.total_count
return params


def parse_rsp_body(self, response_body):
if isinstance(response_body, str):
response_body = json.loads(response_body)
if 'currentPage' in response_body:
self.__current_page = response_body['currentPage']
if 'pageSize' in response_body:
self.__page_size = response_body['pageSize']
if 'totalPage' in response_body:
self.__total_page = response_body['totalPage']
if 'totalCount' in response_body:
self.__total_count = response_body['totalCount']
21 changes: 18 additions & 3 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 @@ -250,7 +251,7 @@ def expiry_year(self, value):
@property
def card_category(self):
"""
Added field for card category
The payment card category. Valid vaules are: CONSUMER: the personal card COMMERCIAL: the business card
"""
return self.__card_category

Expand All @@ -270,7 +271,7 @@ def account_no(self, value):
@property
def exemption_requested(self):
"""
Added field for exemption requested
The exemption type that Antom requested for in the payment authorization. Valid values are: lowValue: Transactions below €30 may be exempt from Strong Customer Authentication, if certain cumulative amount and transaction count criteria are met. transactionRiskAnalysis: Transactions considered at low risk of fraud based on the fraud level of the payment provider.
"""
return self.__exemption_requested

Expand All @@ -280,7 +281,7 @@ def exemption_requested(self, value):
@property
def credential_type_used(self):
"""
Added field for credential type used
Indicates whether the transaction was processed with the primary account number (PAN) or a network token. PAN: The transaction was processed using the PAN. NETWORK_TOKEN: The transaction was processed using a network token provided by the merchant or Antom.
"""
return self.__credential_type_used

Expand All @@ -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']
21 changes: 21 additions & 0 deletions com/alipay/ams/api/model/payment_status.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from enum import Enum, unique
@unique
class PaymentStatus(Enum):
"""Indicates the payment status. Valid values are: - SUCCESS: Indicates that the payment succeeds. - FAIL: Indicates that the payment fails."""

SUCCESS = "SUCCESS"
FAIL = "FAIL"

def to_ams_dict(self) -> str:
return self.name

@staticmethod
def value_of(value):
if not value:
return None

if PaymentStatus.SUCCESS.value == value:
return PaymentStatus.SUCCESS
if PaymentStatus.FAIL.value == value:
return PaymentStatus.FAIL
return None
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'])
Loading