global-open-sdk-python 1.7.0__py3-none-any.whl → 1.7.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. com/alipay/ams/api/_version.py +1 -1
  2. com/alipay/ams/api/model/account_holder_type.py +8 -1
  3. com/alipay/ams/api/model/account_type.py +8 -1
  4. com/alipay/ams/api/model/acquirer_info.py +15 -0
  5. com/alipay/ams/api/model/ams_inquiry_payment_result.py +151 -0
  6. com/alipay/ams/api/model/association_type.py +12 -1
  7. com/alipay/ams/api/model/attachment_type.py +22 -1
  8. com/alipay/ams/api/model/batch_payment_transaction.py +116 -0
  9. com/alipay/ams/api/model/buyer.py +3 -3
  10. com/alipay/ams/api/model/buyer_tax_id.py +1 -1
  11. com/alipay/ams/api/model/card_brand.py +43 -1
  12. com/alipay/ams/api/model/card_transaction_event.py +30 -0
  13. com/alipay/ams/api/model/card_transaction_event_filter_type.py +12 -1
  14. com/alipay/ams/api/model/card_transaction_lifecycle.py +15 -0
  15. com/alipay/ams/api/model/card_transaction_lifecycle_detail.py +15 -0
  16. com/alipay/ams/api/model/card_transaction_status_filter_type.py +9 -1
  17. com/alipay/ams/api/model/certificate_type.py +13 -1
  18. com/alipay/ams/api/model/challenge_trigger_source_type.py +8 -1
  19. com/alipay/ams/api/model/challenge_type.py +9 -1
  20. com/alipay/ams/api/model/class_type.py +9 -1
  21. com/alipay/ams/api/model/code_value_type.py +8 -1
  22. com/alipay/ams/api/model/company_type.py +18 -1
  23. com/alipay/ams/api/model/company_unit_type.py +8 -1
  24. com/alipay/ams/api/model/contact_type.py +9 -1
  25. com/alipay/ams/api/model/credit_pay_fee_type.py +7 -1
  26. com/alipay/ams/api/model/customer_belongs_to.py +36 -1
  27. com/alipay/ams/api/model/declaration_biz_scene_type.py +8 -1
  28. com/alipay/ams/api/model/display_type.py +11 -1
  29. com/alipay/ams/api/model/dispute_defense_file.py +34 -0
  30. com/alipay/ams/api/model/dispute_evidence_format_type.py +16 -1
  31. com/alipay/ams/api/model/dispute_evidence_recommendation.py +34 -0
  32. com/alipay/ams/api/model/dispute_evidence_result.py +82 -0
  33. com/alipay/ams/api/model/dispute_evidence_type.py +12 -1
  34. com/alipay/ams/api/model/fund_transfer_info.py +101 -0
  35. com/alipay/ams/api/model/fund_transfer_party_address.py +82 -0
  36. com/alipay/ams/api/model/fund_transfer_party_name.py +52 -0
  37. com/alipay/ams/api/model/fund_transfer_recipient.py +71 -0
  38. com/alipay/ams/api/model/fund_transfer_sender.py +56 -0
  39. com/alipay/ams/api/model/funding_type.py +11 -1
  40. com/alipay/ams/api/model/funds_type.py +7 -1
  41. com/alipay/ams/api/model/grant_type.py +8 -1
  42. com/alipay/ams/api/model/in_store_payment_scenario.py +9 -1
  43. com/alipay/ams/api/model/interaction_type.py +13 -1
  44. com/alipay/ams/api/model/invoice_customer_details.py +6 -6
  45. com/alipay/ams/api/model/legal_entity_type.py +8 -1
  46. com/alipay/ams/api/model/merchant_type.py +8 -1
  47. com/alipay/ams/api/model/notification_event.py +112 -0
  48. com/alipay/ams/api/model/order.py +1 -1
  49. com/alipay/ams/api/model/os_type.py +8 -1
  50. com/alipay/ams/api/model/passenger_id_type.py +15 -1
  51. com/alipay/ams/api/model/payment_method_category_type.py +14 -1
  52. com/alipay/ams/api/model/payment_method_detail_type.py +10 -1
  53. com/alipay/ams/api/model/payment_method_scope.py +8 -1
  54. com/alipay/ams/api/model/payment_status.py +8 -1
  55. com/alipay/ams/api/model/period_type.py +12 -1
  56. com/alipay/ams/api/model/presentment_mode.py +9 -1
  57. com/alipay/ams/api/model/product_code_type.py +9 -1
  58. com/alipay/ams/api/model/promotion_type.py +8 -1
  59. com/alipay/ams/api/model/rate_type.py +9 -1
  60. com/alipay/ams/api/model/refund_from_type.py +9 -1
  61. com/alipay/ams/api/model/release_type.py +8 -1
  62. com/alipay/ams/api/model/result_status_type.py +9 -1
  63. com/alipay/ams/api/model/rule_status.py +8 -1
  64. com/alipay/ams/api/model/scope_type.py +13 -1
  65. com/alipay/ams/api/model/settle_to_type.py +8 -1
  66. com/alipay/ams/api/model/subscription_status.py +9 -1
  67. com/alipay/ams/api/model/take_type.py +7 -1
  68. com/alipay/ams/api/model/terminal_type.py +10 -1
  69. com/alipay/ams/api/model/transaction_status_type.py +11 -1
  70. com/alipay/ams/api/model/transaction_type.py +13 -1
  71. com/alipay/ams/api/model/transit_type.py +10 -1
  72. com/alipay/ams/api/net/default_http_rpc.py +1 -1
  73. com/alipay/ams/api/request/dispute/alipay_supply_defense_document_request.py +1 -1
  74. com/alipay/ams/api/request/dispute/alipay_supply_evidence_request.py +57 -0
  75. com/alipay/ams/api/request/notification/__init__.py +0 -0
  76. com/alipay/ams/api/request/notification/alipay_inquire_notification_list_request.py +102 -0
  77. com/alipay/ams/api/request/notification/alipay_inquire_notification_request.py +42 -0
  78. com/alipay/ams/api/request/notify/alipay_defense_document_notify.py +60 -0
  79. com/alipay/ams/api/request/notify/alipay_defense_strategy_suggestion_notify.py +63 -0
  80. com/alipay/ams/api/request/pay/alipay_inquire_batch_payment_request.py +42 -0
  81. com/alipay/ams/api/request/pay/alipay_pay_request.py +17 -0
  82. com/alipay/ams/api/request/pay/alipay_payment_session_request.py +17 -0
  83. com/alipay/ams/api/response/dispute/alipay_download_dispute_evidence_response.py +1 -1
  84. com/alipay/ams/api/response/dispute/alipay_supply_evidence_response.py +76 -0
  85. com/alipay/ams/api/response/notification/__init__.py +0 -0
  86. com/alipay/ams/api/response/notification/alipay_inquire_notification_list_response.py +91 -0
  87. com/alipay/ams/api/response/notification/alipay_inquire_notification_response.py +58 -0
  88. com/alipay/ams/api/response/pay/alipay_capture_response.py +17 -0
  89. com/alipay/ams/api/response/pay/alipay_inquire_batch_payment_response.py +204 -0
  90. com/alipay/ams/api/response/pay/ams_api_v1_payments_capture_post200_response.py +17 -0
  91. {global_open_sdk_python-1.7.0.dist-info → global_open_sdk_python-1.7.2.dist-info}/METADATA +3 -9
  92. {global_open_sdk_python-1.7.0.dist-info → global_open_sdk_python-1.7.2.dist-info}/RECORD +95 -72
  93. {global_open_sdk_python-1.7.0.dist-info → global_open_sdk_python-1.7.2.dist-info}/WHEEL +1 -1
  94. {global_open_sdk_python-1.7.0.dist-info → global_open_sdk_python-1.7.2.dist-info}/licenses/LICENSE +0 -0
  95. {global_open_sdk_python-1.7.0.dist-info → global_open_sdk_python-1.7.2.dist-info}/top_level.txt +0 -0
