diff --git a/com/alipay/ams/api/model/acquirer_info.py b/com/alipay/ams/api/model/acquirer_info.py index 80a27ab..fa0296d 100644 --- a/com/alipay/ams/api/model/acquirer_info.py +++ b/com/alipay/ams/api/model/acquirer_info.py @@ -14,6 +14,7 @@ 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 @property @@ -96,6 +97,16 @@ 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 @@ -118,6 +129,8 @@ 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 return params @@ -140,3 +153,5 @@ 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'] 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/payment_result_info.py b/com/alipay/ams/api/model/payment_result_info.py index 561f13b..bd24480 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 @@ -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/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/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..6081e68 --- /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/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..11bfaca --- /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/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_inquire_direct_payment_request.py b/com/alipay/ams/api/request/aba/alipay_inquire_direct_payment_request.py new file mode 100644 index 0000000..1fed94c --- /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/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..1510284 --- /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/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/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'])