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
84 changes: 48 additions & 36 deletions com/alipay/ams/api/model/customer_belongs_to.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,36 @@
class CustomerBelongsTo(Enum):
"""CustomerBelongsTo枚举类"""

RABBIT_LINE_PAY = "RABBIT_LINE_PAY"
TRUEMONEY = "TRUEMONEY"
ALIPAY_HK = "ALIPAY_HK"
TNG = "TNG"
ALIPAY_CN = "ALIPAY_CN"
GCASH = "GCASH"
ALIPAY_HK = "ALIPAY_HK"
MPAY = "MPAY"
DANA = "DANA"
KAKAOPAY = "KAKAOPAY"
BKASH = "BKASH"
EASYPAISA = "EASYPAISA"
PAYPAY = "PAYPAY"
BOOST = "BOOST"
TNG = "TNG"
GRABPAY_MY = "GRABPAY_MY"
HIPAY = "HIPAY"
GCASH = "GCASH"
MAYA = "MAYA"
GRABPAY_PH = "GRABPAY_PH"
GRABPAY_SG = "GRABPAY_SG"
KAKAOPAY = "KAKAOPAY"
NAVERPAY = "NAVERPAY"
JKOPAY = "JKOPAY"
TOSSPAY = "TOSSPAY"
RABBIT_LINE_PAY = "RABBIT_LINE_PAY"
TRUEMONEY = "TRUEMONEY"
KPLUS = "KPLUS"
DIRECT_DEBIT_SIAMCOMMERCIALBANK = "DIRECT_DEBIT_SIAMCOMMERCIALBANK"
DIRECT_DEBIT_KRUNGTHAIBANK = "DIRECT_DEBIT_KRUNGTHAIBANK"
ACH_DIRECT_DEBIT = "ACH_DIRECT_DEBIT"
ZALOPAY = "ZALOPAY"
DIRECTDEBIT_YAPILY = "DIRECTDEBIT_YAPILY"
TOSSPAY = "TOSSPAY"
MOMO = "MOMO"
ANTOM_BIZ_ACCOUNT = "ANTOM_BIZ_ACCOUNT"
VIETTELMONEY = "VIETTELMONEY"
JKOPAY = "JKOPAY"
BKASH = "BKASH"
EASYPAISA = "EASYPAISA"
DIRECTDEBIT_YAPILY = "DIRECTDEBIT_YAPILY"
ANTIM_BIZ_ACCOUNT = "ANTIM_BIZ_ACCOUNT"

def to_ams_dict(self) -> str:
return self.name
Expand All @@ -38,56 +42,64 @@ def value_of(value):
if not value:
return None