@@ -1,2 +1,2 @@
1
- VERSION = "1.7.0"
1
+ VERSION = "1.7.2"
2
2
  USER_AGENT = "global-open-sdk-python/" + VERSION
@@ -7,7 +7,10 @@ class AccountHolderType(Enum):
7
7
  ENTERPRISE = "ENTERPRISE"
8
8
 
9
9
  def to_ams_dict(self) -> str:
10
- return self.name
10
+ return {
11
+ "INDIVIDUAL": "INDIVIDUAL",
12
+ "ENTERPRISE": "ENTERPRISE",
13
+ }[self.name]
11
14
 
12
15
  @staticmethod
13
16
  def value_of(value):
@@ -18,4 +21,8 @@ class AccountHolderType(Enum):
18
21
  return AccountHolderType.INDIVIDUAL
19
22
  if AccountHolderType.ENTERPRISE.value == value:
20
23
  return AccountHolderType.ENTERPRISE
24
+ for member in AccountHolderType:
25
+ if member.to_ams_dict() == value:
26
+ return member
21
27
  return None
28
+
@@ -7,7 +7,10 @@ class AccountType(Enum):
7
7
  FIXED_DEPOSIT = "FIXED_DEPOSIT"
8
8
 
9
9
  def to_ams_dict(self) -> str:
10
- return self.name
10
+ return {
11
+ "CHECKING": "CHECKING",
12
+ "FIXED_DEPOSIT": "FIXED_DEPOSIT",
13
+ }[self.name]
11
14
 
12
15
  @staticmethod
13
16
  def value_of(value):
@@ -18,4 +21,8 @@ class AccountType(Enum):
18
21
  return AccountType.CHECKING
19
22
  if AccountType.FIXED_DEPOSIT.value == value:
20
23
  return AccountType.FIXED_DEPOSIT
24
+ for member in AccountType:
25
+ if member.to_ams_dict() == value:
26
+ return member
21
27
  return None
28
+
@@ -17,6 +17,7 @@ class AcquirerInfo:
17
17
  self.__ptsp_transaction_id = None # type: str
18
18
  self.__acquirer_card_token = None # type: str
19
19
  self.__acquirer_fingerprint = None # type: str
