Skip to content

Commit a839f31

Browse files
committed
update version
1 parent 0498d1d commit a839f31

File tree

8 files changed

+279
-4
lines changed

8 files changed

+279
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
```
22
Language:Python
33
Python version:2.7+
4-
Releass ^1.4.25
4+
Releass ^1.4.26
55
Copyright:Ant financial services group
66
```
77

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import json
2+
3+
4+
class PaymentAttempt:
5+
def __init__(self):
6+
self.__attemptAt = None # type: str
7+
self.__attempt_response = None # type: str
8+
9+
10+
@property
11+
def attemptAt(self):
12+
return self.__attemptAt
13+
14+
@attemptAt.setter
15+
def attemptAt(self, value):
16+
self.__attemptAt = value
17+
18+
@property
19+
def attempt_response(self):
20+
return self.__attempt_response
21+
@attempt_response.setter
22+
def attempt_response(self, value):
23+
self.__attempt_response = value
24+
25+
def to_ams_dict(self):
26+
params = dict()
27+
if hasattr(self, "attemptAt") and self.attemptAt is not None:
28+
params['attemptAt'] = self.attemptAt
29+
if hasattr(self, "attempt_response") and self.attempt_response is not None:
30+
params['attempt_response'] = self.attempt_response
31+
return params
32+
33+
34+
def parse_rsp_body(self, response_body):
35+
if isinstance(response_body, str):
36+
response_body = json.loads(response_body)
37+
if 'attemptAt' in response_body:
38+
self.__attemptAt = response_body['attemptAt']
39+
if 'attempt_response' in response_body:
40+
self.__attempt_response = response_body['attempt_response']
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import json
2+
3+
from com.alipay.ams.api.model.payment_attempt import PaymentAttempt
4+
5+
6+
class RetryInfo:
7+
def __init__(self):
8+
self.__available_retries = None # type: int
9+
self.__payment_attempts = None # type: list: PaymentAttempt
10+
11+
12+
@property
13+
def available_retries(self):
14+
return self.__available_retries
15+
16+
@available_retries.setter
17+
def available_retries(self, value):
18+
self.__available_retries = value
19+
20+
21+
@property
22+
def payment_attempts(self):
23+
return self.__payment_attempts
24+
25+
@payment_attempts.setter
26+
def payment_attempts(self, value):
27+
self.__payment_attempts = value
28+
29+
30+
def to_ams_dict(self):
31+
params = dict()
32+
if self.__available_retries:
33+
params['availableRetries'] = self.__available_retries
34+
if self.__payment_attempts:
35+
params['paymentAttempts'] = [i.to_ams_dict() for i in self.__payment_attempts]
36+
return params
37+
38+
39+
def parse_rsp_body(self, response_body):
40+
if isinstance(response_body, str):
41+
response_body = json.loads(response_body)
42+
if 'availableRetries' in response_body:
43+
self.__available_retries = response_body['availableRetries']
44+
if 'paymentAttempts' in response_body:
45+
self.__payment_attempts = [PaymentAttempt().parse_rsp_body(i) for i in response_body['paymentAttempts']]

com/alipay/ams/api/model/statement.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ def parse_rsp_body(self, response_body):
213213
self.__fund_move_detail = FundMoveDetail()
214214
self.__fund_move_detail.parse_rsp_body(response_body['fundMoveDetail'])
215215
if 'foreignExchangeQuote' in response_body:
216+
self.__foreign_exchange_quote = ForeignExchangeQuote()
217+
self.__foreign_exchange_quote.parse_rsp_body(response_body['foreignExchangeQuote'])
216218
if 'statementId' in response_body:
217219
self.__statement_id = response_body['statementId']
218220
if 'transactionTime' in response_body:

com/alipay/ams/api/request/notify/alipay_pay_result_notify.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from com.alipay.ams.api.model.refund_to_bank_info import RefundToBankInfo
2+
from com.alipay.ams.api.model.retry_info import RetryInfo
13
from com.alipay.ams.api.request.notify.alipay_notify import AlipayNotify
24

35

@@ -20,6 +22,9 @@ def __init__(self, notify_body):
2022
self.__promotion_result = None
2123
self.__payment_method_type = None
2224
self.__metadata = None # type: str
25+
self.__subscriptionOrderId = None
26+
self.__subscription_id = None # type: str
27+
self.__retry_info = None # type: RetryInfo
2328
self.__parse_notify_body(notify_body)
2429

