jamm 2.0.0 → 2.2.0

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.
@@ -25,24 +25,43 @@ module Api
25
25
 
26
26
  attr_accessor :merchant_name
27
27
 
28
+ # Original charge amount before discount and before any refund is applied.
28
29
  attr_accessor :initial_amount
29
30
 
31
+ # Discount amount deducted from the original charge amount.
30
32
  attr_accessor :discount
31
33
 
34
+ # Final charge amount after discount, before any refund is applied.
32
35
  attr_accessor :final_amount
33
36
 
37
+ # Total amount refunded for this charge when the charge has been refunded.
34
38
  attr_accessor :amount_refunded
35
39
 
36
40
  attr_accessor :currency
37
41
 
42
+ # Timestamp when the charge or refund outcome was completed.
38
43
  attr_accessor :processed_at
39
44
 
45
+ # Jamm fee associated with this refund event (refund uses refund fee; cancel uses 0).
46
+ attr_accessor :jamm_fee
47
+
40
48
  attr_accessor :created_at
41
49
 
42
50
  attr_accessor :updated_at
43
51
 
52
+ # Whether the original transaction's Jamm fee was waived (same-day cancel) or not (refund). Values: \"waived\", \"not_waived\".
53
+ attr_accessor :original_transaction_jamm_fee
54
+
55
+ # Consumption tax (10% of the Jamm fee).
56
+ attr_accessor :consumption_tax
57
+
44
58
  attr_accessor :error
45
59
 
60
+ # External refund identifier (rfd-*) for refund/refund-failed webhooks.
61
+ attr_accessor :refund_id
62
+
63
+ attr_accessor :refund
64
+
46
65
  class EnumAttributeValidator
47
66
  attr_reader :datatype
48
67
  attr_reader :allowable_values
@@ -79,9 +98,14 @@ module Api
79
98
  :'amount_refunded' => :'amountRefunded',
80
99
  :'currency' => :'currency',
81
100
  :'processed_at' => :'processedAt',
101
+ :'jamm_fee' => :'jammFee',
82
102
  :'created_at' => :'createdAt',
83
103
  :'updated_at' => :'updatedAt',
84
- :'error' => :'error'
104
+ :'original_transaction_jamm_fee' => :'originalTransactionJammFee',
105
+ :'consumption_tax' => :'consumptionTax',
106
+ :'error' => :'error',
107
+ :'refund_id' => :'refundId',
108
+ :'refund' => :'refund'
85
109
  }
86
110
  end
87
111
 
@@ -104,9 +128,14 @@ module Api
104
128
  :'amount_refunded' => :'Integer',
105
129
  :'currency' => :'String',
106
130
  :'processed_at' => :'String',
131
+ :'jamm_fee' => :'Integer',
107
132
  :'created_at' => :'String',
108
133
  :'updated_at' => :'String',
109
- :'error' => :'Apiv1Error'
134
+ :'original_transaction_jamm_fee' => :'String',
135
+ :'consumption_tax' => :'Integer',
136
+ :'error' => :'Apiv1Error',
137
+ :'refund_id' => :'String',
138
+ :'refund' => :'RefundInfo'
110
139
  }
111
140
  end
112
141
 
@@ -177,6 +206,10 @@ module Api
177
206
  self.processed_at = attributes[:'processed_at']
178
207
  end
179
208
 
209
+ if attributes.key?(:'jamm_fee')
210
+ self.jamm_fee = attributes[:'jamm_fee']
211
+ end
212
+
180
213
  if attributes.key?(:'created_at')
181
214
  self.created_at = attributes[:'created_at']
182
215
  end
@@ -185,9 +218,25 @@ module Api
185
218
  self.updated_at = attributes[:'updated_at']
186
219
  end
187
220
 
221
+ if attributes.key?(:'original_transaction_jamm_fee')
222
+ self.original_transaction_jamm_fee = attributes[:'original_transaction_jamm_fee']
223
+ end
224
+
225
+ if attributes.key?(:'consumption_tax')
226
+ self.consumption_tax = attributes[:'consumption_tax']
227
+ end
228
+
188
229
  if attributes.key?(:'error')