20
+ self.__acquirer_account_name = None # type: str
20
21
 
21
22
 
22
23
  @property
@@ -129,6 +130,16 @@ class AcquirerInfo:
129
130
  @acquirer_fingerprint.setter
130
131
  def acquirer_fingerprint(self, value):
131
132
  self.__acquirer_fingerprint = value
133
+ @property
134
+ def acquirer_account_name(self):
135
+ """
136
+ The name of the acquiring merchant account configured in the Antom portal. More information: Maximum length: 255 characters
137
+ """
138
+ return self.__acquirer_account_name
139
+
140
+ @acquirer_account_name.setter
141
+ def acquirer_account_name(self, value):
142
+ self.__acquirer_account_name = value
132
143
 
133
144
 
134
145
 
@@ -157,6 +168,8 @@ class AcquirerInfo:
157
168
  params['acquirerCardToken'] = self.acquirer_card_token
158
169
  if hasattr(self, "acquirer_fingerprint") and self.acquirer_fingerprint is not None:
159
170
  params['acquirerFingerprint'] = self.acquirer_fingerprint
171
+ if hasattr(self, "acquirer_account_name") and self.acquirer_account_name is not None:
172
+ params['acquirerAccountName'] = self.acquirer_account_name
160
173
  return params
161
174
 
162
175
 
@@ -185,3 +198,5 @@ class AcquirerInfo:
185
198
  self.__acquirer_card_token = response_body['acquirerCardToken']
186
199
  if 'acquirerFingerprint' in response_body:
187
200
  self.__acquirer_fingerprint = response_body['acquirerFingerprint']