if CustomerBelongsTo.RABBIT_LINE_PAY.value == value:
return CustomerBelongsTo.RABBIT_LINE_PAY
if CustomerBelongsTo.TRUEMONEY.value == value:
return CustomerBelongsTo.TRUEMONEY
if CustomerBelongsTo.ALIPAY_HK.value == value:
return CustomerBelongsTo.ALIPAY_HK
if CustomerBelongsTo.TNG.value == value:
return CustomerBelongsTo.TNG
if CustomerBelongsTo.ALIPAY_CN.value == value:
return CustomerBelongsTo.ALIPAY_CN
if CustomerBelongsTo.GCASH.value == value:
return CustomerBelongsTo.GCASH
if CustomerBelongsTo.ALIPAY_HK.value == value:
return CustomerBelongsTo.ALIPAY_HK
if CustomerBelongsTo.MPAY.value == value:
return CustomerBelongsTo.MPAY
if CustomerBelongsTo.DANA.value == value:
return CustomerBelongsTo.DANA
if CustomerBelongsTo.KAKAOPAY.value == value:
return CustomerBelongsTo.KAKAOPAY
if CustomerBelongsTo.BKASH.value == value:
return CustomerBelongsTo.BKASH
if CustomerBelongsTo.EASYPAISA.value == value:
return CustomerBelongsTo.EASYPAISA
if CustomerBelongsTo.PAYPAY.value == value:
return CustomerBelongsTo.PAYPAY
if CustomerBelongsTo.BOOST.value == value:
return CustomerBelongsTo.BOOST
if CustomerBelongsTo.TNG.value == value:
return CustomerBelongsTo.TNG
if CustomerBelongsTo.GRABPAY_MY.value == value:
return CustomerBelongsTo.GRABPAY_MY
if CustomerBelongsTo.HIPAY.value == value:
return CustomerBelongsTo.HIPAY
if CustomerBelongsTo.GCASH.value == value:
return CustomerBelongsTo.GCASH
if CustomerBelongsTo.MAYA.value == value:
return CustomerBelongsTo.MAYA
if CustomerBelongsTo.GRABPAY_PH.value == value:
return CustomerBelongsTo.GRABPAY_PH
if CustomerBelongsTo.GRABPAY_SG.value == value:
return CustomerBelongsTo.GRABPAY_SG
if CustomerBelongsTo.KAKAOPAY.value == value:
return CustomerBelongsTo.KAKAOPAY
if CustomerBelongsTo.NAVERPAY.value == value:
return CustomerBelongsTo.NAVERPAY
if CustomerBelongsTo.JKOPAY.value == value:
return CustomerBelongsTo.JKOPAY
if CustomerBelongsTo.TOSSPAY.value == value:
return CustomerBelongsTo.TOSSPAY
if CustomerBelongsTo.RABBIT_LINE_PAY.value == value:
return CustomerBelongsTo.RABBIT_LINE_PAY
if CustomerBelongsTo.TRUEMONEY.value == value:
return CustomerBelongsTo.TRUEMONEY
if CustomerBelongsTo.KPLUS.value == value:
return CustomerBelongsTo.KPLUS
if CustomerBelongsTo.DIRECT_DEBIT_SIAMCOMMERCIALBANK.value == value:
return CustomerBelongsTo.DIRECT_DEBIT_SIAMCOMMERCIALBANK
if CustomerBelongsTo.DIRECT_DEBIT_KRUNGTHAIBANK.value == value:
return CustomerBelongsTo.DIRECT_DEBIT_KRUNGTHAIBANK
if CustomerBelongsTo.ACH_DIRECT_DEBIT.value == value:
return CustomerBelongsTo.ACH_DIRECT_DEBIT
if CustomerBelongsTo.ZALOPAY.value == value:
return CustomerBelongsTo.ZALOPAY
if CustomerBelongsTo.DIRECTDEBIT_YAPILY.value == value:
return CustomerBelongsTo.DIRECTDEBIT_YAPILY
if CustomerBelongsTo.TOSSPAY.value == value:
return CustomerBelongsTo.TOSSPAY
if CustomerBelongsTo.MOMO.value == value:
return CustomerBelongsTo.MOMO
if CustomerBelongsTo.ANTOM_BIZ_ACCOUNT.value == value:
return CustomerBelongsTo.ANTOM_BIZ_ACCOUNT
if CustomerBelongsTo.VIETTELMONEY.value == value:
return CustomerBelongsTo.VIETTELMONEY
if CustomerBelongsTo.JKOPAY.value == value:
return CustomerBelongsTo.JKOPAY
if CustomerBelongsTo.BKASH.value == value:
return CustomerBelongsTo.BKASH
if CustomerBelongsTo.EASYPAISA.value == value:
return CustomerBelongsTo.EASYPAISA
if CustomerBelongsTo.DIRECTDEBIT_YAPILY.value == value:
return CustomerBelongsTo.DIRECTDEBIT_YAPILY
if CustomerBelongsTo.ANTIM_BIZ_ACCOUNT.value == value:
return CustomerBelongsTo.ANTIM_BIZ_ACCOUNT
return None
3 changes: 3 additions & 0 deletions com/alipay/ams/api/model/payment_method_category_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class PaymentMethodCategoryType(Enum):
ONLINE_BANKING = "ONLINE_BANKING"
CARD = "CARD"
OTC = "OTC"
VA = "VA"

def to_ams_dict(self) -> str:
return self.name
Expand All @@ -33,4 +34,6 @@ def value_of(value):
return PaymentMethodCategoryType.CARD
if PaymentMethodCategoryType.OTC.value == value:
return PaymentMethodCategoryType.OTC
if PaymentMethodCategoryType.VA.value == value:
return PaymentMethodCategoryType.VA
return None
19 changes: 17 additions & 2 deletions com/alipay/ams/api/model/payment_result_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def __init__(self):
self.__credential_type_used = None # type: str
self.__rrn = None # type: str
self.__user_authorization_status = None # type: str
self.__authorization_code = None # type: str


@property
Expand Down Expand Up @@ -231,7 +232,7 @@ def last_four(self, value):
@property
def expiry_month(self):
"""
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. Note: This parameter is returned when the value of paymentMethodType in the pay (Checkout Payment) API is CARD for specific merchants in specific regions. More information: Maximum length: 2 characters
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. Note: This parameter is returned when the value of paymentMethodType in the pay (One-time Payments) API is CARD.
"""
return self.__expiry_month

Expand All @@ -241,7 +242,7 @@ def expiry_month(self, value):
@property
def expiry_year(self):
"""
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. Note: This parameter is returned when the value of paymentMethodType in the pay (Checkout Payment) API is CARD for specific merchants in specific regions. More information: Maximum length: 2 characters
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. Note: This parameter is returned when the value of paymentMethodType in the pay (One-time Payments) API is CARD.
"""
return self.__expiry_year

Expand Down Expand Up @@ -308,6 +309,16 @@ def user_authorization_status(self):
@user_authorization_status.setter
def user_authorization_status(self, value):
self.__user_authorization_status = value
@property
def authorization_code(self):
"""
The authorization code returned by the payment channel upon successful authorization.
"""
return self.__authorization_code

@authorization_code.setter
def authorization_code(self, value):
self.__authorization_code = value



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


Expand Down Expand Up @@ -431,3 +444,5 @@ def parse_rsp_body(self, response_body):
self.__rrn = response_body['rrn']
if 'userAuthorizationStatus' in response_body:
self.__user_authorization_status = response_body['userAuthorizationStatus']
if 'authorizationCode' in response_body:
self.__authorization_code = response_body['authorizationCode']
Loading