2530
@property
@@ -82,6 +87,21 @@ def payment_method_type(self):
8287
def metadata(self):
8388
return self.__metadata
8489

90+
@property
91+
def subscription_order_id(self):
92+
return self.__subscriptionOrderId
93+
94+
@subscription_order_id.setter
95+
def subscription_order_id(self, value):
96+
self.__subscriptionOrderId = value
97+
98+
@property
99+
def retry_info(self):
100+
return self.__retry_info
101+
@retry_info.setter
102+
def retry_info(self, value):
103+
self.__retry_info = value
104+
85105
def __parse_notify_body(self, notify_body):
86106
notify = super(AlipayPayResultNotify, self).parse_notify_body(notify_body)
87107
if "paymentRequestId" in notify:
@@ -114,4 +134,8 @@ def __parse_notify_body(self, notify_body):
114134
if "paymentMethodType" in notify:
115135
self.__payment_method_type = notify["paymentMethodType"]
116136
if "metadata" in notify:
117-
self.__metadata = notify["metadata"]
137+
self.__metadata = notify["metadata"]
138+
if "subscriptionOrderId" in notify:
139+
self.__subscriptionOrderId = notify["subscriptionOrderId"]
140+
if "retryInfo" in notify:
141+
self.__retry_info = notify["retryInfo"]
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
import json
2+
from typing import Optional, Any, Dict
3+
4+
from com.alipay.ams.api.model.amount import Amount
5+
from com.alipay.ams.api.request.notify.alipay_notify import AlipayNotify
6+
7+
8+
class AlipaySubscriptionCancelNotify(AlipayNotify):
9+
def __init__(self, notify_body):
10+
super(AlipaySubscriptionCancelNotify, self).__init__()
11+
self.__payment_amount = None # type: Optional[PaymentAmount]
12+
self.__payment_create_time = None # type: Optional[str]
13+
self.__payment_time = None # type: Optional[str]
14+
self.__period_end_time = None # type: Optional[str]
15+
self.__phase_no = None # type: Optional[str]
16+
self.__subscription_id = None # type: Optional[str]
17+
self.__subscription_order_id = None # type: Optional[str]
18+
self.__subscription_order_status = None # type: Optional[str]
19+
self.__subscription_request_id = None # type: Optional[str]
20+
self.__subscription_trans_id = None # type: Optional[str]
21+
self.__parse_notify_body(notify_body)
22+
23+
# --- Properties for payment_amount ---
24+
@property
25+
def payment_amount(self) -> Optional['PaymentAmount']:
26+
return self.__payment_amount
27+
28+
@payment_amount.setter
29+
def payment_amount(self, value: Optional['PaymentAmount']):
30+
self.__payment_amount = value
31+
32+
# --- Properties for payment_create_time ---
33+
@property
34+
def payment_create_time(self) -> Optional[str]:
35+
return self.__payment_create_time
36+
37+
@payment_create_time.setter
38+
def payment_create_time(self, value: Optional[str]):
39+
self.__payment_create_time = value
40+
41+
# --- Properties for payment_time ---
42+
@property
43+
def payment_time(self) -> Optional[str]:
44+
return self.__payment_time
45+
46+
@payment_time.setter
47+
def payment_time(self, value: Optional[str]):
48+
self.__payment_time = value
49+
50+
# --- Properties for period_end_time ---
51+
@property
52+
def period_end_time(self) -> Optional[str]:
53+
return self.__period_end_time
54+
55+
@period_end_time.setter
56+
def period_end_time(self, value: Optional[str]):
57+
self.__period_end_time = value
58+
59+
# --- Properties for phase_no ---
60+
@property
61+
def phase_no(self) -> Optional[str]:
62+
return self.__phase_no
63+
64+
@phase_no.setter
65+
def phase_no(self, value: Optional[str]):
66+
self.__phase_no = value
67+
68+
69+
# --- Properties for subscription_id ---
70+
@property
71+
def subscription_id(self) -> Optional[str]:
72+
return self.__subscription_id
73+
74+
@subscription_id.setter
75+
def subscription_id(self, value: Optional[str]):
76+
self.__subscription_id = value
77+
78+
# --- Properties for subscription_order_id ---
79+
@property
80+
def subscription_order_id(self) -> Optional[str]:
81+
return self.__subscription_order_id
82+
83+
@subscription_order_id.setter
84+
def subscription_order_id(self, value: Optional[str]):
85+
self.__subscription_order_id = value
86+
87+
# --- Properties for subscription_order_status ---
88+
@property
89+
def subscription_order_status(self) -> Optional[str]:
90+
return self.__subscription_order_status
91+
92+
@subscription_order_status.setter
93+
def subscription_order_status(self, value: Optional[str]):
94+
self.__subscription_order_status = value
95+
96+
# --- Properties for subscription_request_id ---
97+
@property
98+
def subscription_request_id(self) -> Optional[str]:
99+
return self.__subscription_request_id
100+
101+
@subscription_request_id.setter
102+
def subscription_request_id(self, value: Optional[str]):
103+
self.__subscription_request_id = value
104+
105+
# --- Properties for subscription_trans_id ---
106+
@property
107+
def subscription_trans_id(self) -> Optional[str]:
108+
return self.__subscription_trans_id
109+
110+
@subscription_trans_id.setter
111+
def subscription_trans_id(self, value: Optional[str]):
112+
self.__subscription_trans_id = value
113+
114+
def to_ams_dict(self) -> Dict[str, Any]:
115+
"""Convert object to dictionary with camelCase keys for AMS API."""
116+
params = {}
117+
118+
if self.payment_amount is not None:
119+
params['paymentAmount'] = self.payment_amount.to_ams_dict()
120+
if self.payment_create_time is not None:
121+
params['paymentCreateTime'] = self.payment_create_time
122+
if self.payment_time is not None:
123+
params['paymentTime'] = self.payment_time
124+
if self.period_end_time is not None:
125+
params['periodEndTime'] = self.period_end_time
126+
if self.phase_no is not None:
127+
params['phaseNo'] = self.phase_no
128+
if self.subscription_id is not None:
129+
params['subscriptionId'] = self.subscription_id
130+
if self.subscription_order_id is not None:
131+
params['subscriptionOrderId'] = self.subscription_order_id
132+
if self.subscription_order_status is not None:
133+
params['subscriptionOrderStatus'] = self.subscription_order_status
134+
if self.subscription_request_id is not None:
135+
params['subscriptionRequestId'] = self.subscription_request_id
136+
if self.subscription_trans_id is not None:
137+
params['subscriptionTransId'] = self.subscription_trans_id
138+
139+
return params
140+
141+
def __parse_notify_body(self, notify_body):
142+
notify = super(AlipaySubscriptionCancelNotify, self).parse_notify_body(notify_body)
143+
if "paymentAmount" in notify:
144+
from com.alipay.ams.api.model.amount import Amount
145+
self.__payment_amount = Amount()
146+
self.__payment_amount.parse_rsp_body(notify["paymentAmount"])
147+
if "paymentCreateTime" in notify:
148+
self.__payment_create_time = notify["paymentCreateTime"]
149+
if "paymentTime" in notify:
150+
self.__payment_time = notify["paymentTime"]
151+
if "periodEndTime" in notify:
152+
self.__period_end_time = notify["periodEndTime"]
153+
if "phaseNo" in notify:
154+
self.__phase_no = notify["phaseNo"]
155+
if "subscriptionId" in notify:
156+
self.__subscription_id = notify["subscriptionId"]
157+
if "subscriptionOrderId" in notify:
158+
self.__subscription_order_id = notify["subscriptionOrderId"]
159+
if "subscriptionOrderStatus" in notify:
160+
self.__subscription_order_status = notify["subscriptionOrderStatus"]
161+
if "subscriptionRequestId" in notify:
162+
self.__subscription_request_id = notify["subscriptionRequestId"]
163+
if "subscriptionTransId" in notify:
164+
self.__subscription_trans_id = notify["subscriptionTransId"]

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = global-alipay-sdk-python
3-
version = 1.4.25
3+
version = 1.4.26
44

55
[options]
66
packages = find:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
AUTHOR = "guodong.wzj"
1313
AUTHOR_EMAIL = "wangzunjiao.wzj@digital-engine.com"
1414
URL = "https://github.com/alipay/global-open-sdk-python"
15-
VERSION = "1.4.25"
15+
VERSION = "1.4.26"
1616
"""
1717
only python2 need enum34、pytz
1818
"""

0 commit comments

Comments
 (0)