global-open-sdk-python 1.6.2__py3-none-any.whl → 1.7.0__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 (45) hide show
  1. com/alipay/ams/api/_version.py +1 -1
  2. com/alipay/ams/api/model/address.py +15 -0
  3. com/alipay/ams/api/model/agentic_agent_info.py +82 -0
  4. com/alipay/ams/api/model/agentic_bound_payment_method.py +69 -0
  5. com/alipay/ams/api/model/agentic_bound_payment_method_detail.py +52 -0
  6. com/alipay/ams/api/model/agentic_decline_threshold.py +52 -0
  7. com/alipay/ams/api/model/agentic_mandate.py +71 -0
  8. com/alipay/ams/api/model/agentic_mandate_intent.py +136 -0
  9. com/alipay/ams/api/model/agentic_payment_method.py +67 -0
  10. com/alipay/ams/api/model/agentic_payment_token.py +127 -0
  11. com/alipay/ams/api/model/authorization_control.py +61 -1
  12. com/alipay/ams/api/model/automatic_tax.py +1 -1
  13. com/alipay/ams/api/model/buyer.py +47 -2
  14. com/alipay/ams/api/model/buyer_tax_id.py +1 -1
  15. com/alipay/ams/api/model/card_payment_method_detail.py +2 -2
  16. com/alipay/ams/api/model/customer_business_address.py +97 -0
  17. com/alipay/ams/api/model/invoice_create_item.py +48 -1
  18. com/alipay/ams/api/model/invoice_customer_details.py +149 -0
  19. com/alipay/ams/api/model/merchant.py +30 -0
  20. com/alipay/ams/api/model/order.py +47 -0
  21. com/alipay/ams/api/request/aba/alipay_create_exchange_request.py +17 -0
  22. com/alipay/ams/api/request/agentic/__init__.py +0 -0
  23. com/alipay/ams/api/request/agentic/alipay_create_authentication_session_request.py +185 -0
  24. com/alipay/ams/api/request/agentic/alipay_create_binding_session_request.py +185 -0
  25. com/alipay/ams/api/request/agentic/alipay_inquire_account_info_request.py +91 -0
  26. com/alipay/ams/api/request/agentic/alipay_inquire_payment_token_request.py +138 -0
  27. com/alipay/ams/api/request/billing/alipay_invoice_create_request.py +54 -5
  28. com/alipay/ams/api/request/notify/alipay_dispute_notify.py +14 -0
  29. com/alipay/ams/api/response/aba/alipay_inquire_card_sensitive_info_response.py +17 -0
  30. com/alipay/ams/api/response/agentic/__init__.py +0 -0
  31. com/alipay/ams/api/response/agentic/alipay_create_authentication_session_response.py +86 -0
  32. com/alipay/ams/api/response/agentic/alipay_create_binding_session_response.py +101 -0
  33. com/alipay/ams/api/response/agentic/alipay_inquire_account_info_response.py +61 -0
  34. com/alipay/ams/api/response/agentic/alipay_inquire_payment_token_response.py +58 -0
  35. com/alipay/ams/api/response/billing/alipay_invoice_create_response.py +3 -3
  36. com/alipay/ams/api/tools/__init__.py +3 -0
  37. com/alipay/ams/api/tools/_amount_rules.py +59 -0
  38. com/alipay/ams/api/tools/amount_util.py +96 -0
  39. com/alipay/ams/api/tools/resources/__init__.py +1 -0
  40. com/alipay/ams/api/tools/resources/amount-currency-rules.json +44 -0
  41. {global_open_sdk_python-1.6.2.dist-info → global_open_sdk_python-1.7.0.dist-info}/METADATA +1 -1
  42. {global_open_sdk_python-1.6.2.dist-info → global_open_sdk_python-1.7.0.dist-info}/RECORD +45 -21
  43. {global_open_sdk_python-1.6.2.dist-info → global_open_sdk_python-1.7.0.dist-info}/WHEEL +1 -1
  44. {global_open_sdk_python-1.6.2.dist-info → global_open_sdk_python-1.7.0.dist-info}/licenses/LICENSE +0 -0
  45. {global_open_sdk_python-1.6.2.dist-info → global_open_sdk_python-1.7.0.dist-info}/top_level.txt +0 -0