201
+ if 'acquirerAccountName' in response_body:
202
+ self.__acquirer_account_name = response_body['acquirerAccountName']
@@ -0,0 +1,151 @@
1
+ import json
2
+ from com.alipay.ams.api.model.amount import Amount
3
+ from com.alipay.ams.api.model.payment_result_info import PaymentResultInfo
4
+ from com.alipay.ams.api.model.batch_payment_transaction import BatchPaymentTransaction
5
+
6
+
7
+
8
+
9
+ class AmsInquiryPaymentResult:
10
+ def __init__(self):
11
+
12
+ self.__payment_request_id = None # type: str
13
+ self.__payment_id = None # type: str
14
+ self.__payment_amount = None # type: Amount
15
+ self.__payment_status = None # type: str
16
+ self.__payment_result_code = None # type: str
17
+ self.__payment_result_message = None # type: str
18
+ self.__payment_result_info = None # type: PaymentResultInfo
19
+ self.__transactions = None # type: [BatchPaymentTransaction]
20
+
21
+
22
+ @property
23
+ def payment_request_id(self):
24
+ """
25
+ Merchant-assigned sub-order payment request ID (maximum 64 characters).
26
+ """
27
+ return self.__payment_request_id
28
+
29
+ @payment_request_id.setter
30
+ def payment_request_id(self, value):
31
+ self.__payment_request_id = value
32
+ @property
33
+ def payment_id(self):
34
+ """
35
+ Antom-assigned sub-order payment ID (maximum 64 characters).
36
+ """
37
+ return self.__payment_id
38
+
39
+ @payment_id.setter
40
+ def payment_id(self, value):
41
+ self.__payment_id = value
42
+ @property
43
+ def payment_amount(self):
44
+ """Gets the payment_amount of this AmsInquiryPaymentResult.
45
+
46
+ """
47
+ return self.__payment_amount
48
+
49
+ @payment_amount.setter
50
+ def payment_amount(self, value):
51
+ self.__payment_amount = value
52
+ @property
53
+ def payment_status(self):
54
+ """
55
+ Payment status (maximum 16 characters), returned on successful inquiry. SUCCESS: succeeded; FAIL: failed; PROCESSING: processing; CANCELLED: canceled; PENDING: payment complete, final result pending. SUCCESS, FAIL and CANCELLED are final; PROCESSING and PENDING are intermediate. Every sub-order in a batch shares the same payment status.
56
+ """
57
+ return self.__payment_status
58
+
59
+ @payment_status.setter
60
+ def payment_status(self, value):
61
+ self.__payment_status = value
62
+ @property
63
+ def payment_result_code(self):
64
+ """
65
+ Sub-order result code (maximum 64 characters), returned on successful inquiry. Applicable codes: SUCCESS (Payment succeeded); ACCESS_DENIED (Access denied); CURRENCY_NOT_SUPPORT (Currency not supported); FRAUD_REJECT (Risk control prevents further processing); INVALID_API (API invalid or inactive); INVALID_CARD (Invalid card); ORDER_NOT_EXIST (Order does not exist); INVALID_EXPIRY_DATE_FORMAT (Invalid card expiry year or month format); ISSUER_REJECTS_TRANSACTION (Issuer rejected transaction); INVALID_ACCESS_TOKEN (Access token expired, revoked, or absent); INVALID_MERCHANT_STATUS (Restricted merchant status); KEY_NOT_FOUND (Antom or merchant key not found); MERCHANT_KYB_NOT_QUALIFIED (Merchant KYB status disqualifies payment); NO_INTERFACE_DEF (Interface undefined); NO_PAY_OPTIONS (No payment options available); ORDER_IS_CLOSED (Payment request ID matches a closed transaction); PARAM_ILLEGAL (Missing or invalid parameter); PAYMENT_AMOUNT_EXCEED_LIMIT (Amount exceeds contract or payment method limit); PAYMENT_COUNT_EXCEED_LIMIT (Payment count exceeds payment method limit); PAYMENT_NOT_QUALIFIED (Merchant not eligible for payment); PROCESS_FAIL (General business failure); RISK_REJECT (Risk control prevents further processing); SUSPECTED_CARD (Card suspected of fraud); SUSPECTED_RISK (Suspected security risk prevents further processing); SYSTEM_ERROR (System error); USER_AMOUNT_EXCEED_LIMIT (Amount exceeds user payment limit); USER_BALANCE_NOT_ENOUGH (Insufficient user balance); USER_KYC_NOT_QUALIFIED (User KYC status disqualifies payment); USER_PAYMENT_VERIFICATION_FAILED (User restricted from payment at provider); USER_STATUS_ABNORMAL (User status abnormal at provider); PAYMENT_IN_PROCESS (Payment processing); UNKNOWN_EXCEPTION (API call failed for an unknown reason); CARD_NOT_SUPPORTED (Card not supported for transaction); INVALID_EXPIRATION_DATE (Invalid card expiration date); INVALID_CARD_NUMBER (Invalid card number); DO_NOT_HONOR (Issuer declined payment).
66
+ """
67
+ return self.__payment_result_code
68
+
69
+ @payment_result_code.setter
70
+ def payment_result_code(self, value):
71
+ self.__payment_result_code = value
72
+ @property
73
+ def payment_result_message(self):
74
+ """
75
+ Message explaining the sub-order result code (maximum 256 characters); returned on successful inquiry.
76
+ """
77
+ return self.__payment_result_message
78
+
79
+ @payment_result_message.setter
80
+ def payment_result_message(self, value):
81
+ self.__payment_result_message = value
82
+ @property
83
+ def payment_result_info(self):
84
+ """Gets the payment_result_info of this AmsInquiryPaymentResult.
85
+
86
+ """
87
+ return self.__payment_result_info
88
+
89
+ @payment_result_info.setter
90
+ def payment_result_info(self, value):
91
+ self.__payment_result_info = value
92
+ @property
93
+ def transactions(self):
94
+ """
95
+ Transaction details returned when a refund or capture exists.
96
+ """
97
+ return self.__transactions
98
+
99
+ @transactions.setter
100
+ def transactions(self, value):
101
+ self.__transactions = value
102
+
103
+
104
+
105
+
106
+ def to_ams_dict(self):
107
+ params = dict()
108
+ if hasattr(self, "payment_request_id") and self.payment_request_id is not None:
109
+ params['paymentRequestId'] = self.payment_request_id
110
+ if hasattr(self, "payment_id") and self.payment_id is not None:
111
+ params['paymentId'] = self.payment_id
112
+ if hasattr(self, "payment_amount") and self.payment_amount is not None:
113
+ params['paymentAmount'] = self.payment_amount
114
+ if hasattr(self, "payment_status") and self.payment_status is not None:
115
+ params['paymentStatus'] = self.payment_status
116
+ if hasattr(self, "payment_result_code") and self.payment_result_code is not None:
117
+ params['paymentResultCode'] = self.payment_result_code
118
+ if hasattr(self, "payment_result_message") and self.payment_result_message is not None:
119
+ params['paymentResultMessage'] = self.payment_result_message
120
+ if hasattr(self, "payment_result_info") and self.payment_result_info is not None:
121
+ params['paymentResultInfo'] = self.payment_result_info
122
+ if hasattr(self, "transactions") and self.transactions is not None:
123
+ params['transactions'] = self.transactions
124
+ return params
125
+
126
+
127
+ def parse_rsp_body(self, response_body):
128
+ if isinstance(response_body, str):
129
+ response_body = json.loads(response_body)
130
+ if 'paymentRequestId' in response_body:
131
+ self.__payment_request_id = response_body['paymentRequestId']
132
+ if 'paymentId' in response_body:
133
+ self.__payment_id = response_body['paymentId']
134
+ if 'paymentAmount' in response_body:
135
+ self.__payment_amount = Amount()
136
+ self.__payment_amount.parse_rsp_body(response_body['paymentAmount'])
137
+ if 'paymentStatus' in response_body:
138
+ self.__payment_status = response_body['paymentStatus']
139
+ if 'paymentResultCode' in response_body:
140
+ self.__payment_result_code = response_body['paymentResultCode']
141
+ if 'paymentResultMessage' in response_body:
142
+ self.__payment_result_message = response_body['paymentResultMessage']
143
+ if 'paymentResultInfo' in response_body:
144
+ self.__payment_result_info = PaymentResultInfo()
145
+ self.__payment_result_info.parse_rsp_body(response_body['paymentResultInfo'])
146
+ if 'transactions' in response_body:
147
+ self.__transactions = []
148
+ for item in response_body['transactions']:
149
+ obj = BatchPaymentTransaction()
150
+ obj.parse_rsp_body(item)
151
+ self.__transactions.append(obj)
@@ -11,7 +11,14 @@ class AssociationType(Enum):
11
11
  BOARD_MEMBER = "BOARD_MEMBER"
