Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions com/alipay/ams/api/model/account_last_modified.py
Original file line number Diff line number Diff line change
@@ -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']
4 changes: 2 additions & 2 deletions com/alipay/ams/api/model/goods.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
30 changes: 30 additions & 0 deletions com/alipay/ams/api/model/three_ds_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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



Expand All @@ -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


Expand All @@ -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']
42 changes: 41 additions & 1 deletion com/alipay/ams/api/request/pay/alipay_capture_request.py
Original file line number Diff line number Diff line change
@@ -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



Expand All @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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):
Expand All @@ -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


Expand All @@ -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)
20 changes: 20 additions & 0 deletions com/alipay/ams/api/request/pay/alipay_refund_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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



Expand All @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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


Expand Down Expand Up @@ -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)
Original file line number Diff line number Diff line change
@@ -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



Expand All @@ -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
Expand Down Expand Up @@ -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):
Expand All @@ -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


Expand All @@ -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)
Loading