@@ -1,2 +1,2 @@
1
- VERSION = "1.6.2"
1
+ VERSION = "1.7.0"
2
2
  USER_AGENT = "global-open-sdk-python/" + VERSION
@@ -6,6 +6,7 @@ import json
6
6
  class Address:
7
7
  def __init__(self):
8
8
 
9
+ self.__country = None # type: str
9
10
  self.__region = None # type: str
10
11
  self.__state = None # type: str
11
12
  self.__city = None # type: str
@@ -16,6 +17,16 @@ class Address:
16
17
  self.__address3 = None # type: str
17
18
 
18
19
 
20
+ @property
21
+ def country(self):
22
+ """
23
+ Country code for createPaymentSession buyer.businessAddress. Required in the DingTalk integration; use region for other address contexts. ISO 3166-1 alpha-2.
24
+ """
25
+ return self.__country
26
+
27
+ @country.setter
28
+ def country(self, value):
29
+ self.__country = value
19
30
  @property
20
31
  def region(self):
21
32
  """
@@ -102,6 +113,8 @@ class Address:
102
113
 
103
114
  def to_ams_dict(self):
104
115
  params = dict()
116
+ if hasattr(self, "country") and self.country is not None:
117
+ params['country'] = self.country
105
118
  if hasattr(self, "region") and self.region is not None:
106
119
  params['region'] = self.region
107
120
  if hasattr(self, "state") and self.state is not None:
@@ -124,6 +137,8 @@ class Address:
124
137
  def parse_rsp_body(self, response_body):
125
138
  if isinstance(response_body, str):
126
139
  response_body = json.loads(response_body)
140
+ if 'country' in response_body:
141
+ self.__country = response_body['country']
127
142
  if 'region' in response_body:
128
143
  self.__region = response_body['region']
129
144
  if 'state' in response_body:
@@ -0,0 +1,82 @@
1
+ import json
2
+
3
+
4
+
5
+
6
+ class AgenticAgentInfo:
7
+ def __init__(self):
8
+
9
+ self.__agent_id = None # type: str
10
+ self.__agent_name = None # type: str
11
+ self.__agent_url = None # type: str
12
+ self.__agent_jwk = None # type: str
13
+
14
+
15
+ @property
16
+ def agent_id(self):
17
+ """
18
+ InquireAccountInfo: Stable business identifier of the current Agent. Together with the authenticated merchant and userId, it scopes the asset query. Must not be empty. CreateBindingSession: Agent identifier. CreateAuthenticationSession: Agent identifier. InquirePaymentToken: Agent identifier.
19
+ """
20
+ return self.__agent_id
21
+
22
+ @agent_id.setter
23
+ def agent_id(self, value):
24
+ self.__agent_id = value
25
+ @property
26
+ def agent_name(self):
27
+ """
28
+ CreateBindingSession: Application name. Required for applicable Visa card-binding/application-registration scenarios. CreateAuthenticationSession: Application name. Required for applicable Visa card-binding/application-registration scenarios. InquirePaymentToken: Application name.
29
+ """
30
+ return self.__agent_name
31
+
32
+ @agent_name.setter
33
+ def agent_name(self, value):
34
+ self.__agent_name = value
35
+ @property
36
+ def agent_url(self):
37
+ """
38
+ CreateBindingSession: Agent URL. CreateAuthenticationSession: Agent URL. Required for Mastercard AUTONOMOUS; maps to the L2 mandate Agent audience. InquirePaymentToken: Agent URL.
39
+ """
40
+ return self.__agent_url
41
+
42
+ @agent_url.setter
43
+ def agent_url(self, value):
44
+ self.__agent_url = value
45
+ @property
46
+ def agent_jwk(self):
47
+ """
48
+ Required only for Mastercard AUTONOMOUS. Base64URL-encoded UTF-8 public JWK JSON. Only EC/P-256 is supported; include kid, kty, crv, x and y. Private key parameter d is forbidden. Must not be empty when required.
49
+ """
50
+ return self.__agent_jwk
51
+
52
+ @agent_jwk.setter
53
+ def agent_jwk(self, value):
54
+ self.__agent_jwk = value
55
+
56
+
57
+
58
+
59
+ def to_ams_dict(self):
60
+ params = dict()
61
+ if hasattr(self, "agent_id") and self.agent_id is not None:
62
+ params['agentId'] = self.agent_id
63
+ if hasattr(self, "agent_name") and self.agent_name is not None:
64
+ params['agentName'] = self.agent_name
65
+ if hasattr(self, "agent_url") and self.agent_url is not None:
66
+ params['agentUrl'] = self.agent_url
67
+ if hasattr(self, "agent_jwk") and self.agent_jwk is not None:
68
+ params['agentJwk'] = self.agent_jwk
69
+ return params
70
+
71
+
72
+ def parse_rsp_body(self, response_body):
73
+ if isinstance(response_body, str):
74
+ response_body = json.loads(response_body)
75
+ if 'agentId' in response_body:
76
+ self.__agent_id = response_body['agentId']
77
+ if 'agentName' in response_body:
78
+ self.__agent_name = response_body['agentName']
79
+ if 'agentUrl' in response_body:
80
+ self.__agent_url = response_body['agentUrl']
81
+ if 'agentJwk' in response_body:
82
+ self.__agent_jwk = response_body['agentJwk']
@@ -0,0 +1,69 @@
1
+ import json
2
+ from com.alipay.ams.api.model.agentic_bound_payment_method_detail import AgenticBoundPaymentMethodDetail
3
+
4
+
5
+
6
+
7
+ class AgenticBoundPaymentMethod:
8
+ def __init__(self):
9
+
10
+ self.__payment_method_type = None # type: str
11
+ self.__payment_method_id = None # type: str
12
+ self.__payment_method_detail = None # type: AgenticBoundPaymentMethodDetail
13
+
14
+
15
+ @property
16
+ def payment_method_type(self):
17
+ """
18
+ Payment method type. The closed, case-sensitive values are CARD, AlipayCN, AlipayHK and MPay. Internal wallet names with underscores are not public values; unsupported values return PARAM_ILLEGAL/F. Supported values (case-sensitive): CARD, AlipayCN, AlipayHK, MPay.
19
+ """
20
+ return self.__payment_method_type
21
+
22
+ @payment_method_type.setter
23
+ def payment_method_type(self, value):
24
+ self.__payment_method_type = value
25
+ @property
26
+ def payment_method_id(self):
27
+ """
28
+ An opaque payment method reference returned by Antom for subsequent Agentic Payment calls. Do not parse it or depend on its format, lifetime or reuse count. This is not a payment credential or channel token.
29
+ """
30
+ return self.__payment_method_id
31
+
32
+ @payment_method_id.setter
33
+ def payment_method_id(self, value):
34
+ self.__payment_method_id = value
35
+ @property
36
+ def payment_method_detail(self):
37
+ """Gets the payment_method_detail of this AgenticBoundPaymentMethod.
38
+
39
+ """
40
+ return self.__payment_method_detail
41
+
42
+ @payment_method_detail.setter
43
+ def payment_method_detail(self, value):
44
+ self.__payment_method_detail = value
45
+
46
+
47
+
48
+
49
+ def to_ams_dict(self):
50
+ params = dict()
51
+ if hasattr(self, "payment_method_type") and self.payment_method_type is not None:
52
+ params['paymentMethodType'] = self.payment_method_type
53
+ if hasattr(self, "payment_method_id") and self.payment_method_id is not None:
54
+ params['paymentMethodId'] = self.payment_method_id
55
+ if hasattr(self, "payment_method_detail") and self.payment_method_detail is not None:
56
+ params['paymentMethodDetail'] = self.payment_method_detail
57
+ return params
58
+
59
+
60
+ def parse_rsp_body(self, response_body):
61
+ if isinstance(response_body, str):
62
+ response_body = json.loads(response_body)
63
+ if 'paymentMethodType' in response_body:
64
+ self.__payment_method_type = response_body['paymentMethodType']
65
+ if 'paymentMethodId' in response_body:
66
+ self.__payment_method_id = response_body['paymentMethodId']
67
+ if 'paymentMethodDetail' in response_body:
68
+ self.__payment_method_detail = AgenticBoundPaymentMethodDetail()
69
+ self.__payment_method_detail.parse_rsp_body(response_body['paymentMethodDetail'])
@@ -0,0 +1,52 @@
1
+ import json
2
+
3
+
4
+
5
+
6
+ class AgenticBoundPaymentMethodDetail:
7
+ def __init__(self):
8
+
9
+ self.__card_brand = None # type: str
10
+ self.__last_four = None # type: str
11
+
12
+
13
+ @property
14
+ def card_brand(self):
15
+ """
16
+ Controlled card-brand display value. Required for CARD; the closed, case-sensitive values are VISA and MASTERCARD. Other card brands are excluded from paymentMethods. APM wallet names are returned in paymentMethodType. Supported values (case-sensitive): VISA, MASTERCARD.
17
+ """
18
+ return self.__card_brand
19
+
20
+ @card_brand.setter
21
+ def card_brand(self, value):
22
+ self.__card_brand = value
23
+ @property
24
+ def last_four(self):
25
+ """
26
+ Masked last-four-character summary of the payment asset or account. Returned for CARD and the currently supported APM wallets.
27
+ """
28
+ return self.__last_four
29
+
30
+ @last_four.setter
31
+ def last_four(self, value):
32
+ self.__last_four = value
33
+
34
+
35
+
36
+
37
+ def to_ams_dict(self):
38
+ params = dict()
39
+ if hasattr(self, "card_brand") and self.card_brand is not None:
40
+ params['cardBrand'] = self.card_brand
41
+ if hasattr(self, "last_four") and self.last_four is not None:
42
+ params['lastFour'] = self.last_four
43
+ return params
44
+
45
+
46
+ def parse_rsp_body(self, response_body):
47
+ if isinstance(response_body, str):
48
+ response_body = json.loads(response_body)
49
+ if 'cardBrand' in response_body:
50
+ self.__card_brand = response_body['cardBrand']
51
+ if 'lastFour' in response_body:
52
+ self.__last_four = response_body['lastFour']
@@ -0,0 +1,52 @@
1
+ import json
2
+
3
+
4
+
5
+
6
+ class AgenticDeclineThreshold:
7
+ def __init__(self):
8
+
9
+ self.__currency = None # type: str
10
+ self.__value = None # type: str
11
+
12
+
13
+ @property
14
+ def currency(self):
15
+ """
16
+ Authorization currency, using an ISO 4217 three-letter code. Required when declineThreshold is present. Required for applicable A+ mandate authorization.
17
+ """
18
+ return self.__currency
19
+
20
+ @currency.setter
21
+ def currency(self, value):
22
+ self.__currency = value
23
+ @property
24
+ def value(self):
25
+ """
26
+ Authorized amount as a positive integer string in the smallest currency unit, paired with currency. Zero, fractions, negative signs, exponents and separators are not allowed. Required for applicable A+ mandate authorization.
27
+ """
28
+ return self.__value
29
+
30
+ @value.setter
31
+ def value(self, value):
32
+ self.__value = value
33
+
34
+
35
+
36
+
37
+ def to_ams_dict(self):
38
+ params = dict()
39
+ if hasattr(self, "currency") and self.currency is not None:
40
+ params['currency'] = self.currency
41
+ if hasattr(self, "value") and self.value is not None:
42
+ params['value'] = self.value
43
+ return params
44
+
45
+
46
+ def parse_rsp_body(self, response_body):
47
+ if isinstance(response_body, str):
48
+ response_body = json.loads(response_body)
49
+ if 'currency' in response_body:
50
+ self.__currency = response_body['currency']
51
+ if 'value' in response_body:
52
+ self.__value = response_body['value']
@@ -0,0 +1,71 @@
1
+ import json
2
+ from com.alipay.ams.api.model.agentic_mandate_intent import AgenticMandateIntent
3
+ from com.alipay.ams.api.model.order import Order
4
+
5
+
6
+
7
+
8
+ class AgenticMandate:
9
+ def __init__(self):
10
+
11
+ self.__mandate_id = None # type: str
12
+ self.__intent = None # type: AgenticMandateIntent
13
+ self.__order = None # type: Order
14
+
15
+
16
+ @property
17
+ def mandate_id(self):
18
+ """
19
+ CreateBindingSession: Caller-provided Antom mandate identifier. Required when authorizeOnBind=true and reused unchanged by inquirePaymentToken. Forbidden when authorizeOnBind=false. Not a channel mandate ID or an idempotency key. CreateAuthenticationSession: Non-empty caller-generated Antom mandate handle, unique within merchant, userId and agent.agentId scope. Reuse unchanged in inquirePaymentToken. Not a channel mandate ID or request idempotency key. Required for createAuthenticationSession; use the createBindingSession parameter table for that session scenario.
20
+ """
21
+ return self.__mandate_id
22
+
23
+ @mandate_id.setter
24
+ def mandate_id(self, value):
25
+ self.__mandate_id = value
26
+ @property
27
+ def intent(self):
28
+ """Gets the intent of this AgenticMandate.
29
+
30
+ """
31
+ return self.__intent
32
+
33
+ @intent.setter
34
+ def intent(self, value):
35
+ self.__intent = value
36
+ @property
37
+ def order(self):
38
+ """Gets the order of this AgenticMandate.
39
+
40
+ """
41
+ return self.__order
42
+
43
+ @order.setter
44
+ def order(self, value):
45
+ self.__order = value
46
+
47
+
48
+
49
+
50
+ def to_ams_dict(self):
51
+ params = dict()
52
+ if hasattr(self, "mandate_id") and self.mandate_id is not None:
53
+ params['mandateId'] = self.mandate_id
54
+ if hasattr(self, "intent") and self.intent is not None:
55
+ params['intent'] = self.intent
56
+ if hasattr(self, "order") and self.order is not None:
57
+ params['order'] = self.order
58
+ return params
59
+
60
+
61
+ def parse_rsp_body(self, response_body):
62
+ if isinstance(response_body, str):
63
+ response_body = json.loads(response_body)
64
+ if 'mandateId' in response_body:
65
+ self.__mandate_id = response_body['mandateId']
66
+ if 'intent' in response_body:
67
+ self.__intent = AgenticMandateIntent()
68
+ self.__intent.parse_rsp_body(response_body['intent'])
69
+ if 'order' in response_body:
70
+ self.__order = Order()
71
+ self.__order.parse_rsp_body(response_body['order'])
@@ -0,0 +1,136 @@
1
+ import json
2
+ from com.alipay.ams.api.model.agentic_decline_threshold import AgenticDeclineThreshold
3
+ from com.alipay.ams.api.model.merchant import Merchant
4
+ from com.alipay.ams.api.model.merchant import Merchant
5
+
6
+
7
+
8
+
9
+ class AgenticMandateIntent:
10
+ def __init__(self):
11
+
12
+ self.__decline_threshold = None # type: AgenticDeclineThreshold
13
+ self.__effective_from_time = None # type: str
14
+ self.__effective_until_time = None # type: str
15
+ self.__preferred_merchant = None # type: Merchant
16
+ self.__allowed_merchant = None # type: [Merchant]
17
+ self.__consumer_prompt = None # type: str
18
+ self.__intent_desc = None # type: str
19
+
20
+
21
+ @property
22
+ def decline_threshold(self):
23
+ """Gets the decline_threshold of this AgenticMandateIntent.
24
+
25
+ """
26
+ return self.__decline_threshold
27
+
28
+ @decline_threshold.setter
29
+ def decline_threshold(self, value):
30
+ self.__decline_threshold = value
31
+ @property
32
+ def effective_from_time(self):
33
+ """
34
+ Intent start time. Required for AUTONOMOUS authorization with recurrence or agent_recurrence time constraints. This does not imply support for purchaseType=RECURRING. Wire value is an RFC 3339 / ISO 8601 string with a timezone, up to 64 characters; it is not converted to a date object.
35
+ """
36
+ return self.__effective_from_time
37
+
38
+ @effective_from_time.setter
39
+ def effective_from_time(self, value):
40
+ self.__effective_from_time = value
41
+ @property
42
+ def effective_until_time(self):
43
+ """
44
+ CreateBindingSession: Intent expiration time. Must be later than the current time. Required for applicable A+ mandate bind-and-authorize scenarios. Wire value is an RFC 3339 / ISO 8601 string with a timezone, up to 64 characters; it is not converted to a date object. CreateAuthenticationSession: Intent expiration time. Must be later than the current time. Must also be later than effectiveFromTime. Required for applicable Visa and A+ mandate scenarios; for Mastercard recurrence it applies when the source authorization contains an end time. Wire value is an RFC 3339 / ISO 8601 string with a timezone, up to 64 characters; it is not converted to a date object.
45
+ """
46
+ return self.__effective_until_time
47
+
48
+ @effective_until_time.setter
49
+ def effective_until_time(self, value):
50
+ self.__effective_until_time = value
51
+ @property
52
+ def preferred_merchant(self):
53
+ """Gets the preferred_merchant of this AgenticMandateIntent.
54
+
55
+ """
56
+ return self.__preferred_merchant
57
+
58
+ @preferred_merchant.setter
59
+ def preferred_merchant(self, value):
60
+ self.__preferred_merchant = value
61
+ @property
62
+ def allowed_merchant(self):
63
+ """
64
+ Allowed merchants for autonomous authorization. Must not be an empty array when supplied. Deduplicate by referenceMerchantId or normalized domain. No separate item-count limit is specified; the total AMS message-size limit applies.
65
+ """
66
+ return self.__allowed_merchant
67
+
68
+ @allowed_merchant.setter
69
+ def allowed_merchant(self, value):
70
+ self.__allowed_merchant = value
71
+ @property
72
+ def consumer_prompt(self):
73
+ """
74
+ Original user intent. Required for the applicable A+ mandate authorization scenario. The documented maximum length is 1M; the document does not define its exact numeric value or whether it counts characters or bytes. No numeric maxLength is imposed here.
75
+ """
76
+ return self.__consumer_prompt
77
+
78
+ @consumer_prompt.setter
79
+ def consumer_prompt(self, value):
80
+ self.__consumer_prompt = value
81
+ @property
82
+ def intent_desc(self):
83
+ """
84
+ CreateBindingSession: Structured authorization summary produced by the caller. Required for applicable A+ mandate bind-and-authorize scenarios. CreateAuthenticationSession: Structured authorization summary produced by the caller. Required for Visa initiatePurchaseInstruction; optional for its composite path when the source authorization contains a description. For Mastercard, optional when the source intent has a description. Not consumed by A+, whose original expression uses consumerPrompt.
85
+ """
86
+ return self.__intent_desc
87
+
88
+ @intent_desc.setter
89
+ def intent_desc(self, value):
90
+ self.__intent_desc = value
91
+
92
+
93
+
94
+
95
+ def to_ams_dict(self):
96
+ params = dict()
97
+ if hasattr(self, "decline_threshold") and self.decline_threshold is not None:
98
+ params['declineThreshold'] = self.decline_threshold
99
+ if hasattr(self, "effective_from_time") and self.effective_from_time is not None:
100
+ params['effectiveFromTime'] = self.effective_from_time
101
+ if hasattr(self, "effective_until_time") and self.effective_until_time is not None:
102
+ params['effectiveUntilTime'] = self.effective_until_time
103
+ if hasattr(self, "preferred_merchant") and self.preferred_merchant is not None:
104
+ params['preferredMerchant'] = self.preferred_merchant
105
+ if hasattr(self, "allowed_merchant") and self.allowed_merchant is not None:
106
+ params['allowedMerchant'] = self.allowed_merchant
107
+ if hasattr(self, "consumer_prompt") and self.consumer_prompt is not None:
108
+ params['consumerPrompt'] = self.consumer_prompt
109
+ if hasattr(self, "intent_desc") and self.intent_desc is not None:
110
+ params['intentDesc'] = self.intent_desc
111
+ return params
112
+
113
+
114
+ def parse_rsp_body(self, response_body):
115
+ if isinstance(response_body, str):
116
+ response_body = json.loads(response_body)
117
+ if 'declineThreshold' in response_body:
118
+ self.__decline_threshold = AgenticDeclineThreshold()
119
+ self.__decline_threshold.parse_rsp_body(response_body['declineThreshold'])
120
+ if 'effectiveFromTime' in response_body:
121
+ self.__effective_from_time = response_body['effectiveFromTime']
122
+ if 'effectiveUntilTime' in response_body:
123
+ self.__effective_until_time = response_body['effectiveUntilTime']
124
+ if 'preferredMerchant' in response_body:
125
+ self.__preferred_merchant = Merchant()
126
+ self.__preferred_merchant.parse_rsp_body(response_body['preferredMerchant'])
127
+ if 'allowedMerchant' in response_body:
128
+ self.__allowed_merchant = []
129
+ for item in response_body['allowedMerchant']:
130
+ obj = Merchant()
131
+ obj.parse_rsp_body(item)
132
+ self.__allowed_merchant.append(obj)
133
+ if 'consumerPrompt' in response_body:
134
+ self.__consumer_prompt = response_body['consumerPrompt']
135
+ if 'intentDesc' in response_body:
136
+ self.__intent_desc = response_body['intentDesc']
@@ -0,0 +1,67 @@
1
+ import json
2
+
3
+
4
+
5
+
6
+ class AgenticPaymentMethod:
7
+ def __init__(self):
8
+
9
+ self.__payment_method_type = None # type: str
10
+ self.__payment_method_id = None # type: str
11
+ self.__selected_card_brand = None # type: str
12
+
13
+
14
+ @property
15
+ def payment_method_type(self):
16
+ """
17
+ Payment method type. Case-sensitive supported values: CARD, AlipayCN, AlipayHK, MPay. See the enclosing API paymentMethod description for scenario rules.
18
+ """
19
+ return self.__payment_method_type
20
+
21
+ @payment_method_type.setter
22
+ def payment_method_type(self, value):
23
+ self.__payment_method_type = value
24
+ @property
25
+ def payment_method_id(self):
26
+ """
27
+ Opaque Antom payment method reference. Pass unchanged. Omit for createBindingSession; conditionally required for createAuthenticationSession and required for inquirePaymentToken. See the enclosing API description.
28
+ """
29
+ return self.__payment_method_id
30
+
31
+ @payment_method_id.setter
32
+ def payment_method_id(self, value):
33
+ self.__payment_method_id = value
34
+ @property
35
+ def selected_card_brand(self):
36
+ """
37
+ Case-sensitive card brand: VISA or MASTERCARD. Omit for APM. Requiredness and supported combinations depend on the API and scenario; see the enclosing API paymentMethod description.
38
+ """
39
+ return self.__selected_card_brand
40
+
41
+ @selected_card_brand.setter
42
+ def selected_card_brand(self, value):
43
+ self.__selected_card_brand = value
44
+
45
+
46
+
47
+
48
+ def to_ams_dict(self):
49
+ params = dict()
50
+ if hasattr(self, "payment_method_type") and self.payment_method_type is not None:
51
+ params['paymentMethodType'] = self.payment_method_type
52
+ if hasattr(self, "payment_method_id") and self.payment_method_id is not None:
53
+ params['paymentMethodId'] = self.payment_method_id
54
+ if hasattr(self, "selected_card_brand") and self.selected_card_brand is not None:
55
+ params['selectedCardBrand'] = self.selected_card_brand
56
+ return params
57
+
58
+
59
+ def parse_rsp_body(self, response_body):
60
+ if isinstance(response_body, str):
61
+ response_body = json.loads(response_body)
62
+ if 'paymentMethodType' in response_body:
63
+ self.__payment_method_type = response_body['paymentMethodType']
64
+ if 'paymentMethodId' in response_body:
65
+ self.__payment_method_id = response_body['paymentMethodId']
66
+ if 'selectedCardBrand' in response_body:
67
+ self.__selected_card_brand = response_body['selectedCardBrand']