12
12
 
13
13
  def to_ams_dict(self) -> str:
14
- return self.name
14
+ return {
15
+ "LEGAL_REPRESENTATIVE": "LEGAL_REPRESENTATIVE",
16
+ "UBO": "UBO",
17
+ "CONTACT": "CONTACT",
18
+ "DIRECTOR": "DIRECTOR",
19
+ "AUTHORIZER": "AUTHORIZER",
20
+ "BOARD_MEMBER": "BOARD_MEMBER",
21
+ }[self.name]
15
22
 
16
23
  @staticmethod
17
24
  def value_of(value):
@@ -30,4 +37,8 @@ class AssociationType(Enum):
30
37
  return AssociationType.AUTHORIZER
31
38
  if AssociationType.BOARD_MEMBER.value == value:
32
39
  return AssociationType.BOARD_MEMBER
40
+ for member in AssociationType:
41
+ if member.to_ams_dict() == value:
42
+ return member
33
43
  return None
44
+
@@ -21,7 +21,24 @@ class AttachmentType(Enum):
21
21
  CNPJ = "CNPJ"
22
22
 
23
23
  def to_ams_dict(self) -> str:
24
- return self.name
24
+ return {
25
+ "SIGNATURE_AUTHORIZATION_LETTER": "SIGNATURE_AUTHORIZATION_LETTER",
26
+ "ARTICLES_OF_ASSOCIATION": "ARTICLES_OF_ASSOCIATION",
27
+ "LOGO": "LOGO",
28
+ "AUTHORIZER_SIGNATURE_CONFIRMATION_LETTER": "AUTHORIZER_SIGNATURE_CONFIRMATION_LETTER",
29
+ "ASSOCIATION_ARTICLE": "ASSOCIATION_ARTICLE",
30
+ "FINANCIAL_REPORT": "FINANCIAL_REPORT",
31
+ "OWNERSHIP_STRUCTURE_PIC": "OWNERSHIP_STRUCTURE_PIC",
32
+ "ADDRESS_PROOF": "ADDRESS_PROOF",
33
+ "UBO_PROVE": "UBO_PROVE",
34
+ "ENTERPRISE_REGISTRATION": "ENTERPRISE_REGISTRATION",
35
+ "LICENSE_INFO": "LICENSE_INFO",
36
+ "ID_CARD": "ID_CARD",
37
+ "PASSPORT": "PASSPORT",
38
+ "DRIVING_LICENSE": "DRIVING_LICENSE",
39
+ "CPF": "CPF",
40
+ "CNPJ": "CNPJ",
41
+ }[self.name]
25
42
 
26
43
  @staticmethod
27
44
  def value_of(value):
@@ -60,4 +77,8 @@ class AttachmentType(Enum):
60
77
  return AttachmentType.CPF
61
78
  if AttachmentType.CNPJ.value == value:
62
79
  return AttachmentType.CNPJ
80
+ for member in AttachmentType:
81
+ if member.to_ams_dict() == value:
82
+ return member
63
83
  return None