189
230
  self.error = attributes[:'error']
190
231
  end
232
+
233
+ if attributes.key?(:'refund_id')
234
+ self.refund_id = attributes[:'refund_id']
235
+ end
236
+
237
+ if attributes.key?(:'refund')
238
+ self.refund = attributes[:'refund']
239
+ end
191
240
  end
192
241
 
193
242
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -221,9 +270,14 @@ module Api
221
270
  amount_refunded == o.amount_refunded &&
222
271
  currency == o.currency &&
223
272
  processed_at == o.processed_at &&
273
+ jamm_fee == o.jamm_fee &&
224
274
  created_at == o.created_at &&
225
275
  updated_at == o.updated_at &&
226
- error == o.error
276
+ original_transaction_jamm_fee == o.original_transaction_jamm_fee &&
277
+ consumption_tax == o.consumption_tax &&
278
+ error == o.error &&
279
+ refund_id == o.refund_id &&
280
+ refund == o.refund
227
281
  end
228
282
 
229
283
  # @see the `==` method
@@ -235,7 +289,7 @@ module Api
235
289
  # Calculates hash code according to all attributes.
236
290
  # @return [Integer] Hash code
237
291
  def hash
238
- [id, customer, status, description, merchant_name, initial_amount, discount, final_amount, amount_refunded, currency, processed_at, created_at, updated_at, error].hash
292
+ [id, customer, status, description, merchant_name, initial_amount, discount, final_amount, amount_refunded, currency, processed_at, jamm_fee, created_at, updated_at, original_transaction_jamm_fee, consumption_tax, error, refund_id, refund].hash
239
293
  end
240
294
 
241
295
  # Builds the object from hash
@@ -21,9 +21,10 @@ module Api
21
21
  WAITING_EKYC = "STATUS_WAITING_EKYC".freeze
22
22
  BLOCKING = "STATUS_BLOCKING".freeze
23
23
  CANCELLED = "STATUS_CANCELLED".freeze
24
+ REFUNDED = "STATUS_REFUNDED".freeze
24
25
 
25
26
  def self.all_vars
26
- @all_vars ||= [UNSPECIFIED, SUCCESS, FAILURE, WAITING_EKYC, BLOCKING, CANCELLED].freeze
27
+ @all_vars ||= [UNSPECIFIED, SUCCESS, FAILURE, WAITING_EKYC, BLOCKING, CANCELLED, REFUNDED].freeze
27
28
  end
28
29
 
29
30
  # Builds the enum from string
@@ -50,6 +50,8 @@ module Api
50
50
 
51
51
  attr_accessor :charge_status
52
52
 
53
+ attr_accessor :error
54
+
53
55
  class EnumAttributeValidator
54
56
  attr_reader :datatype
55
57
  attr_reader :allowable_values
@@ -90,7 +92,8 @@ module Api
90
92
  :'created_at' => :'createdAt',
91
93
  :'updated_at' => :'updatedAt',
92
94
  :'processed_at' => :'processedAt',
93
- :'charge_status' => :'chargeStatus'
95
+ :'charge_status' => :'chargeStatus',
96
+ :'error' => :'error'
94
97
  }
95
98
  end
96
99
 
@@ -117,7 +120,8 @@ module Api
117
120
  :'created_at' => :'Time',
118
121
  :'updated_at' => :'Time',
119
122
  :'processed_at' => :'Time',
120
- :'charge_status' => :'ChargeStatus'
123
+ :'charge_status' => :'ChargeStatus',
124
+ :'error' => :'ChargeError'
121
125
  }
122
126
  end
123
127
 
@@ -209,6 +213,10 @@ module Api
209
213
  else
210
214
  self.charge_status = 'CHARGE_STATUS_UNSPECIFIED'
211
215
  end
216
+
217
+ if attributes.key?(:'error')
218
+ self.error = attributes[:'error']
219
+ end
212
220
  end
