diff --git a/com/alipay/ams/api/model/account_last_modified.py b/com/alipay/ams/api/model/account_last_modified.py new file mode 100644 index 0000000..98eed95 --- /dev/null +++ b/com/alipay/ams/api/model/account_last_modified.py @@ -0,0 +1,97 @@ +import json + + + + +class AccountLastModified: + def __init__(self): + + self.__password_change_date = None # type: str + self.__email_change_date = None # type: str + self.__listing_change_date = None # type: str + self.__login_date = None # type: str + self.__address_change_date = None # type: str + + + @property + def password_change_date(self): + """ + The date and time when the merchant last changed the account password. The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + """ + return self.__password_change_date + + @password_change_date.setter + def password_change_date(self, value): + self.__password_change_date = value + @property + def email_change_date(self): + """ + The date and time when the merchant last changed the account email address. The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + """ + return self.__email_change_date + + @email_change_date.setter + def email_change_date(self, value): + self.__email_change_date = value + @property + def listing_change_date(self): + """ + The date and time when the merchant last changed the account listing information. The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + """ + return self.__listing_change_date + + @listing_change_date.setter + def listing_change_date(self, value): + self.__listing_change_date = value + @property + def login_date(self): + """ + The date and time when the merchant last logged in to the account. The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + """ + return self.__login_date + + @login_date.setter + def login_date(self, value): + self.__login_date = value + @property + def address_change_date(self): + """ + The date and time when the merchant last changed the account address. The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + """ + return self.__address_change_date + + @address_change_date.setter + def address_change_date(self, value): + self.__address_change_date = value + + + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "password_change_date") and self.password_change_date is not None: + params['passwordChangeDate'] = self.password_change_date + if hasattr(self, "email_change_date") and self.email_change_date is not None: + params['emailChangeDate'] = self.email_change_date + if hasattr(self, "listing_change_date") and self.listing_change_date is not None: + params['listingChangeDate'] = self.listing_change_date + if hasattr(self, "login_date") and self.login_date is not None: + params['loginDate'] = self.login_date + if hasattr(self, "address_change_date") and self.address_change_date is not None: + params['addressChangeDate'] = self.address_change_date + return params + + + def parse_rsp_body(self, response_body): + if isinstance(response_body, str): + response_body = json.loads(response_body) + if 'passwordChangeDate' in response_body: + self.__password_change_date = response_body['passwordChangeDate'] + if 'emailChangeDate' in response_body: + self.__email_change_date = response_body['emailChangeDate'] + if 'listingChangeDate' in response_body: + self.__listing_change_date = response_body['listingChangeDate'] + if 'loginDate' in response_body: + self.__login_date = response_body['loginDate'] + if 'addressChangeDate' in response_body: + self.__address_change_date = response_body['addressChangeDate'] diff --git a/com/alipay/ams/api/model/goods.py b/com/alipay/ams/api/model/goods.py index e03d837..abe5f22 100644 --- a/com/alipay/ams/api/model/goods.py +++ b/com/alipay/ams/api/model/goods.py @@ -116,8 +116,8 @@ def delivery_method_type(self, value): self.__delivery_method_type = value @property def goods_image_url(self): - """Gets the goods_image_url of this Goods. - + """ + The URL of the goods image. When using KLARNA, this value is used to display the goods image in the payment method app and must not exceed 1024 characters. """ return self.__goods_image_url diff --git a/com/alipay/ams/api/model/three_ds_result.py b/com/alipay/ams/api/model/three_ds_result.py index 4aea7f5..82268d5 100644 --- a/com/alipay/ams/api/model/three_ds_result.py +++ b/com/alipay/ams/api/model/three_ds_result.py @@ -16,6 +16,8 @@ def __init__(self): self.__challenged = None # type: bool self.__exemption_type = None # type: str self.__three_ds_offered = None # type: bool + self.__pa_res_status = None # type: str + self.__liability_shift = None # type: int @property @@ -118,6 +120,26 @@ def three_ds_offered(self): @three_ds_offered.setter def three_ds_offered(self, value): self.__three_ds_offered = value + @property + def pa_res_status(self): + """ + Payer Authentication Response Status returned by the issuer or authentication system during 3D Secure authentication. Valid values are: Y (successful authentication), N (failed authentication or transaction denied), U (unable to complete authentication), A (successful attempts transaction), C (challenge required), R (authentication rejected; authorization must not be attempted), D (decoupled authentication challenge confirmed), and I (informational only). D and I are intermediate authentication states and require no merchant action; use paymentStatus and resultCode as the authoritative payment outcome. This field is returned only when paymentMethodType is CARD, threeDSOffered is true, and threeDSResult is returned. If these conditions are met but the channel does not provide a value, the JSON value can be null; otherwise the property is omitted. + """ + return self.__pa_res_status + + @pa_res_status.setter + def pa_res_status(self, value): + self.__pa_res_status = value + @property + def liability_shift(self): + """ + Indicates whether liability has shifted for the transaction. Valid values are: 1 (yes), 0 (no), and -1 (unknown). The upstream channel value is passed through when available; otherwise Antom calculates the value from CAVV and ECI according to card-network rules, and returns -1 only when the value cannot be determined. Treat -1 as liability not shifted for chargeback decisions. This field does not determine the payment outcome and is returned only when paymentMethodType is CARD, threeDSOffered is true, and threeDSResult is returned; otherwise the property is omitted. + """ + return self.__liability_shift + + @liability_shift.setter + def liability_shift(self, value): + self.__liability_shift = value @@ -144,6 +166,10 @@ def to_ams_dict(self): params['exemptionType'] = self.exemption_type if hasattr(self, "three_ds_offered") and self.three_ds_offered is not None: params['threeDSOffered'] = self.three_ds_offered + if hasattr(self, "pa_res_status") and self.pa_res_status is not None: + params['paResStatus'] = self.pa_res_status + if hasattr(self, "liability_shift") and self.liability_shift is not None: + params['liabilityShift'] = self.liability_shift return params @@ -170,3 +196,7 @@ def parse_rsp_body(self, response_body): self.__exemption_type = response_body['exemptionType'] if 'threeDSOffered' in response_body: self.__three_ds_offered = response_body['threeDSOffered'] + if 'paResStatus' in response_body: + self.__pa_res_status = response_body['paResStatus'] + if 'liabilityShift' in response_body: + self.__liability_shift = response_body['liabilityShift'] diff --git a/com/alipay/ams/api/request/pay/alipay_capture_request.py b/com/alipay/ams/api/request/pay/alipay_capture_request.py index 14853e3..0015f7d 100644 --- a/com/alipay/ams/api/request/pay/alipay_capture_request.py +++ b/com/alipay/ams/api/request/pay/alipay_capture_request.py @@ -1,6 +1,8 @@ import json from com.alipay.ams.api.model.amount import Amount from com.alipay.ams.api.model.transit import Transit +from com.alipay.ams.api.model.goods import Goods +from com.alipay.ams.api.model.shipping import Shipping @@ -16,6 +18,8 @@ def __init__(self): self.__is_last_capture = None # type: bool self.__capture_type = None # type: str self.__transit = None # type: Transit + self.__goods = None # type: [Goods] + self.__shippings = None # type: [Shipping] @property @@ -61,7 +65,7 @@ def is_last_capture(self, value): @property def capture_type(self): """ - The type of capture operation + The type of capture operation. Valid values are FINAL (the final capture) and NON_FINAL (a non-final capture). The default value is FINAL. """ return self.__capture_type @@ -78,6 +82,26 @@ def transit(self): @transit.setter def transit(self, value): self.__transit = value + @property + def goods(self): + """ + The goods included in this capture. When using KLARNA, provide the goods information required for the capture. + """ + return self.__goods + + @goods.setter + def goods(self, value): + self.__goods = value + @property + def shippings(self): + """ + The shipment information for this capture. When using KLARNA, this field can be provided to display shipment tracking information in the payment method app. + """ + return self.__shippings + + @shippings.setter + def shippings(self, value): + self.__shippings = value def to_ams_json(self): @@ -99,6 +123,10 @@ def to_ams_dict(self): params['captureType'] = self.capture_type if hasattr(self, "transit") and self.transit is not None: params['transit'] = self.transit + if hasattr(self, "goods") and self.goods is not None: + params['goods'] = self.goods + if hasattr(self, "shippings") and self.shippings is not None: + params['shippings'] = self.shippings return params @@ -119,3 +147,15 @@ def parse_rsp_body(self, response_body): if 'transit' in response_body: self.__transit = Transit() self.__transit.parse_rsp_body(response_body['transit']) + if 'goods' in response_body: + self.__goods = [] + for item in response_body['goods']: + obj = Goods() + obj.parse_rsp_body(item) + self.__goods.append(obj) + if 'shippings' in response_body: + self.__shippings = [] + for item in response_body['shippings']: + obj = Shipping() + obj.parse_rsp_body(item) + self.__shippings.append(obj) 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 f7a679d..cc017d2 100644 --- a/com/alipay/ams/api/request/pay/alipay_refund_request.py +++ b/com/alipay/ams/api/request/pay/alipay_refund_request.py @@ -4,6 +4,7 @@ from com.alipay.ams.api.model.amount import Amount from com.alipay.ams.api.model.refund_detail import RefundDetail from com.alipay.ams.api.model.amount import Amount +from com.alipay.ams.api.model.goods import Goods @@ -28,6 +29,7 @@ def __init__(self): self.__refund_details = None # type: [RefundDetail] self.__refund_source_account_no = None # type: str self.__actual_refund_amount = None # type: Amount + self.__goods = None # type: [Goods] @property @@ -180,6 +182,16 @@ def actual_refund_amount(self): @actual_refund_amount.setter def actual_refund_amount(self, value): self.__actual_refund_amount = value + @property + def goods(self): + """ + The goods included in this refund. When using KLARNA, this field is required for a partial refund. + """ + return self.__goods + + @goods.setter + def goods(self, value): + self.__goods = value def to_ams_json(self): @@ -219,6 +231,8 @@ def to_ams_dict(self): params['refundSourceAccountNo'] = self.refund_source_account_no if hasattr(self, "actual_refund_amount") and self.actual_refund_amount is not None: params['actualRefundAmount'] = self.actual_refund_amount + if hasattr(self, "goods") and self.goods is not None: + params['goods'] = self.goods return params @@ -263,3 +277,9 @@ def parse_rsp_body(self, response_body): if 'actualRefundAmount' in response_body: self.__actual_refund_amount = Amount() self.__actual_refund_amount.parse_rsp_body(response_body['actualRefundAmount']) + if 'goods' in response_body: + self.__goods = [] + for item in response_body['goods']: + obj = Goods() + obj.parse_rsp_body(item) + self.__goods.append(obj) diff --git a/com/alipay/ams/api/request/pay/ams_api_v1_payments_capture_post_request.py b/com/alipay/ams/api/request/pay/ams_api_v1_payments_capture_post_request.py index 3a13ea8..42ac0a3 100644 --- a/com/alipay/ams/api/request/pay/ams_api_v1_payments_capture_post_request.py +++ b/com/alipay/ams/api/request/pay/ams_api_v1_payments_capture_post_request.py @@ -1,5 +1,7 @@ import json from com.alipay.ams.api.model.amount import Amount +from com.alipay.ams.api.model.goods import Goods +from com.alipay.ams.api.model.shipping import Shipping @@ -13,6 +15,9 @@ def __init__(self): self.__payment_id = None # type: str self.__capture_amount = None # type: Amount self.__is_last_capture = None # type: bool + self.__capture_type = None # type: str + self.__goods = None # type: [Goods] + self.__shippings = None # type: [Shipping] @property @@ -55,6 +60,36 @@ def is_last_capture(self): @is_last_capture.setter def is_last_capture(self, value): self.__is_last_capture = value + @property + def capture_type(self): + """ + The type of capture operation. Valid values are FINAL (the final capture) and NON_FINAL (a non-final capture). The default value is FINAL. + """ + return self.__capture_type + + @capture_type.setter + def capture_type(self, value): + self.__capture_type = value + @property + def goods(self): + """ + The goods included in this capture. When using KLARNA, provide the goods information required for the capture. + """ + return self.__goods + + @goods.setter + def goods(self, value): + self.__goods = value + @property + def shippings(self): + """ + The shipment information for this capture. When using KLARNA, this field can be provided to display shipment tracking information in the payment method app. + """ + return self.__shippings + + @shippings.setter + def shippings(self, value): + self.__shippings = value def to_ams_json(self): @@ -72,6 +107,12 @@ def to_ams_dict(self): params['captureAmount'] = self.capture_amount if hasattr(self, "is_last_capture") and self.is_last_capture is not None: params['isLastCapture'] = self.is_last_capture + if hasattr(self, "capture_type") and self.capture_type is not None: + params['captureType'] = self.capture_type + if hasattr(self, "goods") and self.goods is not None: + params['goods'] = self.goods + if hasattr(self, "shippings") and self.shippings is not None: + params['shippings'] = self.shippings return params @@ -87,3 +128,17 @@ def parse_rsp_body(self, response_body): self.__capture_amount.parse_rsp_body(response_body['captureAmount']) if 'isLastCapture' in response_body: self.__is_last_capture = response_body['isLastCapture'] + if 'captureType' in response_body: + self.__capture_type = response_body['captureType'] + if 'goods' in response_body: + self.__goods = [] + for item in response_body['goods']: + obj = Goods() + obj.parse_rsp_body(item) + self.__goods.append(obj) + if 'shippings' in response_body: + self.__shippings = [] + for item in response_body['shippings']: + obj = Shipping() + obj.parse_rsp_body(item) + self.__shippings.append(obj) 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 7b958c0..a038f5a 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 @@ -30,6 +30,7 @@ def __init__(self, rsp_body): self.__settlement_quote = None # type: Quote self.__acquirer_info = None # type: AcquirerInfo self.__rrn = None # type: str + self.__authorization_code = None # type: str self.parse_rsp_body(rsp_body) @@ -173,6 +174,16 @@ def rrn(self): @rrn.setter def rrn(self, value): self.__rrn = value + @property + def authorization_code(self): + """ + The authorization code returned by the payment channel for a successful refund. This field is returned only when refundStatus is SUCCESS, the payment method or channel supplies a non-empty value, and the merchant is enabled for this capability. Otherwise, the property is omitted and is never returned as JSON null. The exact channel-provided string is returned without trimming, padding, case conversion, substitution, or truncation. Its absence does not change the refund result or produce a field-specific error. + """ + return self.__authorization_code + + @authorization_code.setter + def authorization_code(self, value): + self.__authorization_code = value @@ -207,6 +218,8 @@ def to_ams_dict(self): params['acquirerInfo'] = self.acquirer_info if hasattr(self, "rrn") and self.rrn is not None: params['rrn'] = self.rrn + if hasattr(self, "authorization_code") and self.authorization_code is not None: + params['authorizationCode'] = self.authorization_code return params @@ -248,3 +261,5 @@ def parse_rsp_body(self, response_body): self.__acquirer_info.parse_rsp_body(response_body['acquirerInfo']) if 'rrn' in response_body: self.__rrn = response_body['rrn'] + if 'authorizationCode' in response_body: + self.__authorization_code = response_body['authorizationCode'] diff --git a/com/alipay/ams/api/response/pay/ams_api_v1_payments_inquiry_refund_post200_response.py b/com/alipay/ams/api/response/pay/ams_api_v1_payments_inquiry_refund_post200_response.py index 8d35bc9..6fb6a45 100644 --- a/com/alipay/ams/api/response/pay/ams_api_v1_payments_inquiry_refund_post200_response.py +++ b/com/alipay/ams/api/response/pay/ams_api_v1_payments_inquiry_refund_post200_response.py @@ -23,6 +23,7 @@ def __init__(self, rsp_body): self.__gross_settlement_amount = None # type: Amount self.__settlement_quote = None # type: Quote self.__acquirer_info = None # type: AcquirerInfo + self.__authorization_code = None # type: str self.parse_rsp_body(rsp_body) @@ -116,6 +117,16 @@ def acquirer_info(self): @acquirer_info.setter def acquirer_info(self, value): self.__acquirer_info = value + @property + def authorization_code(self): + """ + The authorization code returned by the payment channel for a successful refund. This field is returned only when refundStatus is SUCCESS, the payment method or channel supplies a non-empty value, and the merchant is enabled for this capability. Otherwise, the property is omitted and is never returned as JSON null. The exact channel-provided string is returned without trimming, padding, case conversion, substitution, or truncation. Its absence does not change the refund result or produce a field-specific error. + """ + return self.__authorization_code + + @authorization_code.setter + def authorization_code(self, value): + self.__authorization_code = value @@ -140,6 +151,8 @@ def to_ams_dict(self): params['settlementQuote'] = self.settlement_quote if hasattr(self, "acquirer_info") and self.acquirer_info is not None: params['acquirerInfo'] = self.acquirer_info + if hasattr(self, "authorization_code") and self.authorization_code is not None: + params['authorizationCode'] = self.authorization_code return params @@ -169,3 +182,5 @@ def parse_rsp_body(self, response_body): if 'acquirerInfo' in response_body: self.__acquirer_info = AcquirerInfo() self.__acquirer_info.parse_rsp_body(response_body['acquirerInfo']) + if 'authorizationCode' in response_body: + self.__authorization_code = response_body['authorizationCode']