84
+
@@ -0,0 +1,116 @@
1
+ import json
2
+ from com.alipay.ams.api.model.result import Result
3
+ from com.alipay.ams.api.model.amount import Amount
4
+
5
+
6
+
7
+
8
+ class BatchPaymentTransaction:
9
+ def __init__(self):
10
+
11
+ self.__transaction_result = None # type: Result
12
+ self.__transaction_id = None # type: str
13
+ self.__transaction_type = None # type: str
14
+ self.__transaction_status = None # type: str
15
+ self.__transaction_amount = None # type: Amount
16
+ self.__transaction_request_id = None # type: str
17
+
18
+
19
+ @property
20
+ def transaction_result(self):
21
+ """Gets the transaction_result of this BatchPaymentTransaction.
22
+
23
+ """
24
+ return self.__transaction_result
25
+
26
+ @transaction_result.setter
27
+ def transaction_result(self, value):
28
+ self.__transaction_result = value
29
+ @property
30
+ def transaction_id(self):
31
+ """
32
+ Antom-assigned transaction ID (maximum 64 characters); equals refundId for REFUND and captureId for CAPTURE.
33
+ """
34
+ return self.__transaction_id
35
+
36
+ @transaction_id.setter
37
+ def transaction_id(self, value):
38
+ self.__transaction_id = value
39
+ @property
40
+ def transaction_type(self):
41
+ """
42
+ Transaction type (maximum 16 characters). REFUND: refund; CAPTURE: capture; INCREMENTAL: incremental amount adjustment.
43
+ """
44
+ return self.__transaction_type
45
+
46
+ @transaction_type.setter
47
+ def transaction_type(self, value):
48
+ self.__transaction_type = value
49
+ @property
50
+ def transaction_status(self):
51
+ """
52
+ Transaction status (maximum 16 characters). SUCCESS: succeeded; FAIL: failed; PROCESSING: processing; CANCELLED: canceled.
53
+ """
54
+ return self.__transaction_status
55
+
56
+ @transaction_status.setter
57
+ def transaction_status(self, value):
58
+ self.__transaction_status = value
59
+ @property
60
+ def transaction_amount(self):
61
+ """Gets the transaction_amount of this BatchPaymentTransaction.
62
+
63
+ """
64
+ return self.__transaction_amount
65
+
66
+ @transaction_amount.setter
67
+ def transaction_amount(self, value):
68
+ self.__transaction_amount = value
69
+ @property
70
+ def transaction_request_id(self):
71
+ """
72
+ Merchant-assigned transaction request ID (maximum 64 characters); equals refundRequestId for REFUND and captureRequestId for CAPTURE.
73
+ """
74
+ return self.__transaction_request_id
75
+
76
+ @transaction_request_id.setter
77
+ def transaction_request_id(self, value):
78
+ self.__transaction_request_id = value
79
+
80
+
81
+
82
+
83
+ def to_ams_dict(self):
84
+ params = dict()
85
+ if hasattr(self, "transaction_result") and self.transaction_result is not None:
86
+ params['transactionResult'] = self.transaction_result
87
+ if hasattr(self, "transaction_id") and self.transaction_id is not None:
88
+ params['transactionId'] = self.transaction_id
89
+ if hasattr(self, "transaction_type") and self.transaction_type is not None:
90
+ params['transactionType'] = self.transaction_type
91
+ if hasattr(self, "transaction_status") and self.transaction_status is not None:
92
+ params['transactionStatus'] = self.transaction_status
93
+ if hasattr(self, "transaction_amount") and self.transaction_amount is not None:
94
+ params['transactionAmount'] = self.transaction_amount
95
+ if hasattr(self, "transaction_request_id") and self.transaction_request_id is not None:
96
+ params['transactionRequestId'] = self.transaction_request_id
97
+ return params
98
+
99
+
100
+ def parse_rsp_body(self, response_body):
101
+ if isinstance(response_body, str):
102
+ response_body = json.loads(response_body)
103
+ if 'transactionResult' in response_body:
104
+ self.__transaction_result = Result()
105
+ self.__transaction_result.parse_rsp_body(response_body['transactionResult'])
106
+ if 'transactionId' in response_body:
107
+ self.__transaction_id = response_body['transactionId']
108
+ if 'transactionType' in response_body:
109
+ self.__transaction_type = response_body['transactionType']
110
+ if 'transactionStatus' in response_body:
111
+ self.__transaction_status = response_body['transactionStatus']
112
+ if 'transactionAmount' in response_body:
113
+ self.__transaction_amount = Amount()
114
+ self.__transaction_amount.parse_rsp_body(response_body['transactionAmount'])
115
+ if 'transactionRequestId' in response_body:
116
+ self.__transaction_request_id = response_body['transactionRequestId']
@@ -10,7 +10,7 @@ from com.alipay.ams.api.model.address import Address
10
10
  class Buyer:
11
11
  def __init__(self):
12
12
 
13
- self.__preferred_locales = None # type: str
13
+ self.__preferred_locales = None # type: [str]
14
14
  self.__business_name = None # type: str
15
15
  self.__buyer_type = None # type: str
16
16
  self.__reference_buyer_id = None # type: str
@@ -31,7 +31,7 @@ class Buyer:
31
31
  @property
32
32
  def preferred_locales(self):
33
33
  """
34
- Comma-separated invoice and offline receipt PDF locales for createPaymentSession, such as ja-JP,en-US. First supported locale wins, with English fallback. Does not select email language. Omit in APIs that do not document support.
34
+ Ordered PDF-language preferences for createPaymentSession. Omitted, null, empty or unsupported preferences use English. Does not read or update customer preferences or select Checkout UI or email language. Omit in APIs that do not document support.
35
35
  """
36
36
  return self.__preferred_locales
37
37
 
@@ -91,7 +91,7 @@ class Buyer:
91
91
  @property
92
92
  def buyer_email(self):
93
93
  """
94
- The email of the buyer. Specify this parameter: When you require risk control. When the value of paymentMethodType is CARD. Providing this information helps to increase the accuracy of anti-money laundering and fraud detection, and increase payment success rates. More information: Maximum length: 64 characters For the DingTalk createPaymentSession integration, a valid buyer email is required and the maximum length is 128 characters.
94
+ The email of the buyer. Specify this parameter: When you require risk control. When the value of paymentMethodType is CARD. Providing this information helps to increase the accuracy of anti-money laundering and fraud detection, and increase payment success rates. More information: Maximum length: 64 characters
95
95
  """
96
96
  return self.__buyer_email
97
97
 
@@ -24,7 +24,7 @@ class BuyerTaxId:
24
24
  @property
25
25
  def region(self):
26
26
  """
27
- Optional ISO 3166-2 issuing state or province subdivision code. Maximum length: 10 characters.
27
+ Optional tax ID subdivision information. The accepted format and length depend on the API. The supplied value is transmitted unchanged.
28
28
  """
29
29
  return self.__region
30
30
 
@@ -42,7 +42,45 @@ class CardBrand(Enum):
42
42
  WOORI = "WOORI"