213
221
 
214
222
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -246,7 +254,8 @@ module Api
246
254
  created_at == o.created_at &&
247
255
  updated_at == o.updated_at &&
248
256
  processed_at == o.processed_at &&
249
- charge_status == o.charge_status
257
+ charge_status == o.charge_status &&
258
+ error == o.error
250
259
  end
251
260
 
252
261
  # @see the `==` method
@@ -258,7 +267,7 @@ module Api
258
267
  # Calculates hash code according to all attributes.
259
268
  # @return [Integer] Hash code
260
269
  def hash
261
- [charge_id, paid, reason, description, merchant_name, initial_amount, discount, final_amount, amount_refunded, currency, token_id, metadata, created_at, updated_at, processed_at, charge_status].hash
270
+ [charge_id, paid, reason, description, merchant_name, initial_amount, discount, final_amount, amount_refunded, currency, token_id, metadata, created_at, updated_at, processed_at, charge_status, error].hash
262
271
  end
263
272
 
264
273
  # Builds the object from hash
@@ -35,6 +35,8 @@ module Api
35
35
  PAYMENT_CHARGE_SUBSCRIPTION_EXPIRED = "ERROR_TYPE_PAYMENT_CHARGE_SUBSCRIPTION_EXPIRED".freeze
36
36
  PAYMENT_LINK_EXPIRED = "ERROR_TYPE_PAYMENT_LINK_EXPIRED".freeze
37
37
  PAYMENT_CHARGE_INSUFFICIENT_FUNDS = "ERROR_TYPE_PAYMENT_CHARGE_INSUFFICIENT_FUNDS".freeze
38
+ PAYMENT_CUSTOMER_NOT_FOUND = "ERROR_TYPE_PAYMENT_CUSTOMER_NOT_FOUND".freeze
39
+ PAYMENT_CUSTOMER_INACTIVE = "ERROR_TYPE_PAYMENT_CUSTOMER_INACTIVE".freeze
38
40
  CSV_VALIDATION_FAILED = "ERROR_TYPE_CSV_VALIDATION_FAILED".freeze
39
41
  CSV_TOTP_REQUIRED = "ERROR_TYPE_CSV_TOTP_REQUIRED".freeze
40
42
  CSV_TOTP_INVALID = "ERROR_TYPE_CSV_TOTP_INVALID".freeze
@@ -52,7 +54,7 @@ module Api
52
54
  TOTP_DISABLE_FAILED = "ERROR_TYPE_TOTP_DISABLE_FAILED".freeze
53
55
 
54
56
  def self.all_vars
