Skip to content

Commit 25a66d9

Browse files
committed
update-p2
- add MARKETPLACE - add vaulting - add Dispute - add risk - add Notify
1 parent 1e2f479 commit 25a66d9

File tree

97 files changed

+2523
-102
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+2523
-102
lines changed

CHANGELOG.md

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

33

4+
## 1.3.3 - 2024-09-04
5+
* [#14](https://github.com/alipay/global-open-sdk-python/pull/14) update-p2
6+
* add MARKETPLACE_demo
7+
* add MARKETPLACE
8+
* add vaulting
9+
* add Dispute
10+
* add risk
11+
* and add example
12+
* add Notify
13+
414
## 1.3.2 - 2024-09-04
515
* [#13](https://github.com/alipay/global-open-sdk-python/pull/13) add:ScopeType add TAOBAO_REBIND
616
* Add TAOBAO_REBIND

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Copyright:Ant financial services group
1212
alipay_pay_request.path = "/ams/sandbox/api/v1/payments/pay"
1313
1414
alipay_pay_request.product_code = ProductCodeType.AGREEMENT_PAYMENT
15-
alipay_pay_request.payment_notify_url = "https://www.merchant.com/notify"
16-
alipay_pay_request.payment_redirect_url = "https://www.merchant.com?param1=sl"
15+
alipay_pay_request.payment_notify_url = "https://www.yourNotifyUrl.com/notify"
16+
alipay_pay_request.payment_redirect_url = "https://www.yourRedirectUrl.com?param1=sl"
1717
alipay_pay_request.payment_request_id = "pay_python_test"
1818
1919
payment_method = PaymentMethod()
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import json
2+
3+
from com.alipay.ams.api.model.amount import Amount
4+
5+
6+
class AccountBalance:
7+
def __init__(self):
8+
self.__account_balance = None
9+
self.__currency = None
10+
self.__available_balance = None #type: Amount
11+
self.__frozen_balance = None #type: Amount
12+
self.__total_balance = None #type: Amount
13+
14+
@property
15+
def account_balance(self):
16+
return self.__account_balance
17+
@property
18+
def currency(self):
19+
return self.__currency
20+
21+
@property
22+
def available_balance(self):
23+
return self.__available_balance
24+
25+
@property
26+
def frozen_balance(self):
27+
return self.__frozen_balance
28+
29+
@property
30+
def total_balance(self):
31+
return self.__total_balance
32+
33+
def parse_rsp_body(self, response_body):
34+
if type(response_body) == str:
35+
response_body = json.loads(response_body)
36+
37+
if 'accountBalance' in response_body:
38+
self.__account_balance = response_body['accountBalance']
39+
if 'currency' in response_body:
40+
self.__currency = response_body['currency']
41+
if 'availableBalance' in response_body:
42+
self.__available_balance = Amount()
43+
self.__available_balance.parse_rsp_body(response_body['availableBalance'])
44+
if 'frozenBalance' in response_body:
45+
self.__frozen_balance = Amount()
46+
self.__frozen_balance.parse_rsp_body(response_body['frozenBalance'])
47+
if 'totalBalance' in response_body:
48+
self.__total_balance = Amount()
49+
self.__total_balance.parse_rsp_body(response_body['totalBalance'])
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
from enum import Enum
2+
3+
class AntomPathConstants(Enum):
4+
"""
5+
Ant Group
6+
Copyright (c) 2004-2024 All Rights Reserved.
7+
"""
8+
AUTH_CONSULT_PATH = "/ams/api/v1/authorizations/consult"
9+
AUTH_APPLY_TOKEN_PATH = "/ams/api/v1/authorizations/applyToken"
10+
AUTH_REVOKE_PATH = "/ams/api/v1/authorizations/revoke"
11+
AUTH_QUERY_PATH = "/ams/api/v1/authorizations/query"
12+
13+
CREATE_VAULTING_SESSION_PATH = "/ams/api/v1/vaults/createVaultingSession"
14+
VAULT_PAYMENT_METHOD_PATH = "/ams/api/v1/vaults/vaultPaymentMethod"
15+
INQUIRE_VAULTING_PATH = "/ams/api/v1/vaults/inquireVaulting"
16+
17+
CONSULT_PAYMENT_PATH = "/ams/api/v1/payments/consult"
18+
PAYMENT_PATH = "/ams/api/v1/payments/pay"
19+
CREATE_SESSION_PATH = "/ams/api/v1/payments/createPaymentSession"
20+
CAPTURE_PATH = "/ams/api/v1/payments/capture"
21+
INQUIRY_PAYMENT_PATH = "/ams/api/v1/payments/inquiryPayment"
22+
CANCEL_PATH = "/ams/api/v1/payments/cancel"
23+
SYNC_ARREAR_PATH = "/ams/api/v1/payments/syncArrear"
24+
CREATE_DEVICE_CERTIFICATE_PATH = "/ams/api/v1/payments/createDeviceCertificate"
25+
26+
SUBSCRIPTION_CREATE_PATH = "/ams/api/v1/subscriptions/create"
27+
SUBSCRIPTION_CHANGE_PATH = "/ams/api/v1/subscriptions/change"
28+
SUBSCRIPTION_CANCEL_PATH = "/ams/api/v1/subscriptions/cancel"
29+
30+
ACCEPT_DISPUTE_PATH = "/ams/api/v1/payments/acceptDispute"
31+
SUPPLY_DEFENCE_DOC_PATH = "/ams/api/v1/payments/supplyDefenseDocument"
32+
DOWNLOAD_DISPUTE_EVIDENCE_PATH = "/ams/api/v1/payments/downloadDisputeEvidence"
33+
34+
REFUND_PATH = "/ams/api/v1/payments/refund"
35+
INQUIRY_REFUND_PATH = "/ams/api/v1/payments/inquiryRefund"
36+
37+
DECLARE_PATH = "/ams/api/v1/customs/declare"
38+
INQUIRY_DECLARE_PATH = "/ams/api/v1/customs/inquiryDeclarationRequests"
39+
40+
MARKETPLACE_SUBMITATTACHMENT_PATH = "/ams/api/open/openapiv2_file/v1/business/attachment/submitAttachment"
41+
MARKETPLACE_REGISTER_PATH = "/ams/api/v1/merchants/register"
42+
MARKETPLACE_SETTLEMENTINFO_UPDATE_PATH = "/ams/api/v1/merchants/settlementInfo/update"
43+
MARKETPLACE_INQUIREBALANCE_PATH = "/ams/api/v1/accounts/inquireBalance"
44+
MARKETPLACE_SETTLE_PATH = "/ams/api/v1/payments/settle"
45+
MARKETPLACE_CREATEPAYOUT_PATH = "/ams/api/v1/funds/createPayout"
46+
MARKETPLACE_CREATETRANSFER_PATH = "/ams/api/v1/funds/createTransfer"
47+
48+
RISK_DECIDE_PATH = "/ams/api/v1/risk/payments/decide"
49+
RISK_REPORT_PATH = "/ams/api/v1/risk/payments/reportRisk"
50+
RISK_SEND_PAYMENT_RESULT_PATH = "/ams/api/v1/risk/payments/sendPaymentResult"
51+
RISK_SEND_REFUND_RESULT_PATH = "/ams/api/v1/risk/payments/sendRefundResult"
52+
53+
MERCHANTS_INQUIRY_REGISTRATION_PATH ="/ams/api/v1/merchants/inquiryRegistrationInfo"
54+
MERCHANTS_REGISTRATION_PATH = "/ams/api/v1/merchants/registration"
55+
MERCHANTS_INQUIRY_REGISTRATION_STATUS_PATH = "/ams/api/v1/merchants/inquiryRegistrationStatus"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
class AuthorizationError:
3+
def __init__(self):
4+
self.__error_code = None
5+
self.__error_message = None
6+
7+
@property
8+
def error_code(self):
9+
return self.__error_code
10+
@error_code.setter
11+
def error_code(self, value):
12+
self.__error_code = value
13+
@property
14+
def error_message(self):
15+
return self.__error_message
16+
@error_message.setter
17+
def error_message(self, value):
18+
self.__error_message = value
19+
20+
def to_ams_dict(self):
21+
params = dict()
22+
if self.error_code is not None:
23+
params['errorCode'] = self.error_code
24+
if self.error_message is not None:
25+
params['errorMessage'] = self.error_message
26+
return params
27+
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 AuthorizationPhase(Enum):
6+
PRE_AUTHORIZATION = "PRE_AUTHORIZATION"
7+
POST_AUTHORIZATION = "POST_AUTHORIZATION"
8+
9+
def to_ams_dict(self):
10+
return self.name

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
class BusinessInfo:
5-
def __int__(self):
5+
def __init__(self):
66
self.__mcc = None
77
self.__websites = None #type: list[WebSite]
88
self.__englishName = None

0 commit comments

Comments
 (0)