43
43
 
44
44
  def to_ams_dict(self) -> str:
45
- return self.name
45
+ return {
46
+ "AMEX": "AMEX",
47
+ "BC": "BC",
48
+ "CARNET": "CARNET",
49
+ "CARTES_BANCAIRES": "CARTES_BANCAIRES",
50
+ "CITI": "CITI",
51
+ "CUP": "CUP",
52
+ "DINERS": "DINERS",
53
+ "DISCOVER": "DISCOVER",
54
+ "ELO": "ELO",
55
+ "GWANGJUBANK": "GWANGJUBANK",
56
+ "HIPERCARD": "HIPERCARD",
57
+ "HYUNDAI": "HYUNDAI",
58
+ "IBK_BC": "IBK_BC",
59
+ "JCB": "JCB",
60
+ "JEJUBANK": "JEJUBANK",
61
+ "JEONBUKBANK": "JEONBUKBANK",
62
+ "KAKAOBANK": "KAKAOBANK",
63
+ "KBANK": "KBANK",
64
+ "KDBBANK": "KDBBANK",
65
+ "KEBHANA": "KEBHANA",
66
+ "KOOKMIN": "KOOKMIN",
67
+ "LOTTE": "LOTTE",
68
+ "MAESTRO": "MAESTRO",
69
+ "MASTERCARD": "MASTERCARD",
70
+ "MIR": "MIR",
71
+ "NONGHYUP": "NONGHYUP",
72
+ "POST": "POST",
73
+ "SAEMAUL": "SAEMAUL",
74
+ "SAMSUNG": "SAMSUNG",
75
+ "SAVINGBANK": "SAVINGBANK",
76
+ "SHINHAN": "SHINHAN",
77
+ "SHINHYEOP": "SHINHYEOP",
78
+ "SUHYEOP": "SUHYEOP",
79
+ "TOSSBANK": "TOSSBANK",
80
+ "TROY": "TROY",
81
+ "VISA": "VISA",
82
+ "WOORI": "WOORI",
83
+ }[self.name]
46
84
 
47
85
  @staticmethod
48
86
  def value_of(value):
@@ -123,4 +161,8 @@ class CardBrand(Enum):
123
161
  return CardBrand.VISA
124
162
  if CardBrand.WOORI.value == value:
125
163
  return CardBrand.WOORI
164
+ for member in CardBrand:
165
+ if member.to_ams_dict() == value:
166
+ return member
126
167
  return None
168
+
@@ -14,6 +14,7 @@ class CardTransactionEvent:
14
14
  self.__lifecycle_id = None # type: str
15
15
  self.__event_type = None # type: str
16
16
  self.__auth_expire_time = None # type: str
17
+ self.__auth_time = None # type: str
17
18
  self.__auth_type = None # type: str
18
19
  self.__auth_code = None # type: str
19
20
  self.__failure_reason = None # type: str
@@ -27,6 +28,7 @@ class CardTransactionEvent:
27
28
  self.__exchange_rate = None # type: str
28
29
  self.__transaction_amount = None # type: Amount
29
30
  self.__asset_id = None # type: str
31
+ self.__card_product = None # type: str
30
32
  self.__masked_card_no = None # type: str
31
33
  self.__merchant_info = None # type: EventMerchantInfo
32
34
  self.__metadata = None # type: {str: (str,)}
@@ -73,6 +75,16 @@ class CardTransactionEvent:
73
75
  def auth_expire_time(self, value):
74
76
  self.__auth_expire_time = value
75
77
  @property
78
+ def auth_time(self):
79
+ """
80
+ The time of the channel-designated authorization associated with this event, in ISO 8601 format. Returned for eligible non-AUTH events when available.
81
+ """
82
+ return self.__auth_time
83
+
84
+ @auth_time.setter
85
+ def auth_time(self, value):
86
+ self.__auth_time = value
87
+ @property
76
88
  def auth_type(self):
77
89
  """
78
90
  The authorization type. Current values are AUTH and PRE_AUTH. Returned only for an AUTH event when available; consumers must preserve unknown future values.
@@ -203,6 +215,16 @@ class CardTransactionEvent:
203
215
  def asset_id(self, value):
204
216
  self.__asset_id = value
205
217
  @property
218
+ def card_product(self):
219
+ """
220
+ The product category of the card used for the transaction, such as Mastercard MTA or MTB. Returned when available; the value is passed through as provided and has no fixed code pattern.
221
+ """
222
+ return self.__card_product
223
+
224
+ @card_product.setter
225
+ def card_product(self, value):
226
+ self.__card_product = value
227
+ @property
206
228
  def masked_card_no(self):
207
229
  """
208
230
  The PCI-compliant masked card number. Returned when masking information is available.
@@ -246,6 +268,8 @@ class CardTransactionEvent:
246
268
  params['eventType'] = self.event_type
247
269
  if hasattr(self, "auth_expire_time") and self.auth_expire_time is not None:
248
270
  params['authExpireTime'] = self.auth_expire_time