55
- @all_vars ||= [UNSPECIFIED, AUTH_FAILED, AUTH_REJECTED, ACCOUNT_CREATION_FAILED, ACCOUNT_MODIFICATION_FAILED, ACCOUNT_DELETION_FAILED, ACCOUNT_BANK_REGISTRATION_FAILED, KYC_REJECTED, NOTIFICATION_WEBHOOK_FAILED, NOTIFICATION_EMAIL_FAILED, NOTIFICATION_SMS_FAILED, PAYMENT_GATEWAY_UNAVAILABLE, PAYMENT_GATEWAY_FAILED, PAYMENT_VALIDATION_FAILED, PAYMENT_CHARGE_FAILED, PAYMENT_CHARGE_REJECTED, PAYMENT_CHARGE_OVER_LIMIT, PAYMENT_CHARGE_SUBSCRIPTION_EXPIRED, PAYMENT_LINK_EXPIRED, PAYMENT_CHARGE_INSUFFICIENT_FUNDS, CSV_VALIDATION_FAILED, CSV_TOTP_REQUIRED, CSV_TOTP_INVALID, CSV_TOTP_EXPIRED, CSV_TOTP_LOCKED, CSV_BATCH_TOO_LARGE, CSV_CUSTOMER_NOT_FOUND, CSV_PROCESSING_FAILED, CSV_CHALLENGE_NOT_FOUND, CSV_DUPLICATE_USER, TOTP_SETUP_FAILED, TOTP_ALREADY_ENABLED, TOTP_NOT_ENABLED, TOTP_SETUP_INVALID, TOTP_DISABLE_FAILED].freeze
57
+ @all_vars ||= [UNSPECIFIED, AUTH_FAILED, AUTH_REJECTED, ACCOUNT_CREATION_FAILED, ACCOUNT_MODIFICATION_FAILED, ACCOUNT_DELETION_FAILED, ACCOUNT_BANK_REGISTRATION_FAILED, KYC_REJECTED, NOTIFICATION_WEBHOOK_FAILED, NOTIFICATION_EMAIL_FAILED, NOTIFICATION_SMS_FAILED, PAYMENT_GATEWAY_UNAVAILABLE, PAYMENT_GATEWAY_FAILED, PAYMENT_VALIDATION_FAILED, PAYMENT_CHARGE_FAILED, PAYMENT_CHARGE_REJECTED, PAYMENT_CHARGE_OVER_LIMIT, PAYMENT_CHARGE_SUBSCRIPTION_EXPIRED, PAYMENT_LINK_EXPIRED, PAYMENT_CHARGE_INSUFFICIENT_FUNDS, PAYMENT_CUSTOMER_NOT_FOUND, PAYMENT_CUSTOMER_INACTIVE, CSV_VALIDATION_FAILED, CSV_TOTP_REQUIRED, CSV_TOTP_INVALID, CSV_TOTP_EXPIRED, CSV_TOTP_LOCKED, CSV_BATCH_TOO_LARGE, CSV_CUSTOMER_NOT_FOUND, CSV_PROCESSING_FAILED, CSV_CHALLENGE_NOT_FOUND, CSV_DUPLICATE_USER, TOTP_SETUP_FAILED, TOTP_ALREADY_ENABLED, TOTP_NOT_ENABLED, TOTP_SETUP_INVALID, TOTP_DISABLE_FAILED].freeze
56
58
  end
57
59
 
58
60
  # Builds the enum from string
@@ -20,13 +20,14 @@ module Api
20
20
  CHARGE_UPDATED = "EVENT_TYPE_CHARGE_UPDATED".freeze
21
21
  CHARGE_SUCCESS = "EVENT_TYPE_CHARGE_SUCCESS".freeze
22
22
  CHARGE_FAIL = "EVENT_TYPE_CHARGE_FAIL".freeze
23
- CHARGE_REFUND = "EVENT_TYPE_CHARGE_REFUND".freeze
23
+ REFUND_SUCCEEDED = "EVENT_TYPE_REFUND_SUCCEEDED".freeze
24
+ REFUND_FAILED = "EVENT_TYPE_REFUND_FAILED".freeze
24
25
  CONTRACT_ACTIVATED = "EVENT_TYPE_CONTRACT_ACTIVATED".freeze
25
26
  USER_ACCOUNT_DELETED = "EVENT_TYPE_USER_ACCOUNT_DELETED".freeze
26
27
  TESTING = "EVENT_TYPE_TESTING".freeze
27
28
 
28
29
  def self.all_vars
29
- @all_vars ||= [UNSPECIFIED, CHARGE_CREATED, CHARGE_UPDATED, CHARGE_SUCCESS, CHARGE_FAIL, CHARGE_REFUND, CONTRACT_ACTIVATED, USER_ACCOUNT_DELETED, TESTING].freeze
30
+ @all_vars ||= [UNSPECIFIED, CHARGE_CREATED, CHARGE_UPDATED, CHARGE_SUCCESS, CHARGE_FAIL, REFUND_SUCCEEDED, REFUND_FAILED, CONTRACT_ACTIVATED, USER_ACCOUNT_DELETED, TESTING].freeze
30
31
  end
31
32
 
32
33
  # Builds the enum from string
