diff --git a/com/alipay/ams/api/model/acquirer_info.py b/com/alipay/ams/api/model/acquirer_info.py index 80a27ab..9a61232 100644 --- a/com/alipay/ams/api/model/acquirer_info.py +++ b/com/alipay/ams/api/model/acquirer_info.py @@ -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 @@ -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 @@ -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 @@ -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'] diff --git a/com/alipay/ams/api/model/card.py b/com/alipay/ams/api/model/card.py index 4a26583..299a02a 100644 --- a/com/alipay/ams/api/model/card.py +++ b/com/alipay/ams/api/model/card.py @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/com/alipay/ams/api/model/cardholder_info.py b/com/alipay/ams/api/model/cardholder_info.py index 452aaaa..3ec6af8 100644 --- a/com/alipay/ams/api/model/cardholder_info.py +++ b/com/alipay/ams/api/model/cardholder_info.py @@ -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 @@ -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 @@ -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 @@ -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'] diff --git a/com/alipay/ams/api/model/env.py b/com/alipay/ams/api/model/env.py index ed34874..c8c2842 100644 --- a/com/alipay/ams/api/model/env.py +++ b/com/alipay/ams/api/model/env.py @@ -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 @@ -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 @@ -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 diff --git a/com/alipay/ams/api/model/paginator.py b/com/alipay/ams/api/model/paginator.py new file mode 100644 index 0000000..384ce11 --- /dev/null +++ b/com/alipay/ams/api/model/paginator.py @@ -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'] diff --git a/com/alipay/ams/api/model/payment_result_info.py b/com/alipay/ams/api/model/payment_result_info.py index 561f13b..fb22100 100644 --- a/com/alipay/ams/api/model/payment_result_info.py +++ b/com/alipay/ams/api/model/payment_result_info.py @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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'] diff --git a/com/alipay/ams/api/model/payment_status.py b/com/alipay/ams/api/model/payment_status.py new file mode 100644 index 0000000..a61a145 --- /dev/null +++ b/com/alipay/ams/api/model/payment_status.py @@ -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 diff --git a/com/alipay/ams/api/model/proration_settings.py b/com/alipay/ams/api/model/proration_settings.py new file mode 100644 index 0000000..892b98d --- /dev/null +++ b/com/alipay/ams/api/model/proration_settings.py @@ -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']) diff --git a/com/alipay/ams/api/model/quote.py b/com/alipay/ams/api/model/quote.py index 4700cbf..8ad6fc6 100644 --- a/com/alipay/ams/api/model/quote.py +++ b/com/alipay/ams/api/model/quote.py @@ -69,7 +69,7 @@ def quote_expiry_time(self, value): @property def guaranteed(self): """ - Guaranteed exchange rate available for payment. + Guaranteed exchange rate available for payment. """ return self.__guaranteed diff --git a/com/alipay/ams/api/model/refund_from_method.py b/com/alipay/ams/api/model/refund_from_method.py new file mode 100644 index 0000000..688d813 --- /dev/null +++ b/com/alipay/ams/api/model/refund_from_method.py @@ -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'] diff --git a/com/alipay/ams/api/model/subscription_status.py b/com/alipay/ams/api/model/subscription_status.py index 74178c6..2c15aff 100644 --- a/com/alipay/ams/api/model/subscription_status.py +++ b/com/alipay/ams/api/model/subscription_status.py @@ -1,10 +1,24 @@ from enum import Enum, unique - - @unique class SubscriptionStatus(Enum): + """The subscription status. Valid values are: - ACTIVE: indicates that the subscription is active. - CANCELLED: indicates that the subscription is cancelled. - TERMINATED: indicates that the subscription is terminated.""" + ACTIVE = "ACTIVE" + CANCELLED = "CANCELLED" TERMINATED = "TERMINATED" - def to_ams_dict(self): + def to_ams_dict(self) -> str: return self.name + + @staticmethod + def value_of(value): + if not value: + return None + + if SubscriptionStatus.ACTIVE.value == value: + return SubscriptionStatus.ACTIVE + if SubscriptionStatus.CANCELLED.value == value: + return SubscriptionStatus.CANCELLED + if SubscriptionStatus.TERMINATED.value == value: + return SubscriptionStatus.TERMINATED + return None diff --git a/com/alipay/ams/api/model/subscription_transaction.py b/com/alipay/ams/api/model/subscription_transaction.py new file mode 100644 index 0000000..df0b033 --- /dev/null +++ b/com/alipay/ams/api/model/subscription_transaction.py @@ -0,0 +1,131 @@ +import json +from com.alipay.ams.api.model.payment_method import PaymentMethod +from com.alipay.ams.api.model.amount import Amount + + + + +class SubscriptionTransaction: + def __init__(self): + + self.__payment_id = None # type: str + self.__status = None # type: str + self.__phase_no = None # type: int + self.__payment_method = None # type: PaymentMethod + self.__payment_amount = None # type: Amount + self.__payment_time = None # type: str + self.__dispute_id = None # type: str + + + @property + def payment_id(self): + """ + The unique ID that is assigned by Antom to identify a payment. + """ + return self.__payment_id + + @payment_id.setter + def payment_id(self, value): + self.__payment_id = value + @property + def status(self): + """ + Indicates the payment status. Valid values are: - SUCCESS: Indicates that the payment succeeds. - FAIL: Indicates that the payment fails. + """ + return self.__status + + @status.setter + def status(self, value): + self.__status = value + @property + def phase_no(self): + """ + The phase number that the payment applies to. + """ + return self.__phase_no + + @phase_no.setter + def phase_no(self, value): + self.__phase_no = value + @property + def payment_method(self): + """Gets the payment_method of this SubscriptionTransaction. + + """ + return self.__payment_method + + @payment_method.setter + def payment_method(self, value): + self.__payment_method = value + @property + def payment_amount(self): + """Gets the payment_amount of this SubscriptionTransaction. + + """ + return self.__payment_amount + + @payment_amount.setter + def payment_amount(self, value): + self.__payment_amount = value + @property + def payment_time(self): + """ + The successful execution time of this payment by Antom, that is, the date and time when the payment reaches a final state of success. + """ + return self.__payment_time + + @payment_time.setter + def payment_time(self, value): + self.__payment_time = value + @property + def dispute_id(self): + """ + The unique ID that is assigned by Antom to identify a dispute. Indicates whether a dispute exists for the transaction. If no dispute is present, the value is NULL. + """ + return self.__dispute_id + + @dispute_id.setter + def dispute_id(self, value): + self.__dispute_id = value + + + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "payment_id") and self.payment_id is not None: + params['paymentId'] = self.payment_id + if hasattr(self, "status") and self.status is not None: + params['status'] = self.status + if hasattr(self, "phase_no") and self.phase_no is not None: + params['phaseNo'] = self.phase_no + if hasattr(self, "payment_method") and self.payment_method is not None: + params['paymentMethod'] = self.payment_method + if hasattr(self, "payment_amount") and self.payment_amount is not None: + params['paymentAmount'] = self.payment_amount + if hasattr(self, "payment_time") and self.payment_time is not None: + params['paymentTime'] = self.payment_time + if hasattr(self, "dispute_id") and self.dispute_id is not None: + params['disputeId'] = self.dispute_id + return params + + + def parse_rsp_body(self, response_body): + if isinstance(response_body, str): + response_body = json.loads(response_body) + if 'paymentId' in response_body: + self.__payment_id = response_body['paymentId'] + if 'status' in response_body: + self.__status = response_body['status'] + if 'phaseNo' in response_body: + self.__phase_no = response_body['phaseNo'] + if 'paymentMethod' in response_body: + self.__payment_method = PaymentMethod() + self.__payment_method.parse_rsp_body(response_body['paymentMethod']) + if 'paymentAmount' in response_body: + self.__payment_amount = Amount() + self.__payment_amount.parse_rsp_body(response_body['paymentAmount']) + if 'paymentTime' in response_body: + self.__payment_time = response_body['paymentTime'] + if 'disputeId' in response_body: + self.__dispute_id = response_body['disputeId'] diff --git a/com/alipay/ams/api/model/three_ds_result.py b/com/alipay/ams/api/model/three_ds_result.py index edf7a16..4aea7f5 100644 --- a/com/alipay/ams/api/model/three_ds_result.py +++ b/com/alipay/ams/api/model/three_ds_result.py @@ -21,7 +21,7 @@ def __init__(self): @property def three_ds_version(self): """ - The version of 3D Secure protocol + The version of 3D Secure protocol. Valid values are: 1.0.2 2.1.0 2.2.0 """ return self.__three_ds_version @@ -31,7 +31,7 @@ def three_ds_version(self, value): @property def eci(self): """ - Electronic Commerce Indicator (ECI) that is returned by the card scheme + Electronic Commerce Indicator (ECI) that is returned by the card scheme. This parameter is used to indicate the type of cardholder identity authentication. Valid values are: 02 or 05: Indicates fully authenticated transaction. 01 or 06: Indicates attempted authentication transaction. 00 or 07: Indicates non-3D Secure transaction. 04: Indicates 3D Secure data-only transaction. No authentication required (for Mastercard only). Note: This parameter is returned when the value of paymentMethodType is CARD and the issuing bank returns this data. """ return self.__eci @@ -41,7 +41,7 @@ def eci(self, value): @property def cavv(self): """ - The cardholder authentication value + The cardholder authentication value. The value of this parameter can be Cardholder Authentication Verification Value (CAVV) or Authentication Verification Value (AVV). Note: This parameter is returned when the cardholder passes the 3D Secure authentication. """ return self.__cavv @@ -51,7 +51,7 @@ def cavv(self, value): @property def ds_transaction_id(self): """ - dsTransactionId + The unique transaction identifier assigned by the Directory Server (DS) for 3D Secure authentication. Note: This parameter is returned for 3D Secure 2.0. """ return self.__ds_transaction_id @@ -61,7 +61,7 @@ def ds_transaction_id(self, value): @property def xid(self): """ - The unique transaction identifier assigned by the Directory Server (DS) for 3D Secure authentication + The unique transaction identifier assigned by the Directory Server (DS) for 3D Secure authentication. Note: This parameter is returned for 3D Secure 1.0. """ return self.__xid @@ -71,7 +71,7 @@ def xid(self, value): @property def three_d_stransaction_status_reason(self): """ - Added field for 3DS transaction status reason + When a transaction is unsuccessful due to 3D Secure authentication failure, you may receive the transaction status reason code returned by this parameter, indicating the reason for the failure. """ return self.__three_d_stransaction_status_reason @@ -81,7 +81,7 @@ def three_d_stransaction_status_reason(self, value): @property def challenge_cancel(self): """ - Added field for challenge cancel + Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. Possible values are: 01: Cardholder selected cancel. 02: 3DS Requestor cancelled authentication. 03: Transaction abandoned. 04: Transaction timed out at ACS — other timeouts. 05: Transaction timed out at ACS — the first Client Request not received by ACS. 06: Transaction error. 07: Unknown. 08: Transaction timed out at SDK. """ return self.__challenge_cancel @@ -91,7 +91,7 @@ def challenge_cancel(self, value): @property def challenged(self): """ - Added field for challenged status + Indicates whether a 3DS challenge was triggered. Valid values are: true: The transaction has been challenged, and the user is required to complete the 3D Secure authentication process. false: The transaction is a frictionless process, where the user does not experience the 3D Secure authentication process. """ return self.__challenged @@ -101,7 +101,7 @@ def challenged(self, value): @property def exemption_type(self): """ - Added field for exemption type + The exemption type that Antom requested during 3DS authentication, specified through the 3DS requestor challenge indicator. Valid values are: dataOnly: Transactions where shopper data is shared with the card schemes directly using the 3DS2 infrastructure. This flow is currently only available for Visa and Mastercard outside PSD2 SCA regulated markets. 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_type @@ -111,7 +111,7 @@ def exemption_type(self, value): @property def three_ds_offered(self): """ - Added field for 3DS offered + Indicates whether 3D Secure authentication was triggered for the payment. Valid values are: true: indicates 3D Secure authentication was triggered for the payment. Determine the authentication result by combining the other returned 3D Secure parameters. false: indicates 3D Secure authentication was not triggered for the payment. Note: This parameter may be returned even if the payment fails. """ return self.__three_ds_offered diff --git a/com/alipay/ams/api/model/trial_phase.py b/com/alipay/ams/api/model/trial_phase.py new file mode 100644 index 0000000..e45fe4b --- /dev/null +++ b/com/alipay/ams/api/model/trial_phase.py @@ -0,0 +1,54 @@ +import json +from com.alipay.ams.api.model.amount import Amount + + + + +class TrialPhase: + def __init__(self): + + self.__phase_no = None # type: int + self.__trial_amount = None # type: Amount + + + @property + def phase_no(self): + """ + The subscription period that applies trial. + """ + return self.__phase_no + + @phase_no.setter + def phase_no(self, value): + self.__phase_no = value + @property + def trial_amount(self): + """Gets the trial_amount of this TrialPhase. + + """ + return self.__trial_amount + + @trial_amount.setter + def trial_amount(self, value): + self.__trial_amount = value + + + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "phase_no") and self.phase_no is not None: + params['phaseNo'] = self.phase_no + if hasattr(self, "trial_amount") and self.trial_amount is not None: + params['trialAmount'] = self.trial_amount + return params + + + def parse_rsp_body(self, response_body): + if isinstance(response_body, str): + response_body = json.loads(response_body) + if 'phaseNo' in response_body: + self.__phase_no = response_body['phaseNo'] + if 'trialAmount' in response_body: + self.__trial_amount = Amount() + self.__trial_amount.parse_rsp_body(response_body['trialAmount']) diff --git a/com/alipay/ams/api/model/trial_plan.py b/com/alipay/ams/api/model/trial_plan.py new file mode 100644 index 0000000..a0373e1 --- /dev/null +++ b/com/alipay/ams/api/model/trial_plan.py @@ -0,0 +1,72 @@ +import json +from com.alipay.ams.api.model.trial_phase import TrialPhase + + + + +class TrialPlan: + def __init__(self): + + self.__trial_end_time = None # type: str + self.__free_trial_days = None # type: int + self.__phases = None # type: [TrialPhase] + + + @property + def trial_end_time(self): + """ + Indicates the last date of trial phases. + """ + return self.__trial_end_time + + @trial_end_time.setter + def trial_end_time(self, value): + self.__trial_end_time = value + @property + def free_trial_days(self): + """ + Total free trial days. + """ + return self.__free_trial_days + + @free_trial_days.setter + def free_trial_days(self, value): + self.__free_trial_days = value + @property + def phases(self): + """ + Subscription periods that apply trial plan. + """ + return self.__phases + + @phases.setter + def phases(self, value): + self.__phases = value + + + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "trial_end_time") and self.trial_end_time is not None: + params['trialEndTime'] = self.trial_end_time + if hasattr(self, "free_trial_days") and self.free_trial_days is not None: + params['freeTrialDays'] = self.free_trial_days + if hasattr(self, "phases") and self.phases is not None: + params['phases'] = self.phases + return params + + + def parse_rsp_body(self, response_body): + if isinstance(response_body, str): + response_body = json.loads(response_body) + if 'trialEndTime' in response_body: + self.__trial_end_time = response_body['trialEndTime'] + if 'freeTrialDays' in response_body: + self.__free_trial_days = response_body['freeTrialDays'] + if 'phases' in response_body: + self.__phases = [] + for item in response_body['phases']: + obj = TrialPhase() + obj.parse_rsp_body(item) + self.__phases.append(obj) diff --git a/com/alipay/ams/api/model/user_name.py b/com/alipay/ams/api/model/user_name.py index 5be3d6f..11990c9 100644 --- a/com/alipay/ams/api/model/user_name.py +++ b/com/alipay/ams/api/model/user_name.py @@ -15,7 +15,7 @@ def __init__(self): @property def first_name(self): """ - First name. More information: Maximum length: 32 characters + The cardholder's first name. More information: Maximum length: 32 characters """ return self.__first_name @@ -35,7 +35,7 @@ def middle_name(self, value): @property def last_name(self): """ - Last name More information: Maximum length: 32 characters + The cardholder's last name. More information: Maximum length: 32 characters """ return self.__last_name diff --git a/com/alipay/ams/api/request/aba/alipay_create_direct_payment_request.py b/com/alipay/ams/api/request/aba/alipay_create_direct_payment_request.py new file mode 100644 index 0000000..d3facd8 --- /dev/null +++ b/com/alipay/ams/api/request/aba/alipay_create_direct_payment_request.py @@ -0,0 +1,155 @@ +import json +from com.alipay.ams.api.model.order import Order +from com.alipay.ams.api.model.payment_method import PaymentMethod +from com.alipay.ams.api.model.amount import Amount +from com.alipay.ams.api.model.amount import Amount + + + +from com.alipay.ams.api.request.alipay_request import AlipayRequest + +class AlipayCreateDirectPaymentRequest(AlipayRequest): + def __init__(self): + super(AlipayCreateDirectPaymentRequest, self).__init__("/ams/api/v1/aba/funds/createDirectPayment") + + self.__payment_request_id = None # type: str + self.__memo = None # type: str + self.__remark = None # type: str + self.__order = None # type: Order + self.__payment_notify_url = None # type: str + self.__pay_to_method = None # type: PaymentMethod + self.__pay_to_amount = None # type: Amount + self.__pay_from_amount = None # type: Amount + + + @property + def payment_request_id(self): + """Gets the payment_request_id of this AlipayCreateDirectPaymentRequest. + + """ + return self.__payment_request_id + + @payment_request_id.setter + def payment_request_id(self, value): + self.__payment_request_id = value + @property + def memo(self): + """Gets the memo of this AlipayCreateDirectPaymentRequest. + + """ + return self.__memo + + @memo.setter + def memo(self, value): + self.__memo = value + @property + def remark(self): + """Gets the remark of this AlipayCreateDirectPaymentRequest. + + """ + return self.__remark + + @remark.setter + def remark(self, value): + self.__remark = value + @property + def order(self): + """Gets the order of this AlipayCreateDirectPaymentRequest. + + """ + return self.__order + + @order.setter + def order(self, value): + self.__order = value + @property + def payment_notify_url(self): + """Gets the payment_notify_url of this AlipayCreateDirectPaymentRequest. + + """ + return self.__payment_notify_url + + @payment_notify_url.setter + def payment_notify_url(self, value): + self.__payment_notify_url = value + @property + def pay_to_method(self): + """Gets the pay_to_method of this AlipayCreateDirectPaymentRequest. + + """ + return self.__pay_to_method + + @pay_to_method.setter + def pay_to_method(self, value): + self.__pay_to_method = value + @property + def pay_to_amount(self): + """Gets the pay_to_amount of this AlipayCreateDirectPaymentRequest. + + """ + return self.__pay_to_amount + + @pay_to_amount.setter + def pay_to_amount(self, value): + self.__pay_to_amount = value + @property + def pay_from_amount(self): + """Gets the pay_from_amount of this AlipayCreateDirectPaymentRequest. + + """ + return self.__pay_from_amount + + @pay_from_amount.setter + def pay_from_amount(self, value): + self.__pay_from_amount = value + + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) + return json_str + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "payment_request_id") and self.payment_request_id is not None: + params['paymentRequestId'] = self.payment_request_id + if hasattr(self, "memo") and self.memo is not None: + params['memo'] = self.memo + if hasattr(self, "remark") and self.remark is not None: + params['remark'] = self.remark + if hasattr(self, "order") and self.order is not None: + params['order'] = self.order + if hasattr(self, "payment_notify_url") and self.payment_notify_url is not None: + params['paymentNotifyUrl'] = self.payment_notify_url + if hasattr(self, "pay_to_method") and self.pay_to_method is not None: + params['payToMethod'] = self.pay_to_method + if hasattr(self, "pay_to_amount") and self.pay_to_amount is not None: + params['payToAmount'] = self.pay_to_amount + if hasattr(self, "pay_from_amount") and self.pay_from_amount is not None: + params['payFromAmount'] = self.pay_from_amount + return params + + + def parse_rsp_body(self, response_body): + if isinstance(response_body, str): + response_body = json.loads(response_body) + if 'paymentRequestId' in response_body: + self.__payment_request_id = response_body['paymentRequestId'] + if 'memo' in response_body: + self.__memo = response_body['memo'] + if 'remark' in response_body: + self.__remark = response_body['remark'] + if 'order' in response_body: + self.__order = Order() + self.__order.parse_rsp_body(response_body['order']) + if 'paymentNotifyUrl' in response_body: + self.__payment_notify_url = response_body['paymentNotifyUrl'] + if 'payToMethod' in response_body: + self.__pay_to_method = PaymentMethod() + self.__pay_to_method.parse_rsp_body(response_body['payToMethod']) + if 'payToAmount' in response_body: + self.__pay_to_amount = Amount() + self.__pay_to_amount.parse_rsp_body(response_body['payToAmount']) + if 'payFromAmount' in response_body: + self.__pay_from_amount = Amount() + self.__pay_from_amount.parse_rsp_body(response_body['payFromAmount']) diff --git a/com/alipay/ams/api/request/aba/alipay_create_direct_refund_request.py b/com/alipay/ams/api/request/aba/alipay_create_direct_refund_request.py new file mode 100644 index 0000000..b042cf0 --- /dev/null +++ b/com/alipay/ams/api/request/aba/alipay_create_direct_refund_request.py @@ -0,0 +1,166 @@ +import json +from com.alipay.ams.api.model.refund_from_method import RefundFromMethod +from com.alipay.ams.api.model.amount import Amount + + + +from com.alipay.ams.api.request.alipay_request import AlipayRequest + +class AlipayCreateDirectRefundRequest(AlipayRequest): + def __init__(self): + super(AlipayCreateDirectRefundRequest, self).__init__("/ams/api/v1/aba/funds/createDirectRefund") + + self.__payment_id = None # type: str + self.__refund_request_id = None # type: str + self.__reference_refund_id = None # type: str + self.__refund_from_method = None # type: RefundFromMethod + self.__refund_from_amount = None # type: Amount + self.__memo = None # type: str + self.__remark = None # type: str + self.__refund_reason = None # type: str + self.__refund_notify_url = None # type: str + + + @property + def payment_id(self): + """ + The unique ID assigned by Antom for the original payment to be refunded. More information: Maximum length: 64 characters + """ + return self.__payment_id + + @payment_id.setter + def payment_id(self, value): + self.__payment_id = value + @property + def refund_request_id(self): + """ + The unique ID assigned by the merchant to identify a refund request. More information: This field is an API idempotency field. The merchant uses the refundRequestId field for idempotency control. For requests that are initiated with the same value of refundRequestId and reach a final status (S or F), the same result is to be returned for the request. Maximum length: 64 characters + """ + return self.__refund_request_id + + @refund_request_id.setter + def refund_request_id(self, value): + self.__refund_request_id = value + @property + def reference_refund_id(self): + """ + The unique ID to identify a refund, which is assigned by the merchant that directly provides services or goods to the customer. Note: Specify this field if this value is needed for internal use or reconciliation. More information: Maximum length: 64 characters + """ + return self.__reference_refund_id + + @reference_refund_id.setter + def reference_refund_id(self, value): + self.__reference_refund_id = value + @property + def refund_from_method(self): + """Gets the refund_from_method of this AlipayCreateDirectRefundRequest. + + """ + return self.__refund_from_method + + @refund_from_method.setter + def refund_from_method(self, value): + self.__refund_from_method = value + @property + def refund_from_amount(self): + """Gets the refund_from_amount of this AlipayCreateDirectRefundRequest. + + """ + return self.__refund_from_amount + + @refund_from_amount.setter + def refund_from_amount(self, value): + self.__refund_from_amount = value + @property + def memo(self): + """ + The memo for the refund request. Note: Specify this field if you want to provide additional information about the refund. More information: Maximum length: 256 characters + """ + return self.__memo + + @memo.setter + def memo(self, value): + self.__memo = value + @property + def remark(self): + """ + The remark for the refund request. Note: Specify this field if you want to provide additional remarks about the refund. More information: Maximum length: 256 characters + """ + return self.__remark + + @remark.setter + def remark(self, value): + self.__remark = value + @property + def refund_reason(self): + """ + The refund reason. Note: Specify this field if you want to provide the refund reason to the user and payment method. More information: Maximum length: 256 characters + """ + return self.__refund_reason + + @refund_reason.setter + def refund_reason(self, value): + self.__refund_reason = value + @property + def refund_notify_url(self): + """ + The URL that is used to receive the refund result notification. The URL must be either specified in the request or set in Antom Dashboard. Note: Specify this field if you want to receive an asynchronous notification of the refund result. If the refund notification URL is specified in both the request and Antom Dashboard, the value specified in the request takes precedence. More information: Maximum length: 1024 characters + """ + return self.__refund_notify_url + + @refund_notify_url.setter + def refund_notify_url(self, value): + self.__refund_notify_url = value + + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) + return json_str + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "payment_id") and self.payment_id is not None: + params['paymentId'] = self.payment_id + if hasattr(self, "refund_request_id") and self.refund_request_id is not None: + params['refundRequestId'] = self.refund_request_id + if hasattr(self, "reference_refund_id") and self.reference_refund_id is not None: + params['referenceRefundId'] = self.reference_refund_id + if hasattr(self, "refund_from_method") and self.refund_from_method is not None: + params['refundFromMethod'] = self.refund_from_method + if hasattr(self, "refund_from_amount") and self.refund_from_amount is not None: + params['refundFromAmount'] = self.refund_from_amount + if hasattr(self, "memo") and self.memo is not None: + params['memo'] = self.memo + if hasattr(self, "remark") and self.remark is not None: + params['remark'] = self.remark + if hasattr(self, "refund_reason") and self.refund_reason is not None: + params['refundReason'] = self.refund_reason + if hasattr(self, "refund_notify_url") and self.refund_notify_url is not None: + params['refundNotifyUrl'] = self.refund_notify_url + return params + + + def parse_rsp_body(self, response_body): + if isinstance(response_body, str): + response_body = json.loads(response_body) + if 'paymentId' in response_body: + self.__payment_id = response_body['paymentId'] + if 'refundRequestId' in response_body: + self.__refund_request_id = response_body['refundRequestId'] + if 'referenceRefundId' in response_body: + self.__reference_refund_id = response_body['referenceRefundId'] + if 'refundFromMethod' in response_body: + self.__refund_from_method = RefundFromMethod() + self.__refund_from_method.parse_rsp_body(response_body['refundFromMethod']) + if 'refundFromAmount' in response_body: + self.__refund_from_amount = Amount() + self.__refund_from_amount.parse_rsp_body(response_body['refundFromAmount']) + if 'memo' in response_body: + self.__memo = response_body['memo'] + if 'remark' in response_body: + self.__remark = response_body['remark'] + if 'refundReason' in response_body: + self.__refund_reason = response_body['refundReason'] + if 'refundNotifyUrl' in response_body: + self.__refund_notify_url = response_body['refundNotifyUrl'] diff --git a/com/alipay/ams/api/request/aba/alipay_create_quote_request.py b/com/alipay/ams/api/request/aba/alipay_create_quote_request.py index 5fd8132..004e9f9 100644 --- a/com/alipay/ams/api/request/aba/alipay_create_quote_request.py +++ b/com/alipay/ams/api/request/aba/alipay_create_quote_request.py @@ -8,7 +8,7 @@ class AlipayCreateQuoteRequest(AlipayRequest): def __init__(self): - super(AlipayCreateQuoteRequest, self).__init__("/ams/v1/aba/funds/createQuote") + super(AlipayCreateQuoteRequest, self).__init__("/ams/api/v1/aba/funds/createQuote") self.__buy_amount = None # type: Amount self.__sell_amount = None # type: Amount diff --git a/com/alipay/ams/api/request/aba/alipay_inquire_available_quota_request.py b/com/alipay/ams/api/request/aba/alipay_inquire_available_quota_request.py index 1fc417a..83794f9 100644 --- a/com/alipay/ams/api/request/aba/alipay_inquire_available_quota_request.py +++ b/com/alipay/ams/api/request/aba/alipay_inquire_available_quota_request.py @@ -6,7 +6,7 @@ class AlipayInquireAvailableQuotaRequest(AlipayRequest): def __init__(self): - super(AlipayInquireAvailableQuotaRequest, self).__init__("/ams/v1/aba/account/inquireAvailableQuota") + super(AlipayInquireAvailableQuotaRequest, self).__init__("/ams/api/v1/aba/account/inquireAvailableQuota") self.__currency = None # type: str diff --git a/com/alipay/ams/api/request/aba/alipay_inquire_direct_payment_request.py b/com/alipay/ams/api/request/aba/alipay_inquire_direct_payment_request.py new file mode 100644 index 0000000..734f1a8 --- /dev/null +++ b/com/alipay/ams/api/request/aba/alipay_inquire_direct_payment_request.py @@ -0,0 +1,57 @@ +import json + + + +from com.alipay.ams.api.request.alipay_request import AlipayRequest + +class AlipayInquireDirectPaymentRequest(AlipayRequest): + def __init__(self): + super(AlipayInquireDirectPaymentRequest, self).__init__("/ams/api/v1/aba/funds/inquireDirectPayment") + + self.__payment_id = None # type: str + self.__payment_request_id = None # type: str + + + @property + def payment_id(self): + """ + The unique ID that is assigned by Antom to identify a payment. paymentRequestId and paymentId cannot both be null. A one-to-one correspondence between paymentId and paymentRequestId exists. If both paymentRequestId and paymentId are specified, paymentId takes precedence. More information: Maximum length: 64 characters + """ + return self.__payment_id + + @payment_id.setter + def payment_id(self, value): + self.__payment_id = value + @property + def payment_request_id(self): + """ + The unique ID that is assigned by a merchant to identify a payment request. paymentRequestId and paymentId cannot both be null. Special characters are not supported. If both paymentRequestId and paymentId are specified, paymentId takes precedence. More information: Maximum length: 64 characters + """ + return self.__payment_request_id + + @payment_request_id.setter + def payment_request_id(self, value): + self.__payment_request_id = value + + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) + return json_str + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "payment_id") and self.payment_id is not None: + params['paymentId'] = self.payment_id + if hasattr(self, "payment_request_id") and self.payment_request_id is not None: + params['paymentRequestId'] = self.payment_request_id + return params + + + def parse_rsp_body(self, response_body): + if isinstance(response_body, str): + response_body = json.loads(response_body) + if 'paymentId' in response_body: + self.__payment_id = response_body['paymentId'] + if 'paymentRequestId' in response_body: + self.__payment_request_id = response_body['paymentRequestId'] diff --git a/com/alipay/ams/api/request/aba/alipay_inquire_direct_refund_request.py b/com/alipay/ams/api/request/aba/alipay_inquire_direct_refund_request.py new file mode 100644 index 0000000..79f2765 --- /dev/null +++ b/com/alipay/ams/api/request/aba/alipay_inquire_direct_refund_request.py @@ -0,0 +1,57 @@ +import json + + + +from com.alipay.ams.api.request.alipay_request import AlipayRequest + +class AlipayInquireDirectRefundRequest(AlipayRequest): + def __init__(self): + super(AlipayInquireDirectRefundRequest, self).__init__("/ams/api/v1/aba/funds/inquireDirectRefund") + + self.__refund_id = None # type: str + self.__refund_request_id = None # type: str + + + @property + def refund_id(self): + """ + The unique ID assigned by Antom to identify a refund. refundRequestId and refundId cannot both be null. A one-to-one correspondence between refundId and refundRequestId exists. If both refundRequestId and refundId are specified, refundId takes precedence. More information: Maximum length: 64 characters + """ + return self.__refund_id + + @refund_id.setter + def refund_id(self, value): + self.__refund_id = value + @property + def refund_request_id(self): + """ + The unique ID assigned by a merchant to identify a refund request. refundRequestId and refundId cannot both be null. Special characters are not supported. If both refundRequestId and refundId are specified, refundId takes precedence. More information: Maximum length: 64 characters + """ + return self.__refund_request_id + + @refund_request_id.setter + def refund_request_id(self, value): + self.__refund_request_id = value + + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) + return json_str + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "refund_id") and self.refund_id is not None: + params['refundId'] = self.refund_id + if hasattr(self, "refund_request_id") and self.refund_request_id is not None: + params['refundRequestId'] = self.refund_request_id + return params + + + def parse_rsp_body(self, response_body): + if isinstance(response_body, str): + response_body = json.loads(response_body) + if 'refundId' in response_body: + self.__refund_id = response_body['refundId'] + if 'refundRequestId' in response_body: + self.__refund_request_id = response_body['refundRequestId'] diff --git a/com/alipay/ams/api/request/aba/alipay_inquire_exchange_request.py b/com/alipay/ams/api/request/aba/alipay_inquire_exchange_request.py index 2d869ed..e31b463 100644 --- a/com/alipay/ams/api/request/aba/alipay_inquire_exchange_request.py +++ b/com/alipay/ams/api/request/aba/alipay_inquire_exchange_request.py @@ -6,7 +6,7 @@ class AlipayInquireExchangeRequest(AlipayRequest): def __init__(self): - super(AlipayInquireExchangeRequest, self).__init__("/ams/v1/aba/funds/inquireExchange") + super(AlipayInquireExchangeRequest, self).__init__("/ams/api/v1/aba/funds/inquireExchange") self.__exchange_request_id = None # type: str diff --git a/com/alipay/ams/api/request/aba/alipay_inquiry_balance_request.py b/com/alipay/ams/api/request/aba/alipay_inquiry_balance_request.py index 8c3fe0a..d2d04d3 100644 --- a/com/alipay/ams/api/request/aba/alipay_inquiry_balance_request.py +++ b/com/alipay/ams/api/request/aba/alipay_inquiry_balance_request.py @@ -6,7 +6,7 @@ class AlipayInquiryBalanceRequest(AlipayRequest): def __init__(self): - super(AlipayInquiryBalanceRequest, self).__init__("/ams/v1/aba/accounts/inquiryBalance") + super(AlipayInquiryBalanceRequest, self).__init__("/ams/api/v1/aba/accounts/inquiryBalance") self.__currency_list = None # type: [str] self.__accesstoken = None # type: str diff --git a/com/alipay/ams/api/request/aba/alipay_inquiry_rate_request.py b/com/alipay/ams/api/request/aba/alipay_inquiry_rate_request.py index c73f812..c1a78bb 100644 --- a/com/alipay/ams/api/request/aba/alipay_inquiry_rate_request.py +++ b/com/alipay/ams/api/request/aba/alipay_inquiry_rate_request.py @@ -7,7 +7,7 @@ class AlipayInquiryRateRequest(AlipayRequest): def __init__(self): - super(AlipayInquiryRateRequest, self).__init__("/ams/v1/aba/funds/inquireRate") + super(AlipayInquiryRateRequest, self).__init__("/ams/api/v1/aba/funds/inquireRate") self.__rate_condition_list = None # type: [InquiryRateCondition] diff --git a/com/alipay/ams/api/request/pay/alipay_inquiry_refund_request.py b/com/alipay/ams/api/request/pay/alipay_inquiry_refund_request.py index cc47e9e..78b7b2c 100644 --- a/com/alipay/ams/api/request/pay/alipay_inquiry_refund_request.py +++ b/com/alipay/ams/api/request/pay/alipay_inquiry_refund_request.py @@ -35,8 +35,8 @@ def refund_id(self, value): self.__refund_id = value @property def merchant_account_id(self): - """Gets the merchant_account_id of this AlipayInquiryRefundRequest. - + """ + The unique ID to identify a merchant account. """ return self.__merchant_account_id diff --git a/com/alipay/ams/api/request/pay/alipay_pay_request.py b/com/alipay/ams/api/request/pay/alipay_pay_request.py index 155b36e..199871d 100644 --- a/com/alipay/ams/api/request/pay/alipay_pay_request.py +++ b/com/alipay/ams/api/request/pay/alipay_pay_request.py @@ -57,7 +57,7 @@ def __init__(self): @property def metadata(self): """ - 用于商户自定义元数据信息,支持JSON格式 + Use this parameter to submit metadata, including information for special use cases. Specify this parameter when you need to add metadata information. """ return self.__metadata diff --git a/com/alipay/ams/api/request/pay/alipay_payment_session_request.py b/com/alipay/ams/api/request/pay/alipay_payment_session_request.py index dc837b9..2a6bf80 100644 --- a/com/alipay/ams/api/request/pay/alipay_payment_session_request.py +++ b/com/alipay/ams/api/request/pay/alipay_payment_session_request.py @@ -61,7 +61,7 @@ def __init__(self): @property def merchant_account_id(self): """ - The merchant account ID + A unique ID to identify a specific merchant account. Note: Specify this parameter when you use one client ID across multiple locations. """ return self.__merchant_account_id @@ -71,7 +71,7 @@ def merchant_account_id(self, value): @property def metadata(self): """ - Additional metadata for the payment session + This parameter is used for submitting metadata, including information for special use cases. Specify this parameter when you need to add metadata information. """ return self.__metadata @@ -81,7 +81,7 @@ def metadata(self, value): @property def allowed_payment_method_regions(self): """ - Allowed payment method regions + A list of region codes that represent the countries or regions of payment methods. The value of this parameter is a 2-letter ISO country code or GLOBAL. Note: Specify this parameter if you want available payment methods from specific regions to be returned. For example, if you pass in GLOBAL, global cards Visa and Mastercard are returned. """ return self.__allowed_payment_method_regions diff --git a/com/alipay/ams/api/request/pay/alipay_refund_request.py b/com/alipay/ams/api/request/pay/alipay_refund_request.py index f556d5f..f7a679d 100644 --- a/com/alipay/ams/api/request/pay/alipay_refund_request.py +++ b/com/alipay/ams/api/request/pay/alipay_refund_request.py @@ -33,7 +33,7 @@ def __init__(self): @property def metadata(self): """ - Additional metadata about the refund request + This parameter is used for submitting metadata, including information for special use cases. """ return self.__metadata diff --git a/com/alipay/ams/api/request/pay/alipay_vaulting_payment_method_request.py b/com/alipay/ams/api/request/pay/alipay_vaulting_payment_method_request.py index ebbafcb..e666420 100644 --- a/com/alipay/ams/api/request/pay/alipay_vaulting_payment_method_request.py +++ b/com/alipay/ams/api/request/pay/alipay_vaulting_payment_method_request.py @@ -26,7 +26,7 @@ def __init__(self): @property def merchant_account_id(self): """ - 一点集成场景使用 + A unique ID to identify a specific merchant account. Note: Specify this parameter when you use one client ID across multiple locations. """ return self.__merchant_account_id @@ -36,7 +36,7 @@ def merchant_account_id(self, value): @property def metadata(self): """ - 商户使用,Json Format,用于提交元数据信息 + This parameter is used for submitting metadata, including information for special use cases. Specify this parameter when you need to add metadata information. """ return self.__metadata diff --git a/com/alipay/ams/api/request/pay/alipay_vaulting_query_request.py b/com/alipay/ams/api/request/pay/alipay_vaulting_query_request.py index 7866a33..f4670ce 100644 --- a/com/alipay/ams/api/request/pay/alipay_vaulting_query_request.py +++ b/com/alipay/ams/api/request/pay/alipay_vaulting_query_request.py @@ -25,7 +25,7 @@ def vaulting_request_id(self, value): @property def merchant_account_id(self): """ - Merchant account ID for 2C2P integration scenario + A unique ID to identify a specific merchant account. Note: Specify this parameter when you use one client ID across multiple locations. """ return self.__merchant_account_id diff --git a/com/alipay/ams/api/request/pay/alipay_vaulting_session_request.py b/com/alipay/ams/api/request/pay/alipay_vaulting_session_request.py index b3ea7c1..352d714 100644 --- a/com/alipay/ams/api/request/pay/alipay_vaulting_session_request.py +++ b/com/alipay/ams/api/request/pay/alipay_vaulting_session_request.py @@ -19,7 +19,7 @@ def __init__(self): @property def payment_method_type(self): """ - The payment method type is included in payment method options. See Payment methods to check the valid values for card payments. More information: Maximum length: 64 characters + The type of payment method to be vaulted. The value of this parameter is fixed to CARD. """ return self.__payment_method_type @@ -29,7 +29,7 @@ def payment_method_type(self, value): @property def vaulting_request_id(self): """ - The unique ID that is assigned by a merchant to identify a card vaulting request. More information: Maximum length: 64 characters + The unique ID that is assigned by a merchant to identify a card vaulting request. More information: This field is an API idempotency field. For vaulting requests that are initiated with the same value of vaultingRequestId and reach a final status of S or F, the same result is to be returned for the request. """ return self.__vaulting_request_id diff --git a/com/alipay/ams/api/request/subscription/alipay_inquire_subscription_list_request.py b/com/alipay/ams/api/request/subscription/alipay_inquire_subscription_list_request.py new file mode 100644 index 0000000..316baa2 --- /dev/null +++ b/com/alipay/ams/api/request/subscription/alipay_inquire_subscription_list_request.py @@ -0,0 +1,170 @@ +import json +from com.alipay.ams.api.model.datetime import datetime +from com.alipay.ams.api.model.datetime import datetime +from com.alipay.ams.api.model.subscription_status import SubscriptionStatus +from com.alipay.ams.api.model.period_type import PeriodType + + + +from com.alipay.ams.api.request.alipay_request import AlipayRequest + +class AlipayInquireSubscriptionListRequest(AlipayRequest): + def __init__(self): + super(AlipayInquireSubscriptionListRequest, self).__init__("/ams/api/v1/subscriptions/inquireSubscriptionList") + + self.__merchant_account_id = None # type: str + self.__start_time_from = None # type: datetime + self.__start_time_to = None # type: datetime + self.__statuses = None # type: [SubscriptionStatus] + self.__payment_method_types = None # type: [str] + self.__currencies = None # type: [str] + self.__period_types = None # type: [PeriodType] + self.__current_page = None # type: int + self.__page_size = None # type: int + + + @property + def merchant_account_id(self): + """ + A unique ID to identify a specific merchant account. + """ + return self.__merchant_account_id + + @merchant_account_id.setter + def merchant_account_id(self, value): + self.__merchant_account_id = value + @property + def start_time_from(self): + """ + Filter Subscriptions with a start date after the specified date. The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". Default if not provided: 7 days ago. + """ + return self.__start_time_from + + @start_time_from.setter + def start_time_from(self, value): + self.__start_time_from = value + @property + def start_time_to(self): + """ + Filter Subscriptions with a start date before the specified date. The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". Default if not provided: current time. + """ + return self.__start_time_to + + @start_time_to.setter + def start_time_to(self, value): + self.__start_time_to = value + @property + def statuses(self): + """ + Filter Subscriptions whose status matches any value in the list. Default if not provided: Get all subscriptions whose status is in [ACTIVE, CANCELLED, TERMINATED]. + """ + return self.__statuses + + @statuses.setter + def statuses(self, value): + self.__statuses = value + @property + def payment_method_types(self): + """ + Filter Subscriptions whose payment method matches any value in the list. See Payment methods to check the valid values. Default if not provided: Subscriptions of all payment method are returned. + """ + return self.__payment_method_types + + @payment_method_types.setter + def payment_method_types(self, value): + self.__payment_method_types = value + @property + def currencies(self): + """ + Filter Subscriptions whose currency matches any value in the list. The transaction currency, which is a 3-letter currency code that follows the ISO 4217 standard. Default if not provided: Subscriptions of all currency are returned. + """ + return self.__currencies + + @currencies.setter + def currencies(self, value): + self.__currencies = value + @property + def period_types(self): + """ + Filter Subscriptions whose periodType matches any value in the list. Default if not provided: Subscriptions of all periodType are returned. + """ + return self.__period_types + + @period_types.setter + def period_types(self, value): + self.__period_types = value + @property + def current_page(self): + """ + Current page number. Default if not provided: Get all subscriptions in page 1. + """ + return self.__current_page + + @current_page.setter + def current_page(self, value): + self.__current_page = value + @property + def page_size(self): + """ + Page size. Default if not provided: Page size of 10. + """ + return self.__page_size + + @page_size.setter + def page_size(self, value): + self.__page_size = value + + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) + return json_str + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "merchant_account_id") and self.merchant_account_id is not None: + params['merchantAccountId'] = self.merchant_account_id + if hasattr(self, "start_time_from") and self.start_time_from is not None: + params['startTimeFrom'] = self.start_time_from + if hasattr(self, "start_time_to") and self.start_time_to is not None: + params['startTimeTo'] = self.start_time_to + if hasattr(self, "statuses") and self.statuses is not None: + params['statuses'] = self.statuses + if hasattr(self, "payment_method_types") and self.payment_method_types is not None: + params['paymentMethodTypes'] = self.payment_method_types + if hasattr(self, "currencies") and self.currencies is not None: + params['currencies'] = self.currencies + if hasattr(self, "period_types") and self.period_types is not None: + params['periodTypes'] = self.period_types + 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 + return params + + + def parse_rsp_body(self, response_body): + if isinstance(response_body, str): + response_body = json.loads(response_body) + if 'merchantAccountId' in response_body: + self.__merchant_account_id = response_body['merchantAccountId'] + if 'startTimeFrom' in response_body: + self.__start_time_from = response_body['startTimeFrom'] + if 'startTimeTo' in response_body: + self.__start_time_to = response_body['startTimeTo'] + if 'statuses' in response_body: + self.__statuses = [] + for item in response_body['statuses']: + self.__statuses.append(item) + if 'paymentMethodTypes' in response_body: + self.__payment_method_types = response_body['paymentMethodTypes'] + if 'currencies' in response_body: + self.__currencies = response_body['currencies'] + if 'periodTypes' in response_body: + self.__period_types = [] + for item in response_body['periodTypes']: + self.__period_types.append(item) + if 'currentPage' in response_body: + self.__current_page = response_body['currentPage'] + if 'pageSize' in response_body: + self.__page_size = response_body['pageSize'] diff --git a/com/alipay/ams/api/request/subscription/alipay_inquire_subscription_payment_request.py b/com/alipay/ams/api/request/subscription/alipay_inquire_subscription_payment_request.py new file mode 100644 index 0000000..4e749f4 --- /dev/null +++ b/com/alipay/ams/api/request/subscription/alipay_inquire_subscription_payment_request.py @@ -0,0 +1,105 @@ +import json +from com.alipay.ams.api.model.payment_status import PaymentStatus + + + +from com.alipay.ams.api.request.alipay_request import AlipayRequest + +class AlipayInquireSubscriptionPaymentRequest(AlipayRequest): + def __init__(self): + super(AlipayInquireSubscriptionPaymentRequest, self).__init__("/ams/api/v1/subscriptions/inquireSubscriptionPayment") + + self.__merchant_account_id = None # type: str + self.__subscription_id = None # type: str + self.__payment_statuses = None # type: [PaymentStatus] + self.__current_page = None # type: int + self.__page_size = None # type: int + + + @property + def merchant_account_id(self): + """ + A unique ID to identify a specific merchant account. + """ + return self.__merchant_account_id + + @merchant_account_id.setter + def merchant_account_id(self, value): + self.__merchant_account_id = value + @property + def subscription_id(self): + """ + The unique ID assigned by Antom to identify a subscription. + """ + return self.__subscription_id + + @subscription_id.setter + def subscription_id(self, value): + self.__subscription_id = value + @property + def payment_statuses(self): + """ + Filter Transactions whose status matches any value in the list. Default if not provided: Transactions of all status are returned. + """ + return self.__payment_statuses + + @payment_statuses.setter + def payment_statuses(self, value): + self.__payment_statuses = value + @property + def current_page(self): + """ + Current page number. Default if not provided: Get all transactions in page 1. + """ + return self.__current_page + + @current_page.setter + def current_page(self, value): + self.__current_page = value + @property + def page_size(self): + """ + Page size. Default if not provided: Page size of 10. + """ + return self.__page_size + + @page_size.setter + def page_size(self, value): + self.__page_size = value + + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) + return json_str + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "merchant_account_id") and self.merchant_account_id is not None: + params['merchantAccountId'] = self.merchant_account_id + if hasattr(self, "subscription_id") and self.subscription_id is not None: + params['subscriptionId'] = self.subscription_id + if hasattr(self, "payment_statuses") and self.payment_statuses is not None: + params['paymentStatuses'] = self.payment_statuses + 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 + return params + + + def parse_rsp_body(self, response_body): + if isinstance(response_body, str): + response_body = json.loads(response_body) + if 'merchantAccountId' in response_body: + self.__merchant_account_id = response_body['merchantAccountId'] + if 'subscriptionId' in response_body: + self.__subscription_id = response_body['subscriptionId'] + if 'paymentStatuses' in response_body: + self.__payment_statuses = [] + for item in response_body['paymentStatuses']: + self.__payment_statuses.append(item) + if 'currentPage' in response_body: + self.__current_page = response_body['currentPage'] + if 'pageSize' in response_body: + self.__page_size = response_body['pageSize'] diff --git a/com/alipay/ams/api/request/subscription/alipay_inquire_subscription_request.py b/com/alipay/ams/api/request/subscription/alipay_inquire_subscription_request.py new file mode 100644 index 0000000..ee340bb --- /dev/null +++ b/com/alipay/ams/api/request/subscription/alipay_inquire_subscription_request.py @@ -0,0 +1,57 @@ +import json + + + +from com.alipay.ams.api.request.alipay_request import AlipayRequest + +class AlipayInquireSubscriptionRequest(AlipayRequest): + def __init__(self): + super(AlipayInquireSubscriptionRequest, self).__init__("/ams/api/v1/subscriptions/inquireSubscription") + + self.__merchant_account_id = None # type: str + self.__subscription_id = None # type: str + + + @property + def merchant_account_id(self): + """ + A unique ID to identify a specific merchant account. + """ + return self.__merchant_account_id + + @merchant_account_id.setter + def merchant_account_id(self, value): + self.__merchant_account_id = value + @property + def subscription_id(self): + """ + The unique ID assigned by Antom to identify a subscription. + """ + return self.__subscription_id + + @subscription_id.setter + def subscription_id(self, value): + self.__subscription_id = value + + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) + return json_str + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "merchant_account_id") and self.merchant_account_id is not None: + params['merchantAccountId'] = self.merchant_account_id + if hasattr(self, "subscription_id") and self.subscription_id is not None: + params['subscriptionId'] = self.subscription_id + return params + + + def parse_rsp_body(self, response_body): + if isinstance(response_body, str): + response_body = json.loads(response_body) + if 'merchantAccountId' in response_body: + self.__merchant_account_id = response_body['merchantAccountId'] + if 'subscriptionId' in response_body: + self.__subscription_id = response_body['subscriptionId'] diff --git a/com/alipay/ams/api/request/subscription/alipay_subscription_update_request.py b/com/alipay/ams/api/request/subscription/alipay_subscription_update_request.py index b272b33..10890e8 100644 --- a/com/alipay/ams/api/request/subscription/alipay_subscription_update_request.py +++ b/com/alipay/ams/api/request/subscription/alipay_subscription_update_request.py @@ -2,6 +2,7 @@ from com.alipay.ams.api.model.period_rule import PeriodRule from com.alipay.ams.api.model.amount import Amount from com.alipay.ams.api.model.order_info import OrderInfo +from com.alipay.ams.api.model.proration_settings import ProrationSettings @@ -18,6 +19,8 @@ def __init__(self): self.__payment_amount = None # type: Amount self.__subscription_end_time = None # type: str self.__order_info = None # type: OrderInfo + self.__proration_settings = None # type: ProrationSettings + self.__next_subscription_date = None # type: str @property @@ -90,6 +93,26 @@ def order_info(self): @order_info.setter def order_info(self, value): self.__order_info = value + @property + def proration_settings(self): + """Gets the proration_settings of this AlipaySubscriptionUpdateRequest. + + """ + return self.__proration_settings + + @proration_settings.setter + def proration_settings(self, value): + self.__proration_settings = value + @property + def next_subscription_date(self): + """ + 商户指定的下次扣款时间。遵循ISO 8601标准。 允许更改的时间要在一个周期内。 注意:由于订阅产品会在履约时间24小时前开始尝试扣款,商户指定的下次扣款时间至少要在当前时间的24小时之后。如商户指定的下次扣款时间小于当前时间的24小时,预期订阅升级失败并返回PROCCESS_FAIL错误码。 + """ + return self.__next_subscription_date + + @next_subscription_date.setter + def next_subscription_date(self, value): + self.__next_subscription_date = value def to_ams_json(self): @@ -113,6 +136,10 @@ def to_ams_dict(self): params['subscriptionEndTime'] = self.subscription_end_time if hasattr(self, "order_info") and self.order_info is not None: params['orderInfo'] = self.order_info + if hasattr(self, "proration_settings") and self.proration_settings is not None: + params['prorationSettings'] = self.proration_settings + if hasattr(self, "next_subscription_date") and self.next_subscription_date is not None: + params['nextSubscriptionDate'] = self.next_subscription_date return params @@ -136,3 +163,8 @@ def parse_rsp_body(self, response_body): if 'orderInfo' in response_body: self.__order_info = OrderInfo() self.__order_info.parse_rsp_body(response_body['orderInfo']) + if 'prorationSettings' in response_body: + self.__proration_settings = ProrationSettings() + self.__proration_settings.parse_rsp_body(response_body['prorationSettings']) + if 'nextSubscriptionDate' in response_body: + self.__next_subscription_date = response_body['nextSubscriptionDate'] diff --git a/com/alipay/ams/api/request/subscription/alipay_subscriptions_inquiry_request.py b/com/alipay/ams/api/request/subscription/alipay_subscriptions_inquiry_request.py index 2150b47..ebb80ce 100644 --- a/com/alipay/ams/api/request/subscription/alipay_subscriptions_inquiry_request.py +++ b/com/alipay/ams/api/request/subscription/alipay_subscriptions_inquiry_request.py @@ -6,7 +6,7 @@ class AlipaySubscriptionsInquiryRequest(AlipayRequest): def __init__(self): - super(AlipaySubscriptionsInquiryRequest, self).__init__("/ams/v1/subscriptions/inquiry") + super(AlipaySubscriptionsInquiryRequest, self).__init__("/ams/api/v1/subscriptions/inquiry") self.__subscription_id = None # type: str self.__subscription_request_id = None # type: str diff --git a/com/alipay/ams/api/response/aba/alipay_create_direct_payment_response.py b/com/alipay/ams/api/response/aba/alipay_create_direct_payment_response.py new file mode 100644 index 0000000..81c6ae8 --- /dev/null +++ b/com/alipay/ams/api/response/aba/alipay_create_direct_payment_response.py @@ -0,0 +1,137 @@ +import json +from com.alipay.ams.api.model.payment_method import PaymentMethod +from com.alipay.ams.api.model.amount import Amount +from com.alipay.ams.api.model.amount import Amount +from com.alipay.ams.api.model.result import Result + + + +from com.alipay.ams.api.response.alipay_response import AlipayResponse + +class AlipayCreateDirectPaymentResponse(AlipayResponse): + def __init__(self, rsp_body): + super(AlipayResponse, self).__init__() + + self.__payment_id = None # type: str + self.__payment_request_id = None # type: str + self.__pay_to_method = None # type: PaymentMethod + self.__pay_from_amount = None # type: Amount + self.__pay_to_amount = None # type: Amount + self.__payment_time = None # type: str + self.__result = None # type: Result + self.parse_rsp_body(rsp_body) + + + @property + def payment_id(self): + """Gets the payment_id of this AlipayCreateDirectPaymentResponse. + + """ + return self.__payment_id + + @payment_id.setter + def payment_id(self, value): + self.__payment_id = value + @property + def payment_request_id(self): + """Gets the payment_request_id of this AlipayCreateDirectPaymentResponse. + + """ + return self.__payment_request_id + + @payment_request_id.setter + def payment_request_id(self, value): + self.__payment_request_id = value + @property + def pay_to_method(self): + """Gets the pay_to_method of this AlipayCreateDirectPaymentResponse. + + """ + return self.__pay_to_method + + @pay_to_method.setter + def pay_to_method(self, value): + self.__pay_to_method = value + @property + def pay_from_amount(self): + """Gets the pay_from_amount of this AlipayCreateDirectPaymentResponse. + + """ + return self.__pay_from_amount + + @pay_from_amount.setter + def pay_from_amount(self, value): + self.__pay_from_amount = value + @property + def pay_to_amount(self): + """Gets the pay_to_amount of this AlipayCreateDirectPaymentResponse. + + """ + return self.__pay_to_amount + + @pay_to_amount.setter + def pay_to_amount(self, value): + self.__pay_to_amount = value + @property + def payment_time(self): + """Gets the payment_time of this AlipayCreateDirectPaymentResponse. + + """ + return self.__payment_time + + @payment_time.setter + def payment_time(self, value): + self.__payment_time = value + @property + def result(self): + """Gets the result of this AlipayCreateDirectPaymentResponse. + + """ + return self.__result + + @result.setter + def result(self, value): + self.__result = value + + + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "payment_id") and self.payment_id is not None: + params['paymentId'] = self.payment_id + if hasattr(self, "payment_request_id") and self.payment_request_id is not None: + params['paymentRequestId'] = self.payment_request_id + if hasattr(self, "pay_to_method") and self.pay_to_method is not None: + params['payToMethod'] = self.pay_to_method + if hasattr(self, "pay_from_amount") and self.pay_from_amount is not None: + params['payFromAmount'] = self.pay_from_amount + if hasattr(self, "pay_to_amount") and self.pay_to_amount is not None: + params['payToAmount'] = self.pay_to_amount + if hasattr(self, "payment_time") and self.payment_time is not None: + params['paymentTime'] = self.payment_time + if hasattr(self, "result") and self.result is not None: + params['result'] = self.result + return params + + + def parse_rsp_body(self, response_body): + response_body = super(AlipayCreateDirectPaymentResponse, self).parse_rsp_body(response_body) + if 'paymentId' in response_body: + self.__payment_id = response_body['paymentId'] + if 'paymentRequestId' in response_body: + self.__payment_request_id = response_body['paymentRequestId'] + if 'payToMethod' in response_body: + self.__pay_to_method = PaymentMethod() + self.__pay_to_method.parse_rsp_body(response_body['payToMethod']) + if 'payFromAmount' in response_body: + self.__pay_from_amount = Amount() + self.__pay_from_amount.parse_rsp_body(response_body['payFromAmount']) + if 'payToAmount' in response_body: + self.__pay_to_amount = Amount() + self.__pay_to_amount.parse_rsp_body(response_body['payToAmount']) + if 'paymentTime' in response_body: + self.__payment_time = response_body['paymentTime'] + if 'result' in response_body: + self.__result = Result() + self.__result.parse_rsp_body(response_body['result']) diff --git a/com/alipay/ams/api/response/aba/alipay_create_direct_refund_response.py b/com/alipay/ams/api/response/aba/alipay_create_direct_refund_response.py new file mode 100644 index 0000000..d9febd0 --- /dev/null +++ b/com/alipay/ams/api/response/aba/alipay_create_direct_refund_response.py @@ -0,0 +1,152 @@ +import json +from com.alipay.ams.api.model.refund_from_method import RefundFromMethod +from com.alipay.ams.api.model.amount import Amount +from com.alipay.ams.api.model.amount import Amount +from com.alipay.ams.api.model.result import Result + + + +from com.alipay.ams.api.response.alipay_response import AlipayResponse + +class AlipayCreateDirectRefundResponse(AlipayResponse): + def __init__(self, rsp_body): + super(AlipayResponse, self).__init__() + + self.__payment_id = None # type: str + self.__refund_id = None # type: str + self.__refund_request_id = None # type: str + self.__refund_time = None # type: str + self.__refund_from_method = None # type: RefundFromMethod + self.__refund_from_amount = None # type: Amount + self.__refund_to_amount = None # type: Amount + self.__result = None # type: Result + self.parse_rsp_body(rsp_body) + + + @property + def payment_id(self): + """ + The unique ID assigned by Antom for the original payment to be refunded. Note: This field is returned when the refund succeeds (the value of result.resultStatus is S). More information: Maximum length: 64 characters + """ + return self.__payment_id + + @payment_id.setter + def payment_id(self, value): + self.__payment_id = value + @property + def refund_id(self): + """ + The unique ID that is assigned by Antom to identify a refund. A one-to-one correspondence between refundId and refundRequestId exists. Note: This field is returned when the refund succeeds (the value of result.resultStatus is S). More information: Maximum length: 64 characters + """ + return self.__refund_id + + @refund_id.setter + def refund_id(self, value): + self.__refund_id = value + @property + def refund_request_id(self): + """ + The unique ID that is assigned by the merchant to identify a refund request. Note: This field is returned when the refund succeeds (the value of result.resultStatus is S). More information: Maximum length: 64 characters + """ + return self.__refund_request_id + + @refund_request_id.setter + def refund_request_id(self, value): + self.__refund_request_id = value + @property + def refund_time(self): + """ + The date and time when the refund reaches the state of success, failure, or unknown. Note: This field is returned when the refund succeeds (the value of result.resultStatus is S). More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + """ + return self.__refund_time + + @refund_time.setter + def refund_time(self, value): + self.__refund_time = value + @property + def refund_from_method(self): + """Gets the refund_from_method of this AlipayCreateDirectRefundResponse. + + """ + return self.__refund_from_method + + @refund_from_method.setter + def refund_from_method(self, value): + self.__refund_from_method = value + @property + def refund_from_amount(self): + """Gets the refund_from_amount of this AlipayCreateDirectRefundResponse. + + """ + return self.__refund_from_amount + + @refund_from_amount.setter + def refund_from_amount(self, value): + self.__refund_from_amount = value + @property + def refund_to_amount(self): + """Gets the refund_to_amount of this AlipayCreateDirectRefundResponse. + + """ + return self.__refund_to_amount + + @refund_to_amount.setter + def refund_to_amount(self, value): + self.__refund_to_amount = value + @property + def result(self): + """Gets the result of this AlipayCreateDirectRefundResponse. + + """ + return self.__result + + @result.setter + def result(self, value): + self.__result = value + + + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "payment_id") and self.payment_id is not None: + params['paymentId'] = self.payment_id + if hasattr(self, "refund_id") and self.refund_id is not None: + params['refundId'] = self.refund_id + if hasattr(self, "refund_request_id") and self.refund_request_id is not None: + params['refundRequestId'] = self.refund_request_id + if hasattr(self, "refund_time") and self.refund_time is not None: + params['refundTime'] = self.refund_time + if hasattr(self, "refund_from_method") and self.refund_from_method is not None: + params['refundFromMethod'] = self.refund_from_method + if hasattr(self, "refund_from_amount") and self.refund_from_amount is not None: + params['refundFromAmount'] = self.refund_from_amount + if hasattr(self, "refund_to_amount") and self.refund_to_amount is not None: + params['refundToAmount'] = self.refund_to_amount + if hasattr(self, "result") and self.result is not None: + params['result'] = self.result + return params + + + def parse_rsp_body(self, response_body): + response_body = super(AlipayCreateDirectRefundResponse, self).parse_rsp_body(response_body) + if 'paymentId' in response_body: + self.__payment_id = response_body['paymentId'] + if 'refundId' in response_body: + self.__refund_id = response_body['refundId'] + if 'refundRequestId' in response_body: + self.__refund_request_id = response_body['refundRequestId'] + if 'refundTime' in response_body: + self.__refund_time = response_body['refundTime'] + if 'refundFromMethod' in response_body: + self.__refund_from_method = RefundFromMethod() + self.__refund_from_method.parse_rsp_body(response_body['refundFromMethod']) + if 'refundFromAmount' in response_body: + self.__refund_from_amount = Amount() + self.__refund_from_amount.parse_rsp_body(response_body['refundFromAmount']) + if 'refundToAmount' in response_body: + self.__refund_to_amount = Amount() + self.__refund_to_amount.parse_rsp_body(response_body['refundToAmount']) + if 'result' in response_body: + self.__result = Result() + self.__result.parse_rsp_body(response_body['result']) diff --git a/com/alipay/ams/api/response/aba/alipay_inquire_direct_payment_response.py b/com/alipay/ams/api/response/aba/alipay_inquire_direct_payment_response.py new file mode 100644 index 0000000..691af6e --- /dev/null +++ b/com/alipay/ams/api/response/aba/alipay_inquire_direct_payment_response.py @@ -0,0 +1,184 @@ +import json +from com.alipay.ams.api.model.transaction_status_type import TransactionStatusType +from com.alipay.ams.api.model.payment_method import PaymentMethod +from com.alipay.ams.api.model.amount import Amount +from com.alipay.ams.api.model.amount import Amount +from com.alipay.ams.api.model.result import Result + + + +from com.alipay.ams.api.response.alipay_response import AlipayResponse + +class AlipayInquireDirectPaymentResponse(AlipayResponse): + def __init__(self, rsp_body): + super(AlipayResponse, self).__init__() + + self.__payment_status = None # type: TransactionStatusType + self.__payment_result_message = None # type: str + self.__payment_result_code = None # type: str + self.__payment_id = None # type: str + self.__payment_request_id = None # type: str + self.__pay_to_method = None # type: PaymentMethod + self.__payment_amount = None # type: Amount + self.__pay_to_amount = None # type: Amount + self.__payment_time = None # type: str + self.__result = None # type: Result + self.parse_rsp_body(rsp_body) + + + @property + def payment_status(self): + """Gets the payment_status of this AlipayInquireDirectPaymentResponse. + + """ + return self.__payment_status + + @payment_status.setter + def payment_status(self, value): + self.__payment_status = value + @property + def payment_result_message(self): + """ + The result message that explains the payment result code. Note: This field is returned when the API is called successfully (the value of result.resultStatus is S). More information: Maximum length: 256 characters + """ + return self.__payment_result_message + + @payment_result_message.setter + def payment_result_message(self, value): + self.__payment_result_message = value + @property + def payment_result_code(self): + """ + The result code for different payment statuses. Possible payment result codes are listed in the Payment result codes table. Note: This field is returned when the API is called successfully (the value of result.resultStatus is S). More information: Maximum length: 64 characters + """ + return self.__payment_result_code + + @payment_result_code.setter + def payment_result_code(self, value): + self.__payment_result_code = value + @property + def payment_id(self): + """ + The unique ID that is assigned by Antom to identify a payment. Note: This field is returned when the API is called successfully (the value of result.resultStatus is S). More information: Maximum length: 64 characters + """ + return self.__payment_id + + @payment_id.setter + def payment_id(self, value): + self.__payment_id = value + @property + def payment_request_id(self): + """ + The unique ID that is assigned by a merchant to identify a payment request. Note: This field is returned when the API is called successfully (the value of result.resultStatus is S). More information: Maximum length: 64 characters + """ + return self.__payment_request_id + + @payment_request_id.setter + def payment_request_id(self, value): + self.__payment_request_id = value + @property + def pay_to_method(self): + """Gets the pay_to_method of this AlipayInquireDirectPaymentResponse. + + """ + return self.__pay_to_method + + @pay_to_method.setter + def pay_to_method(self, value): + self.__pay_to_method = value + @property + def payment_amount(self): + """Gets the payment_amount of this AlipayInquireDirectPaymentResponse. + + """ + return self.__payment_amount + + @payment_amount.setter + def payment_amount(self, value): + self.__payment_amount = value + @property + def pay_to_amount(self): + """Gets the pay_to_amount of this AlipayInquireDirectPaymentResponse. + + """ + return self.__pay_to_amount + + @pay_to_amount.setter + def pay_to_amount(self, value): + self.__pay_to_amount = value + @property + def payment_time(self): + """ + The date and time when the payment reaches a final state of success. Note: This field is returned only when the payment reaches a final state of success (the value of paymentStatus is SUCCESS). More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + """ + return self.__payment_time + + @payment_time.setter + def payment_time(self, value): + self.__payment_time = value + @property + def result(self): + """Gets the result of this AlipayInquireDirectPaymentResponse. + + """ + return self.__result + + @result.setter + def result(self, value): + self.__result = value + + + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "payment_status") and self.payment_status is not None: + params['paymentStatus'] = self.payment_status + if hasattr(self, "payment_result_message") and self.payment_result_message is not None: + params['paymentResultMessage'] = self.payment_result_message + if hasattr(self, "payment_result_code") and self.payment_result_code is not None: + params['paymentResultCode'] = self.payment_result_code + if hasattr(self, "payment_id") and self.payment_id is not None: + params['paymentId'] = self.payment_id + if hasattr(self, "payment_request_id") and self.payment_request_id is not None: + params['paymentRequestId'] = self.payment_request_id + if hasattr(self, "pay_to_method") and self.pay_to_method is not None: + params['payToMethod'] = self.pay_to_method + if hasattr(self, "payment_amount") and self.payment_amount is not None: + params['paymentAmount'] = self.payment_amount + if hasattr(self, "pay_to_amount") and self.pay_to_amount is not None: + params['payToAmount'] = self.pay_to_amount + if hasattr(self, "payment_time") and self.payment_time is not None: + params['paymentTime'] = self.payment_time + if hasattr(self, "result") and self.result is not None: + params['result'] = self.result + return params + + + def parse_rsp_body(self, response_body): + response_body = super(AlipayInquireDirectPaymentResponse, self).parse_rsp_body(response_body) + if 'paymentStatus' in response_body: + payment_status_temp = TransactionStatusType.value_of(response_body['paymentStatus']) + self.__payment_status = payment_status_temp + if 'paymentResultMessage' in response_body: + self.__payment_result_message = response_body['paymentResultMessage'] + if 'paymentResultCode' in response_body: + self.__payment_result_code = response_body['paymentResultCode'] + if 'paymentId' in response_body: + self.__payment_id = response_body['paymentId'] + if 'paymentRequestId' in response_body: + self.__payment_request_id = response_body['paymentRequestId'] + if 'payToMethod' in response_body: + self.__pay_to_method = PaymentMethod() + self.__pay_to_method.parse_rsp_body(response_body['payToMethod']) + if 'paymentAmount' in response_body: + self.__payment_amount = Amount() + self.__payment_amount.parse_rsp_body(response_body['paymentAmount']) + if 'payToAmount' in response_body: + self.__pay_to_amount = Amount() + self.__pay_to_amount.parse_rsp_body(response_body['payToAmount']) + if 'paymentTime' in response_body: + self.__payment_time = response_body['paymentTime'] + if 'result' in response_body: + self.__result = Result() + self.__result.parse_rsp_body(response_body['result']) diff --git a/com/alipay/ams/api/response/aba/alipay_inquire_direct_refund_response.py b/com/alipay/ams/api/response/aba/alipay_inquire_direct_refund_response.py new file mode 100644 index 0000000..4a47b02 --- /dev/null +++ b/com/alipay/ams/api/response/aba/alipay_inquire_direct_refund_response.py @@ -0,0 +1,199 @@ +import json +from com.alipay.ams.api.model.transaction_status_type import TransactionStatusType +from com.alipay.ams.api.model.refund_from_method import RefundFromMethod +from com.alipay.ams.api.model.amount import Amount +from com.alipay.ams.api.model.amount import Amount +from com.alipay.ams.api.model.result import Result + + + +from com.alipay.ams.api.response.alipay_response import AlipayResponse + +class AlipayInquireDirectRefundResponse(AlipayResponse): + def __init__(self, rsp_body): + super(AlipayResponse, self).__init__() + + self.__refund_status = None # type: TransactionStatusType + self.__refund_result_message = None # type: str + self.__refund_result_code = None # type: str + self.__refund_id = None # type: str + self.__payment_id = None # type: str + self.__refund_request_id = None # type: str + self.__refund_time = None # type: str + self.__refund_from_method = None # type: RefundFromMethod + self.__refund_to_amount = None # type: Amount + self.__refund_from_amount = None # type: Amount + self.__result = None # type: Result + self.parse_rsp_body(rsp_body) + + + @property + def refund_status(self): + """Gets the refund_status of this AlipayInquireDirectRefundResponse. + + """ + return self.__refund_status + + @refund_status.setter + def refund_status(self, value): + self.__refund_status = value + @property + def refund_result_message(self): + """ + The result message that explains the refund result code. Note: This field is returned when the API is called successfully (the value of result.resultStatus is S). More information: Maximum length: 256 characters + """ + return self.__refund_result_message + + @refund_result_message.setter + def refund_result_message(self, value): + self.__refund_result_message = value + @property + def refund_result_code(self): + """ + The result code for different refund statuses. Note: This field is returned when the API is called successfully (the value of result.resultStatus is S). More information: Maximum length: 64 characters + """ + return self.__refund_result_code + + @refund_result_code.setter + def refund_result_code(self, value): + self.__refund_result_code = value + @property + def refund_id(self): + """ + The unique ID assigned by Antom to identify a refund. A one-to-one correspondence between refundId and refundRequestId exists. Note: This field is returned when the API is called successfully (the value of result.resultStatus is S). More information: Maximum length: 64 characters + """ + return self.__refund_id + + @refund_id.setter + def refund_id(self, value): + self.__refund_id = value + @property + def payment_id(self): + """ + The unique ID assigned by Antom for the original payment to be refunded. Note: This field is returned when the API is called successfully (the value of result.resultStatus is S). More information: Maximum length: 64 characters + """ + return self.__payment_id + + @payment_id.setter + def payment_id(self, value): + self.__payment_id = value + @property + def refund_request_id(self): + """ + The unique ID assigned by the merchant to identify a refund request. Note: This field is returned when the API is called successfully (the value of result.resultStatus is S). More information: Maximum length: 64 characters + """ + return self.__refund_request_id + + @refund_request_id.setter + def refund_request_id(self, value): + self.__refund_request_id = value + @property + def refund_time(self): + """ + The date and time when the refund reaches a final state of success. Note: This field is returned when the value of refundStatus is SUCCESS. More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + """ + return self.__refund_time + + @refund_time.setter + def refund_time(self, value): + self.__refund_time = value + @property + def refund_from_method(self): + """Gets the refund_from_method of this AlipayInquireDirectRefundResponse. + + """ + return self.__refund_from_method + + @refund_from_method.setter + def refund_from_method(self, value): + self.__refund_from_method = value + @property + def refund_to_amount(self): + """Gets the refund_to_amount of this AlipayInquireDirectRefundResponse. + + """ + return self.__refund_to_amount + + @refund_to_amount.setter + def refund_to_amount(self, value): + self.__refund_to_amount = value + @property + def refund_from_amount(self): + """Gets the refund_from_amount of this AlipayInquireDirectRefundResponse. + + """ + return self.__refund_from_amount + + @refund_from_amount.setter + def refund_from_amount(self, value): + self.__refund_from_amount = value + @property + def result(self): + """Gets the result of this AlipayInquireDirectRefundResponse. + + """ + return self.__result + + @result.setter + def result(self, value): + self.__result = value + + + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "refund_status") and self.refund_status is not None: + params['refundStatus'] = self.refund_status + if hasattr(self, "refund_result_message") and self.refund_result_message is not None: + params['refundResultMessage'] = self.refund_result_message + if hasattr(self, "refund_result_code") and self.refund_result_code is not None: + params['refundResultCode'] = self.refund_result_code + if hasattr(self, "refund_id") and self.refund_id is not None: + params['refundId'] = self.refund_id + if hasattr(self, "payment_id") and self.payment_id is not None: + params['paymentId'] = self.payment_id + if hasattr(self, "refund_request_id") and self.refund_request_id is not None: + params['refundRequestId'] = self.refund_request_id + if hasattr(self, "refund_time") and self.refund_time is not None: + params['refundTime'] = self.refund_time + if hasattr(self, "refund_from_method") and self.refund_from_method is not None: + params['refundFromMethod'] = self.refund_from_method + if hasattr(self, "refund_to_amount") and self.refund_to_amount is not None: + params['refundToAmount'] = self.refund_to_amount + if hasattr(self, "refund_from_amount") and self.refund_from_amount is not None: + params['refundFromAmount'] = self.refund_from_amount + if hasattr(self, "result") and self.result is not None: + params['result'] = self.result + return params + + + def parse_rsp_body(self, response_body): + response_body = super(AlipayInquireDirectRefundResponse, self).parse_rsp_body(response_body) + if 'refundStatus' in response_body: + refund_status_temp = TransactionStatusType.value_of(response_body['refundStatus']) + self.__refund_status = refund_status_temp + if 'refundResultMessage' in response_body: + self.__refund_result_message = response_body['refundResultMessage'] + if 'refundResultCode' in response_body: + self.__refund_result_code = response_body['refundResultCode'] + if 'refundId' in response_body: + self.__refund_id = response_body['refundId'] + if 'paymentId' in response_body: + self.__payment_id = response_body['paymentId'] + if 'refundRequestId' in response_body: + self.__refund_request_id = response_body['refundRequestId'] + if 'refundTime' in response_body: + self.__refund_time = response_body['refundTime'] + if 'refundFromMethod' in response_body: + self.__refund_from_method = RefundFromMethod() + self.__refund_from_method.parse_rsp_body(response_body['refundFromMethod']) + if 'refundToAmount' in response_body: + self.__refund_to_amount = Amount() + self.__refund_to_amount.parse_rsp_body(response_body['refundToAmount']) + if 'refundFromAmount' in response_body: + self.__refund_from_amount = Amount() + self.__refund_from_amount.parse_rsp_body(response_body['refundFromAmount']) + if 'result' in response_body: + self.__result = Result() + self.__result.parse_rsp_body(response_body['result']) diff --git a/com/alipay/ams/api/response/pay/alipay_inquiry_refund_response.py b/com/alipay/ams/api/response/pay/alipay_inquiry_refund_response.py index 99e0cb6..7b958c0 100644 --- a/com/alipay/ams/api/response/pay/alipay_inquiry_refund_response.py +++ b/com/alipay/ams/api/response/pay/alipay_inquiry_refund_response.py @@ -56,7 +56,7 @@ def customized_info(self, value): @property def arn(self): """ - Acquirer Reference Number + Acquirer reference number. If the payment method includes an acquirer reference number, this field will have a value. """ return self.__arn diff --git a/com/alipay/ams/api/response/pay/alipay_pay_query_response.py b/com/alipay/ams/api/response/pay/alipay_pay_query_response.py index 6a44654..388fea5 100644 --- a/com/alipay/ams/api/response/pay/alipay_pay_query_response.py +++ b/com/alipay/ams/api/response/pay/alipay_pay_query_response.py @@ -343,8 +343,8 @@ def acquirer_info(self, value): self.__acquirer_info = value @property def merchant_account_id(self): - """Gets the merchant_account_id of this AlipayPayQueryResponse. - + """ + The unique ID to identify a merchant account. Note: Specify this parameter when you use a single client ID across multiple locations. """ return self.__merchant_account_id diff --git a/com/alipay/ams/api/response/pay/alipay_pay_response.py b/com/alipay/ams/api/response/pay/alipay_pay_response.py index d4458a1..22b80a0 100644 --- a/com/alipay/ams/api/response/pay/alipay_pay_response.py +++ b/com/alipay/ams/api/response/pay/alipay_pay_response.py @@ -316,7 +316,7 @@ def acquirer_info(self, value): @property def promotion_result(self): """ - Promotion result. + Promotion result. Note: This parameter is generated when the buyer applies a promotion during the process of placing an order. """ return self.__promotion_result diff --git a/com/alipay/ams/api/response/pay/alipay_vaulting_session_response.py b/com/alipay/ams/api/response/pay/alipay_vaulting_session_response.py index a8e58ab..18d8c9f 100644 --- a/com/alipay/ams/api/response/pay/alipay_vaulting_session_response.py +++ b/com/alipay/ams/api/response/pay/alipay_vaulting_session_response.py @@ -60,7 +60,7 @@ def vaulting_session_expiry_time(self, value): @property def normal_url(self): """ - The normal URL for vaulting session + The URL used to redirect to the card-binding page. """ return self.__normal_url diff --git a/com/alipay/ams/api/response/pay/alipay_vaults_fetch_nonce_response.py b/com/alipay/ams/api/response/pay/alipay_vaults_fetch_nonce_response.py index 9607e03..1b07220 100644 --- a/com/alipay/ams/api/response/pay/alipay_vaults_fetch_nonce_response.py +++ b/com/alipay/ams/api/response/pay/alipay_vaults_fetch_nonce_response.py @@ -16,8 +16,8 @@ def __init__(self, rsp_body): @property def card_token(self): - """Gets the card_token of this AlipayVaultsFetchNonceResponse. - + """ + The token of the card. The value of this parameter is used by paymentMethodId in the pay (One-time Payments) API when initiating payments. """ return self.__card_token diff --git a/com/alipay/ams/api/response/subscription/alipay_inquire_subscription_list_response.py b/com/alipay/ams/api/response/subscription/alipay_inquire_subscription_list_response.py new file mode 100644 index 0000000..5a828be --- /dev/null +++ b/com/alipay/ams/api/response/subscription/alipay_inquire_subscription_list_response.py @@ -0,0 +1,78 @@ +import json +from com.alipay.ams.api.model.result import Result +from com.alipay.ams.api.model.subscription_info import SubscriptionInfo +from com.alipay.ams.api.model.paginator import Paginator + + + +from com.alipay.ams.api.response.alipay_response import AlipayResponse + +class AlipayInquireSubscriptionListResponse(AlipayResponse): + def __init__(self, rsp_body): + super(AlipayResponse, self).__init__() + + self.__result = None # type: Result + self.__subscriptions = None # type: [SubscriptionInfo] + self.__paginator = None # type: Paginator + self.parse_rsp_body(rsp_body) + + + @property + def result(self): + """Gets the result of this AlipayInquireSubscriptionListResponse. + + """ + return self.__result + + @result.setter + def result(self, value): + self.__result = value + @property + def subscriptions(self): + """ + List of subscriptions that match the criteria. + """ + return self.__subscriptions + + @subscriptions.setter + def subscriptions(self, value): + self.__subscriptions = value + @property + def paginator(self): + """Gets the paginator of this AlipayInquireSubscriptionListResponse. + + """ + return self.__paginator + + @paginator.setter + def paginator(self, value): + self.__paginator = value + + + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "result") and self.result is not None: + params['result'] = self.result + if hasattr(self, "subscriptions") and self.subscriptions is not None: + params['subscriptions'] = self.subscriptions + if hasattr(self, "paginator") and self.paginator is not None: + params['paginator'] = self.paginator + return params + + + def parse_rsp_body(self, response_body): + response_body = super(AlipayInquireSubscriptionListResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: + self.__result = Result() + self.__result.parse_rsp_body(response_body['result']) + if 'subscriptions' in response_body: + self.__subscriptions = [] + for item in response_body['subscriptions']: + obj = SubscriptionInfo() + obj.parse_rsp_body(item) + self.__subscriptions.append(obj) + if 'paginator' in response_body: + self.__paginator = Paginator() + self.__paginator.parse_rsp_body(response_body['paginator']) diff --git a/com/alipay/ams/api/response/subscription/alipay_inquire_subscription_payment_response.py b/com/alipay/ams/api/response/subscription/alipay_inquire_subscription_payment_response.py new file mode 100644 index 0000000..25ffe5c --- /dev/null +++ b/com/alipay/ams/api/response/subscription/alipay_inquire_subscription_payment_response.py @@ -0,0 +1,78 @@ +import json +from com.alipay.ams.api.model.result import Result +from com.alipay.ams.api.model.subscription_transaction import SubscriptionTransaction +from com.alipay.ams.api.model.paginator import Paginator + + + +from com.alipay.ams.api.response.alipay_response import AlipayResponse + +class AlipayInquireSubscriptionPaymentResponse(AlipayResponse): + def __init__(self, rsp_body): + super(AlipayResponse, self).__init__() + + self.__result = None # type: Result + self.__payments = None # type: [SubscriptionTransaction] + self.__paginator = None # type: Paginator + self.parse_rsp_body(rsp_body) + + + @property + def result(self): + """Gets the result of this AlipayInquireSubscriptionPaymentResponse. + + """ + return self.__result + + @result.setter + def result(self, value): + self.__result = value + @property + def payments(self): + """ + List of transactions of the specified subscriptionId. Can be EMPTY if no criteria match or subscriptionId is not exists. + """ + return self.__payments + + @payments.setter + def payments(self, value): + self.__payments = value + @property + def paginator(self): + """Gets the paginator of this AlipayInquireSubscriptionPaymentResponse. + + """ + return self.__paginator + + @paginator.setter + def paginator(self, value): + self.__paginator = value + + + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "result") and self.result is not None: + params['result'] = self.result + if hasattr(self, "payments") and self.payments is not None: + params['payments'] = self.payments + if hasattr(self, "paginator") and self.paginator is not None: + params['paginator'] = self.paginator + return params + + + def parse_rsp_body(self, response_body): + response_body = super(AlipayInquireSubscriptionPaymentResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: + self.__result = Result() + self.__result.parse_rsp_body(response_body['result']) + if 'payments' in response_body: + self.__payments = [] + for item in response_body['payments']: + obj = SubscriptionTransaction() + obj.parse_rsp_body(item) + self.__payments.append(obj) + if 'paginator' in response_body: + self.__paginator = Paginator() + self.__paginator.parse_rsp_body(response_body['paginator']) diff --git a/com/alipay/ams/api/response/subscription/alipay_inquire_subscription_response.py b/com/alipay/ams/api/response/subscription/alipay_inquire_subscription_response.py new file mode 100644 index 0000000..3f75323 --- /dev/null +++ b/com/alipay/ams/api/response/subscription/alipay_inquire_subscription_response.py @@ -0,0 +1,58 @@ +import json +from com.alipay.ams.api.model.result import Result +from com.alipay.ams.api.model.subscription_info import SubscriptionInfo + + + +from com.alipay.ams.api.response.alipay_response import AlipayResponse + +class AlipayInquireSubscriptionResponse(AlipayResponse): + def __init__(self, rsp_body): + super(AlipayResponse, self).__init__() + + self.__result = None # type: Result + self.__subscription = None # type: SubscriptionInfo + self.parse_rsp_body(rsp_body) + + + @property + def result(self): + """Gets the result of this AlipayInquireSubscriptionResponse. + + """ + return self.__result + + @result.setter + def result(self, value): + self.__result = value + @property + def subscription(self): + """Gets the subscription of this AlipayInquireSubscriptionResponse. + + """ + return self.__subscription + + @subscription.setter + def subscription(self, value): + self.__subscription = value + + + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "result") and self.result is not None: + params['result'] = self.result + if hasattr(self, "subscription") and self.subscription is not None: + params['subscription'] = self.subscription + return params + + + def parse_rsp_body(self, response_body): + response_body = super(AlipayInquireSubscriptionResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: + self.__result = Result() + self.__result.parse_rsp_body(response_body['result']) + if 'subscription' in response_body: + self.__subscription = SubscriptionInfo() + self.__subscription.parse_rsp_body(response_body['subscription'])