271
+ if hasattr(self, "auth_time") and self.auth_time is not None:
272
+ params['authTime'] = self.auth_time
249
273
  if hasattr(self, "auth_type") and self.auth_type is not None:
250
274
  params['authType'] = self.auth_type
251
275
  if hasattr(self, "auth_code") and self.auth_code is not None:
@@ -272,6 +296,8 @@ class CardTransactionEvent:
272
296
  params['transactionAmount'] = self.transaction_amount
273
297
  if hasattr(self, "asset_id") and self.asset_id is not None:
274
298
  params['assetId'] = self.asset_id
299
+ if hasattr(self, "card_product") and self.card_product is not None:
300
+ params['cardProduct'] = self.card_product
275
301
  if hasattr(self, "masked_card_no") and self.masked_card_no is not None:
276
302
  params['maskedCardNo'] = self.masked_card_no
277
303
  if hasattr(self, "merchant_info") and self.merchant_info is not None:
@@ -292,6 +318,8 @@ class CardTransactionEvent:
292
318
  self.__event_type = response_body['eventType']
293
319
  if 'authExpireTime' in response_body:
294
320
  self.__auth_expire_time = response_body['authExpireTime']
321
+ if 'authTime' in response_body:
322
+ self.__auth_time = response_body['authTime']
295
323
  if 'authType' in response_body:
296
324
  self.__auth_type = response_body['authType']
297
325
  if 'authCode' in response_body:
@@ -321,6 +349,8 @@ class CardTransactionEvent:
321
349
  self.__transaction_amount.parse_rsp_body(response_body['transactionAmount'])
322
350
  if 'assetId' in response_body:
323
351
  self.__asset_id = response_body['assetId']
352
+ if 'cardProduct' in response_body:
353
+ self.__card_product = response_body['cardProduct']
324
354
  if 'maskedCardNo' in response_body:
325
355
  self.__masked_card_no = response_body['maskedCardNo']
326
356
  if 'merchantInfo' in response_body:
@@ -11,7 +11,14 @@ class CardTransactionEventFilterType(Enum):
11
11
  REPAYMENT = "REPAYMENT"
12
12
 
13
13
  def to_ams_dict(self) -> str:
14
- return self.name
14
+ return {
15
+ "AUTH": "AUTH",
16
+ "AUTH_CANCEL": "AUTH_CANCEL",
17
+ "CAPTURE": "CAPTURE",
18
+ "REFUND": "REFUND",
19
+ "CHARGEBACK": "CHARGEBACK",
20
+ "REPAYMENT": "REPAYMENT",
21
+ }[self.name]
15
22
 
16
23
  @staticmethod
17
24
  def value_of(value):
@@ -30,4 +37,8 @@ class CardTransactionEventFilterType(Enum):
30
37
  return CardTransactionEventFilterType.CHARGEBACK
31
38
  if CardTransactionEventFilterType.REPAYMENT.value == value:
32
39
  return CardTransactionEventFilterType.REPAYMENT
40
+ for member in CardTransactionEventFilterType:
41
+ if member.to_ams_dict() == value:
42
+ return member
33
43
  return None
44
+
@@ -22,6 +22,7 @@ class CardTransactionLifecycle:
22
22
  self.__total_refund_amount = None # type: Amount
23
23
  self.__total_chargeback_amount = None # type: Amount
24
24
  self.__asset_id = None # type: str
25
+ self.__card_product = None # type: str
25
26
  self.__masked_card_no = None # type: str
26
27
 
27
28
 
@@ -136,6 +137,16 @@ class CardTransactionLifecycle:
136
137
  def asset_id(self, value):
137
138
  self.__asset_id = value
138
139
  @property
140
+ def card_product(self):
141
+ """
142
+ The product category of the card used for the transaction, such as Mastercard MTA or MTB. Returned when available; the value is passed through as provided and has no fixed code pattern.
143
+ """
144
+ return self.__card_product
145
+
146
+ @card_product.setter
147
+ def card_product(self, value):
148
+ self.__card_product = value
149
+ @property
139
150
  def masked_card_no(self):
140
151
  """
141
152
  The PCI-compliant masked card number. Returned when masking information is available.
@@ -173,6 +184,8 @@ class CardTransactionLifecycle:
173
184
  params['totalChargebackAmount'] = self.total_chargeback_amount
174
185
  if hasattr(self, "asset_id") and self.asset_id is not None:
175
186
  params['assetId'] = self.asset_id
187
+ if hasattr(self, "card_product") and self.card_product is not None:
188
+ params['cardProduct'] = self.card_product
176
189
  if hasattr(self, "masked_card_no") and self.masked_card_no is not None:
177
190
  params['maskedCardNo'] = self.masked_card_no
178
191
  return params
@@ -208,5 +221,7 @@ class CardTransactionLifecycle:
208
221
  self.__total_chargeback_amount.parse_rsp_body(response_body['totalChargebackAmount'])
209
222
  if 'assetId' in response_body:
210
223
  self.__asset_id = response_body['assetId']
224
+ if 'cardProduct' in response_body:
225
+ self.__card_product = response_body['cardProduct']
211
226
  if 'maskedCardNo' in response_body:
212
227
  self.__masked_card_no = response_body['maskedCardNo']