@@ -19,12 +19,15 @@ module Api
19
19
  # Amount of the charge in Japanese Yen. The amount must be the total price of the product/service including tax. 決済金額。日本円で指定してください。 金額は商品/サービスの合計金額 (税込) を指定してください。 @gotags: validate:\"gte=1,lte=500000\"
20
20
  attr_accessor :price
21
21
 
22
- # Description is an arbitrary string for merchant to track the charge. This information is displayed on Merchant Dashboard. 決済の説明。ショップが決済を追跡するための任意の文字列です。 @gotags: validate:\"required\"
22
+ # Description is an arbitrary string for merchant to track the charge. This information is displayed on Merchant Dashboard. 決済の説明。ショップが決済を追跡するための任意の文字列です。 @gotags: validate:\"required,max=1024\"
23
23
  attr_accessor :description
24
24
 
25
- # Arbitrary key-value additional information about the charge. You can see this information in our merchant dashboard. Chargeに関する任意のキーと値の追加情報。 加盟店ダッシュボードで確認できます。
25
+ # Arbitrary key-value additional information about the charge. You can see this information in our merchant dashboard. ## Testing with triggerError Set the key \"triggerError\" to a valid ERROR_TYPE_* enum name (e.g. \"ERROR_TYPE_PAYMENT_CHARGE_FAILED\") to simulate a payment failure. Behavior differs by flow: Off-session (Withdraw, WithdrawAsync, OffSessionPayment, OffSessionPaymentAsync): Reads triggerError from this field (charge.metadata). Creates a failed transaction record and sends a failure webhook. Returns transport-level 400 for ERROR_TYPE_PAYMENT_VALIDATION_FAILED, 500 for all other ERROR_TYPE_* values. On-session (InitiatePayment / ApprovePayment — consumer-facing core service): Reads triggerError from the payment's stored metadata (charge or merchant-customer). Initiate stage: only ERROR_TYPE_PAYMENT_VALIDATION_FAILED and ERROR_TYPE_PAYMENT_LINK_EXPIRED are honored; other types are ignored. No failed transaction or webhook is created. Returns 200 OK with an embedded InitiatePaymentError payload. Approve stage: all ERROR_TYPE_* values are honored. Creates workflow-specific failure records (cancelled contract and/or failed transaction depending on the workflow type). Returns 200 OK with an embedded ApprovePaymentError payload. Note: CreateContractWithoutCharge has no charge, so this field does not apply. On-session triggerError for that flow is read from merchant-customer metadata instead. ## Error types by payment stage Initiate (payment session setup, workflow creation): - ERROR_TYPE_PAYMENT_VALIDATION_FAILED — invalid request - ERROR_TYPE_PAYMENT_LINK_EXPIRED — payment link expired Approve (pre-charge validation + BankPay charge execution): - ERROR_TYPE_PAYMENT_VALIDATION_FAILED — invalid request (e.g. deleted/inactive customer) - ERROR_TYPE_PAYMENT_CHARGE_REJECTED — KYC not approved - ERROR_TYPE_PAYMENT_CHARGE_OVER_LIMIT — charge exceeds bank quota - ERROR_TYPE_PAYMENT_LINK_EXPIRED — payment link expired - ERROR_TYPE_PAYMENT_GATEWAY_UNAVAILABLE — BankPay/bank under maintenance - ERROR_TYPE_PAYMENT_CHARGE_INSUFFICIENT_FUNDS — insufficient funds in customer's account - ERROR_TYPE_PAYMENT_GATEWAY_FAILED — BankPay rejected the charge - ERROR_TYPE_PAYMENT_CHARGE_FAILED — generic charge failure (internal, not found, etc.) Chargeに関する任意のキーと値の追加情報。 加盟店ダッシュボードで確認できます。 テスト環境では、\"triggerError\" キーに ERROR_TYPE_* の列挙名を設定すると 決済エラーをシミュレートできます。動作はフローによって異なります。 詳細は上記の英語コメントを参照してください。
26
26
  attr_accessor :metadata
27
27
 
