Skip to content

Commit 2ac60bd

Browse files
committed
1. RDR拒付通知优化通用能力变更
2. Antom新增ApplePay支付方式
1 parent ed902a1 commit 2ac60bd

15 files changed

+249
-10
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 1.3.8 - 2024-12-16
4+
* [#20](https://github.com/alipay/global-open-sdk-python/pull/20) feature-241216
5+
- RDR拒付通知优化通用能力变更
6+
- Antom新增ApplePay支付方式
7+
38
## 1.3.7 - 2024-12-02
49
* [#19](https://github.com/alipay/global-open-sdk-python/pull/19) feature-241202
510
- update AlipayDisputeNotify

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.3.7
4+
Releass ^1.3.8
55
Copyright:Ant financial services group
66
```
77

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import string
2+
3+
4+
class ApplePayConfiguration:
5+
def __init__(self):
6+
self.__required_billing_contact_fields = None #type: list[string]
7+
self.__required_shipping_contact_fields = None #type: list[string]
8+
self.__buttons_bundled = None #type: bool
9+
10+
11+
@property
12+
def required_billing_contact_fields(self):
13+
return self.__required_billing_contact_fields
14+
15+
@required_billing_contact_fields.setter
16+
def required_billing_contact_fields(self, value):
17+
self.__required_billing_contact_fields = value
18+
19+
@property
20+
def required_shipping_contact_fields(self):
21+
return self.__required_shipping_contact_fields
22+
23+
@required_shipping_contact_fields.setter
24+
def required_shipping_contact_fields(self, value):
25+
self.__required_shipping_contact_fields = value
26+
27+
28+
@property
29+
def buttons_bundled(self):
30+
return self.__buttons_bundled
31+
32+
@buttons_bundled.setter
33+
def buttons_bundled(self, value: bool):
34+
self.__buttons_bundled = value
35+
36+
def to_ams_dict(self):
37+
params = dict()
38+
if hasattr(self, "required_billing_contact_fields") and self.required_billing_contact_fields:
39+
params['referenceBuyerId'] = self.required_shipping_contact_fields
40+
if hasattr(self, "required_shipping_contact_fields") and self.required_shipping_contact_fields:
41+
params['referenceBuyerId'] = self.required_shipping_contact_fields
42+
if hasattr(self, "buttons_bundled") and self.buttons_bundled:
43+
params['referenceBuyerId'] = self.buttons_bundled
44+
return params
45+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from enum import Enum, unique
2+
3+
4+
@unique
5+
class DisputeAcceptReasonType(Enum):
6+
MERCHANT_ACCEPTED = "MERCHANT_ACCEPTED"
7+
TIMEOUT = "TIMEOUT"
8+
MANUAL_PROCESSING_ACCEPTED = "MANUAL_PROCESSING_ACCEPTED"
9+
10+
def to_ams_dict(self):
11+
return self.name
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from enum import Enum, unique
2+
3+
4+
@unique
5+
class DisputeNotificationType(Enum):
6+
ACCEPT_BY_CUSTOMER = "ACCEPT_BY_CUSTOMER"
7+
ACCEPT_BY_MERCHANT = "ACCEPT_BY_MERCHANT"
8+
9+
def to_ams_dict(self):
10+
return self.name
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from enum import Enum, unique
2+
3+
4+
@unique
5+
class DisputeNotificationType(Enum):
6+
DISPUTE_CREATED = "DISPUTE_CREATED"
7+
DISPUTE_JUDGED = "DISPUTE_JUDGED"
8+
DISPUTE_CANCELLED = "DISPUTE_CANCELLED"
9+
DEFENSE_SUPPLIED = "DEFENSE_SUPPLIED"
10+
DEFENSE_DUE_ALERT = "DEFENSE_DUE_ALERT"
11+
DISPUTE_ACCEPTED = "DISPUTE_ACCEPTED"
12+
RDR_RESOLVED = "RDR_RESOLVED"
13+
14+
def to_ams_dict(self):
15+
return self.name

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ class PaymentMethodType(Enum):
88
INTEREST_FREE = "INTEREST_FREE"
99
BALANCE_ACCOUNT = "BALANCE_ACCOUNT"
1010
SETTLEMENT_CARD = "SETTLEMENT_CARD"
11+
APPLEPAY = "APPLEPAY"
1112
def to_ams_dict(self):
1213
return self.name

com/alipay/ams/api/request/auth/alipay_auth_consult_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def extend_info(self, value):
110110

111111
@property
112112
def recurring_payment(self):
113-
return self.recurring_payment
113+
return self.__recurring_payment
114114

115115
@recurring_payment.setter
116116
def recurring_payment(self, value):
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import json
2+
3+
from com.alipay.ams.api.model.agreement_info import AgreementInfo
4+
from com.alipay.ams.api.model.antom_path_constants import AntomPathConstants
5+
from com.alipay.ams.api.model.payment_method import PaymentMethod
6+
from com.alipay.ams.api.model.product_code_type import ProductCodeType
7+
from com.alipay.ams.api.model.scope_type import ScopeType
8+
from com.alipay.ams.api.request.alipay_request import AlipayRequest
9+
10+
11+
class AlipayAuthCreateSessionRequest(AlipayRequest):
12+
def __init__(self):
13+
super(AlipayAuthCreateSessionRequest, self).__init__(AntomPathConstants.CREATE_SESSION_PATH)
14+
self.__product_code = None # type:ProductCodeType
15+
self.__agreement_info = None # type:AgreementInfo
16+
self.__scopes = None # type:list[ScopeType]
17+
self.__payment_method = None # type:PaymentMethod
18+
self.__payment_redirect_url = None
19+
20+
@property
21+
def product_code(self):
22+
return self.__product_code
23+
24+
@product_code.setter
25+
def product_code(self, value: ProductCodeType):
26+
self.__product_code = value
27+
28+
@property
29+
def agreement_info(self):
30+
return self.__agreement_info
31+
32+
@agreement_info.setter
33+
def agreement_info(self, value: AgreementInfo):
34+
self.__agreement_info = value
35+
36+
@property
37+
def scopes(self):
38+
return self.__scopes
39+
40+
@scopes.setter
41+
def scopes(self, value: list[ScopeType]):
42+
self.__scopes = value
43+
44+
@property
45+
def payment_method(self):
46+
return self.__payment_method
47+
48+
@payment_method.setter
49+
def payment_method(self, value: PaymentMethod):
50+
self.__payment_method = value
51+
52+
@property
53+
def payment_redirect_url(self):
54+
return self.__payment_redirect_url
55+
56+
@payment_redirect_url.setter
57+
def payment_redirect_url(self, value: str):
58+
self.__payment_redirect_url = value
59+
60+
def to_ams_json(self):
61+
json_str = json.dumps(obj=self.__to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3)
62+
return json_str
63+
64+
def __to_ams_dict(self):
65+
params = dict()
66+
if hasattr(self, "product_code") and self.product_code:
67+
params['productCodeType'] = self.product_code
68+
69+
if hasattr(self, "agreement_info") and self.agreement_info:
70+
params['agreementInfo'] = self.agreement_info.to_ams_json()
71+
72+
if hasattr(self, "scopes") and self.scopes:
73+
scopes_list = []
74+
for scope in self.scopes:
75+
scopes_list.append(scope.value)
76+
params['scopes'] = scopes_list
77+
78+
if hasattr(self, "payment_method") and self.payment_method:
79+
params['paymentMethod'] = self.payment_method.to_ams_dict()
80+
81+
if hasattr(self, "payment_redirect_url") and self.payment_redirect_url:
82+
params['paymentRedirectUrl'] = self.payment_redirect_url
83+
84+
return params

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

Whitespace-only changes.

0 commit comments

Comments
 (0)