28
+ # Fee charged by the platform (in JPY). Must be >= the Jamm fee for the merchant. Only meaningful when the caller is a platform. Ignored for direct merchant calls. プラットフォームが徴収する手数料(日本円)。加盟店のJamm手数料以上である必要があります。
29
+ attr_accessor :platform_fee
30
+
28
31
  # Merchant can optionally set the expiry date for the payment. Defaults to 90 minutes if not specified. 決済の有効期限。未指定の場合は90分後に自動失効します。
29
32
  attr_accessor :expires_at
30
33
 
@@ -34,6 +37,7 @@ module Api
34
37
  :'price' => :'price',
35
38
  :'description' => :'description',
36
39
  :'metadata' => :'metadata',
40
+ :'platform_fee' => :'platformFee',
37
41
  :'expires_at' => :'expiresAt'
38
42
  }
39
43
  end
@@ -49,6 +53,7 @@ module Api
49
53
  :'price' => :'Integer',
50
54
  :'description' => :'String',
51
55
  :'metadata' => :'Hash<String, String>',
56
+ :'platform_fee' => :'Integer',
52
57
  :'expires_at' => :'Time'
53
58
  }
54
59
  end
@@ -88,6 +93,10 @@ module Api
88
93
  end
89
94
  end
90
95
 
96
+ if attributes.key?(:'platform_fee')
97
+ self.platform_fee = attributes[:'platform_fee']
98
+ end
99
+
91
100
  if attributes.key?(:'expires_at')
92
101
  self.expires_at = attributes[:'expires_at']
93
102
  end
@@ -116,6 +125,7 @@ module Api
116
125
  price == o.price &&
117
126
  description == o.description &&
118
127
  metadata == o.metadata &&
128
+ platform_fee == o.platform_fee &&
119
129
  expires_at == o.expires_at
120
130
  end
121
131
 
@@ -128,7 +138,7 @@ module Api
128
138
  # Calculates hash code according to all attributes.
129
139
  # @return [Integer] Hash code
130
140
  def hash
131
- [price, description, metadata, expires_at].hash
141
+ [price, description, metadata, platform_fee, expires_at].hash
132
142
  end
133
143
 
134
144
  # Builds the object from hash
@@ -23,13 +23,16 @@ module Api
23
23
 
24
24
  attr_accessor :user_account_message
25
25
 
26
+ attr_accessor :refund_info
27
+
26
28
  # Attribute mapping from ruby-style variable name to JSON key.
27
29
  def self.attribute_map
28
30
  {
29
31
  :'merchant_webhook_message' => :'merchantWebhookMessage',
30
32
  :'charge_message' => :'chargeMessage',
31
33
  :'contract_message' => :'contractMessage',
32
- :'user_account_message' => :'userAccountMessage'
34
+ :'user_account_message' => :'userAccountMessage',
35
+ :'refund_info' => :'refundInfo'
33
36
  }
34
37
  end
35
38
 
@@ -44,7 +47,8 @@ module Api
44
47
  :'merchant_webhook_message' => :'MerchantWebhookMessage',
45
48
  :'charge_message' => :'ChargeMessage',
46
49
  :'contract_message' => :'ContractMessage',
47
- :'user_account_message' => :'UserAccountMessage'
50
+ :'user_account_message' => :'UserAccountMessage',
51
+ :'refund_info' => :'RefundInfo'
48
52
  }
49
53
  end
50
54
 
@@ -84,6 +88,10 @@ module Api
84
88
  if attributes.key?(:'user_account_message')
85
89
  self.user_account_message = attributes[:'user_account_message']
86
90
  end
91
+
92
+ if attributes.key?(:'refund_info')
93
+ self.refund_info = attributes[:'refund_info']
94
+ end
87
95
  end
88
96
 
89
97
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -109,7 +117,8 @@ module Api
109
117
  merchant_webhook_message == o.merchant_webhook_message &&
110
118
  charge_message == o.charge_message &&
111
119
  contract_message == o.contract_message &&
112
- user_account_message == o.user_account_message
120
+ user_account_message == o.user_account_message &&
121
+ refund_info == o.refund_info
113
122
  end
114
123
 
115
124
  # @see the `==` method
@@ -121,7 +130,7 @@ module Api
121
130
  # Calculates hash code according to all attributes.
122
131
  # @return [Integer] Hash code
123
132
  def hash
124
- [merchant_webhook_message, charge_message, contract_message, user_account_message].hash
133
+ [merchant_webhook_message, charge_message, contract_message, user_account_message, refund_info].hash
125
134
  end
126
135
 
127
136
  # Builds the object from hash
@@ -14,17 +14,21 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Api
17
- # This message represents a request to process an off-session payment asynchronously. It contains the customer ID and the amount to charge.
17
+ # This message represents a request to process an off-session payment asynchronously. It contains the customer ID and the amount to charge. Supports triggerError in charge.metadata for test error simulation. See InitialCharge.metadata.
18
18
  class OffSessionPaymentAsyncRequest
19
19
  attr_accessor :customer
20
20
 
21
21
  attr_accessor :charge
22
22
 
23
+ # Merchant-supplied idempotency key for retry safety. When present, a retry with the same (merchant, idempotency_key) returns the original charge instead of creating a new one. When absent (empty), the server generates a UUID per call (current behavior). ASCII only, 1-255 chars matching ^[a-zA-Z0-9_\\-]{1,255}$.
24
+ attr_accessor :idempotency_key
25
+
23
26
  # Attribute mapping from ruby-style variable name to JSON key.
24
27
  def self.attribute_map
25
28
  {
26
29
  :'customer' => :'customer',
27
- :'charge' => :'charge'
30
+ :'charge' => :'charge',
31
+ :'idempotency_key' => :'idempotencyKey'
28
32
  }
29
33
  end
30
34
 
@@ -37,7 +41,8 @@ module Api
37
41
  def self.openapi_types
38
42
  {
39
43
  :'customer' => :'String',
40
- :'charge' => :'InitialCharge'
44
+ :'charge' => :'InitialCharge',
45
+ :'idempotency_key' => :'String'
41
46
  }
42
47
  end
43
48
 
@@ -69,6 +74,10 @@ module Api
69
74
  if attributes.key?(:'charge')
70
75
  self.charge = attributes[:'charge']
71
76
  end
77
+
78
+ if attributes.key?(:'idempotency_key')
79
+ self.idempotency_key = attributes[:'idempotency_key']
80
+ end
72
81
  end
73
82
 
74
83
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -92,7 +101,8 @@ module Api
92
101
  return true if self.equal?(o)
93
102
  self.class == o.class &&
94
103
  customer == o.customer &&
95
- charge == o.charge
104
+ charge == o.charge &&
105
+ idempotency_key == o.idempotency_key
96
106
  end
97
107
 
98
108
  # @see the `==` method
@@ -104,7 +114,7 @@ module Api
104
114
  # Calculates hash code according to all attributes.
105
115
  # @return [Integer] Hash code
106
116
  def hash
107
- [customer, charge].hash
117
+ [customer, charge, idempotency_key].hash
108
118
  end
109
119
 
110
120
  # Builds the object from hash
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Api
17
- # This message represents a request to process a payment directly within the application. It contains the customer ID and charge details to be processed.
17
+ # This message represents a request to process a payment directly within the application. It contains the customer ID and charge details to be processed. Supports triggerError in charge.metadata for test error simulation. See InitialCharge.metadata.
18
18
  class OffSessionPaymentRequest
19
19
  attr_accessor :customer
20
20
 
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Api
17
- # Request message for the unified payment interface. The system intelligently routes the request to the appropriate payment method based on the provided parameters.
17
+ # Request message for the unified payment interface. The system intelligently routes the request to the appropriate payment method based on the provided parameters. Supports triggerError for test error simulation via the core InitiatePayment/ApprovePayment flow. See InitialCharge.metadata for details on behavior differences by stage.
18
18
  class OnSessionPaymentRequest
19
19
  attr_accessor :customer
20
20