univapay-client-sdk 1.1.0 → 1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 351a468b95fbc6680edd54b2a81ae7fd7ae67110cfd6ccc1461534816a8cd701
4
- data.tar.gz: 952a7897e0a5a0b401837cefd9080850e33d1b622e652b57b24505fb25bea2e5
3
+ metadata.gz: 79defc22034350900b06cf5d1c4a3c63cdee6bed5ea4e43595685f443da6c3ca
4
+ data.tar.gz: 12730cd792e21693771ca200748b298096b28c659ccb49633c7e88c2ff9f15d2
5
5
  SHA512:
6
- metadata.gz: 9d2557bf0488aad54a3c6f75b58ae884162fe5643c820923f8d98bbac421ad60385b063ccab45080dd69aa9e14c803d2b46a97997dc200c10d9cf9e870cc246f
7
- data.tar.gz: 1e984113af71cfa604ce77fbd89d5d3ab1878b963594f0a681270b6da1dad1fca6b1db12faf33261704e89e5f5118e2349ad3bd36fb25e0495426f0648ff50dc
6
+ metadata.gz: 8411eb3d7b92fde1d317379086a0ec13f4312508ec8b644120e65710fb654783ba43a75b4e2186f9ab20fd95f2e37908c88bd5cc38415a71e259388ba6006f0f
7
+ data.tar.gz: 5f23c4ac26fab020c1cf29f9f1557119460f91162b71fa50e61ed8811552d7da8f411f5bdc0c1af425e69d792bde07bc2f394b65e158f635fceaf14b63bae7d2
data/README.md CHANGED
@@ -36,16 +36,16 @@ We will assume that all requests are going to originate from a backend server th
36
36
  Install the gem from the command line:
37
37
 
38
38
  ```bash
39
- gem install univapay-client-sdk -v 1.1.0
39
+ gem install univapay-client-sdk -v 1.2.0
40
40
  ```
41
41
 
42
42
  Or add the gem to your Gemfile and run `bundle`:
43
43
 
44
44
  ```ruby
45
- gem 'univapay-client-sdk', '1.1.0'
45
+ gem 'univapay-client-sdk', '1.2.0'
46
46
  ```
47
47
 
48
- For additional gem details, see the [RubyGems page for the univapay-client-sdk gem](https://rubygems.org/gems/univapay-client-sdk/versions/1.1.0).
48
+ For additional gem details, see the [RubyGems page for the univapay-client-sdk gem](https://rubygems.org/gems/univapay-client-sdk/versions/1.2.0).
49
49
 
50
50
  ## IRB Console Usage
51
51
 
@@ -10,7 +10,7 @@ module UnivapayClientSdk
10
10
  attr_accessor :config, :http_call_back
11
11
 
12
12
  def self.user_agent
13
- 'Ruby-SDK/1.1.0 (OS: {os-info}, Engine: {engine}/{engine-version})'
13
+ 'Ruby-SDK/1.2.0 (OS: {os-info}, Engine: {engine}/{engine-version})'
14
14
  end
15
15
 
16
16
  def self.user_agent_parameters
@@ -0,0 +1,70 @@
1
+ # univapay_client_sdk
2
+ #
3
+ # This file was automatically generated for Univapay
4
+ # by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module UnivapayClientSdk
7
+ # Number of installment cycles. Present when plan_type is fixed_cycles.
8
+ class CombinedInstallmentFixedCycles
9
+ COMBINED_INSTALLMENT_FIXED_CYCLES = [
10
+ # 3 cycles
11
+ CYCLES_3 = 3,
12
+
13
+ # 5 cycles
14
+ CYCLES_5 = 5,
15
+
16
+ # 6 cycles
17
+ CYCLES_6 = 6,
18
+
19
+ # 10 cycles
20
+ CYCLES_10 = 10,
21
+
22
+ # 12 cycles
23
+ CYCLES_12 = 12,
24
+
25
+ # 15 cycles
26
+ CYCLES_15 = 15,
27
+
28
+ # 18 cycles
29
+ CYCLES_18 = 18,
30
+
31
+ # 20 cycles
32
+ CYCLES_20 = 20,
33
+
34
+ # 24 cycles
35
+ CYCLES_24 = 24
36
+ ].freeze
37
+
38
+ def self.validate(value)
39
+ return false if value.nil?
40
+
41
+ COMBINED_INSTALLMENT_FIXED_CYCLES.include?(value)
42
+ end
43
+
44
+ def self.from_value(value, default_value = CYCLES_3)
45
+ return default_value if value.nil?
46
+
47
+ str = value.to_s.strip
48
+ if str.match?(/\A\d+\z/)
49
+ num = str.to_i
50
+ return num if COMBINED_INSTALLMENT_FIXED_CYCLES.include?(num)
51
+
52
+ return default_value
53
+ end
54
+
55
+ case str.downcase
56
+ when 'cycles_3' then CYCLES_3
57
+ when 'cycles_5' then CYCLES_5
58
+ when 'cycles_6' then CYCLES_6
59
+ when 'cycles_10' then CYCLES_10
60
+ when 'cycles_12' then CYCLES_12
61
+ when 'cycles_15' then CYCLES_15
62
+ when 'cycles_18' then CYCLES_18
63
+ when 'cycles_20' then CYCLES_20
64
+ when 'cycles_24' then CYCLES_24
65
+ else
66
+ default_value
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,40 @@
1
+ # univapay_client_sdk
2
+ #
3
+ # This file was automatically generated for Univapay
4
+ # by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module UnivapayClientSdk
7
+ # Plan type selector.
8
+ class CombinedPlanType
9
+ COMBINED_PLAN_TYPE = [
10
+ # TODO: Write general description for REVOLVING
11
+ REVOLVING = 'revolving'.freeze,
12
+
13
+ # TODO: Write general description for FIXED_CYCLES
14
+ FIXED_CYCLES = 'fixed_cycles'.freeze,
15
+
16
+ # TODO: Write general description for FIXED_CYCLE_AMOUNT
17
+ FIXED_CYCLE_AMOUNT = 'fixed_cycle_amount'.freeze
18
+ ].freeze
19
+
20
+ def self.validate(value)
21
+ return false if value.nil?
22
+
23
+ COMBINED_PLAN_TYPE.include?(value)
24
+ end
25
+
26
+ def self.from_value(value, default_value = REVOLVING)
27
+ return default_value if value.nil?
28
+
29
+ str = value.to_s.strip
30
+
31
+ case str.downcase
32
+ when 'revolving' then REVOLVING
33
+ when 'fixed_cycles' then FIXED_CYCLES
34
+ when 'fixed_cycle_amount' then FIXED_CYCLE_AMOUNT
35
+ else
36
+ default_value
37
+ end
38
+ end
39
+ end
40
+ end
@@ -78,14 +78,56 @@ module UnivapayClientSdk
78
78
  # @return [DateTime]
79
79
  attr_accessor :created_on
80
80
 
81
+ # 3-D Secure configuration and redirect details applied to the
82
+ # subscription's payments.
83
+ # @return [SubscriptionThreeDs]
84
+ attr_accessor :three_ds
85
+
81
86
  # Subscription Period schema.
82
87
  # @return [SubscriptionPeriod]
83
88
  attr_accessor :period
84
89
 
90
+ # ISO-8601 Duration for a custom billing frequency (e.g., P3D, P1M),
91
+ # returned instead of `period` when the subscription uses a custom cycle
92
+ # length rather than one of the fixed period presets. Mutually exclusive
93
+ # with `period` — exactly one of the two is present.
94
+ # @return [String]
95
+ attr_accessor :cyclical_period
96
+
85
97
  # Next scheduled payment details for a subscription.
86
98
  # @return [SubscriptionNextPayment]
87
99
  attr_accessor :next_payment
88
100
 
101
+ # Number of remaining billing cycles before the subscription completes. Only
102
+ # present for cycle-limited plans (`subscription_plan` or
103
+ # `installment_plan`); `null` for indefinite subscriptions.
104
+ # @return [Integer]
105
+ attr_accessor :cycles_left
106
+
107
+ # Configuration for limited-cycle subscriptions (Univapay side).
108
+ # @return [SubscriptionPlanSettings]
109
+ attr_accessor :subscription_plan
110
+
111
+ # Installment plan applied to the subscription, as returned by the API.
112
+ # Covers both card-network installment plans (`revolving`, `fixed_cycles`)
113
+ # and legacy fixed-amount installment plans (`fixed_cycle_amount`).
114
+ # @return [SubscriptionInstallmentPlanResponse]
115
+ attr_accessor :installment_plan
116
+
117
+ # Identifier of the charge associated with the subscription's installment
118
+ # plan. Only present when `installment_plan` is set.
119
+ # @return [UUID | String]
120
+ attr_accessor :charge_id
121
+
122
+ # Remaining amount to be charged over the life of the plan, in the smallest
123
+ # currency unit. Only present for cycle-limited plans.
124
+ # @return [Integer]
125
+ attr_accessor :amount_left
126
+
127
+ # `amount_left` formatted for display.
128
+ # @return [Float]
129
+ attr_accessor :amount_left_formatted
130
+
89
131
  # A mapping from model property names to API property names.
90
132
  def self.names
91
133
  @_hash = {} if @_hash.nil?
@@ -107,8 +149,16 @@ module UnivapayClientSdk
107
149
  @_hash['metadata'] = 'metadata'
108
150
  @_hash['mode'] = 'mode'
109
151
  @_hash['created_on'] = 'created_on'
152
+ @_hash['three_ds'] = 'three_ds'
110
153
  @_hash['period'] = 'period'
154
+ @_hash['cyclical_period'] = 'cyclical_period'
111
155
  @_hash['next_payment'] = 'next_payment'
156
+ @_hash['cycles_left'] = 'cycles_left'
157
+ @_hash['subscription_plan'] = 'subscription_plan'
158
+ @_hash['installment_plan'] = 'installment_plan'
159
+ @_hash['charge_id'] = 'charge_id'
160
+ @_hash['amount_left'] = 'amount_left'
161
+ @_hash['amount_left_formatted'] = 'amount_left_formatted'
112
162
  @_hash
113
163
  end
114
164
 
@@ -132,8 +182,16 @@ module UnivapayClientSdk
132
182
  metadata
133
183
  mode
134
184
  created_on
185
+ three_ds
135
186
  period
187
+ cyclical_period
136
188
  next_payment
189
+ cycles_left
190
+ subscription_plan
191
+ installment_plan
192
+ charge_id
193
+ amount_left
194
+ amount_left_formatted
137
195
  ]
138
196
  end
139
197
 
@@ -144,6 +202,11 @@ module UnivapayClientSdk
144
202
  initial_amount_formatted
145
203
  subsequent_cycles_start
146
204
  first_charge_capture_after
205
+ cyclical_period
206
+ cycles_left
207
+ charge_id
208
+ amount_left
209
+ amount_left_formatted
147
210
  ]
148
211
  end
149
212
 
@@ -153,8 +216,11 @@ module UnivapayClientSdk
153
216
  subsequent_cycles_start: SKIP, schedule_settings: SKIP,
154
217
  only_direct_currency: SKIP, first_charge_capture_after: SKIP,
155
218
  first_charge_authorization_only: SKIP, status: SKIP,
156
- metadata: SKIP, mode: SKIP, created_on: SKIP, period: SKIP,
157
- next_payment: SKIP, additional_properties: nil)
219
+ metadata: SKIP, mode: SKIP, created_on: SKIP, three_ds: SKIP,
220
+ period: SKIP, cyclical_period: SKIP, next_payment: SKIP,
221
+ cycles_left: SKIP, subscription_plan: SKIP,
222
+ installment_plan: SKIP, charge_id: SKIP, amount_left: SKIP,
223
+ amount_left_formatted: SKIP, additional_properties: nil)
158
224
  # Add additional model properties to the instance
159
225
  additional_properties = {} if additional_properties.nil?
160
226
 
@@ -181,8 +247,16 @@ module UnivapayClientSdk
181
247
  @metadata = metadata unless metadata == SKIP
182
248
  @mode = mode unless mode == SKIP
183
249
  @created_on = created_on unless created_on == SKIP
250
+ @three_ds = three_ds unless three_ds == SKIP
184
251
  @period = period unless period == SKIP
252
+ @cyclical_period = cyclical_period unless cyclical_period == SKIP
185
253
  @next_payment = next_payment unless next_payment == SKIP
254
+ @cycles_left = cycles_left unless cycles_left == SKIP
255
+ @subscription_plan = subscription_plan unless subscription_plan == SKIP
256
+ @installment_plan = installment_plan unless installment_plan == SKIP
257
+ @charge_id = charge_id unless charge_id == SKIP
258
+ @amount_left = amount_left unless amount_left == SKIP
259
+ @amount_left_formatted = amount_left_formatted unless amount_left_formatted == SKIP
186
260
  @additional_properties = additional_properties
187
261
  end
188
262
 
@@ -224,9 +298,21 @@ module UnivapayClientSdk
224
298
  else
225
299
  SKIP
226
300
  end
301
+ three_ds = SubscriptionThreeDs.from_hash(hash['three_ds']) if hash['three_ds']
227
302
  period = hash.key?('period') ? hash['period'] : SKIP
303
+ cyclical_period =
304
+ hash.key?('cyclical_period') ? hash['cyclical_period'] : SKIP
228
305
  next_payment = SubscriptionNextPayment.from_hash(hash['next_payment']) if
229
306
  hash['next_payment']
307
+ cycles_left = hash.key?('cycles_left') ? hash['cycles_left'] : SKIP
308
+ subscription_plan = SubscriptionPlanSettings.from_hash(hash['subscription_plan']) if
309
+ hash['subscription_plan']
310
+ installment_plan = SubscriptionInstallmentPlanResponse.from_hash(hash['installment_plan']) if
311
+ hash['installment_plan']
312
+ charge_id = hash.key?('charge_id') ? hash['charge_id'] : SKIP
313
+ amount_left = hash.key?('amount_left') ? hash['amount_left'] : SKIP
314
+ amount_left_formatted =
315
+ hash.key?('amount_left_formatted') ? hash['amount_left_formatted'] : SKIP
230
316
 
231
317
  # Create a new hash for additional properties, removing known properties.
232
318
  new_hash = hash.reject { |k, _| names.value?(k) }
@@ -253,8 +339,16 @@ module UnivapayClientSdk
253
339
  metadata: metadata,
254
340
  mode: mode,
255
341
  created_on: created_on,
342
+ three_ds: three_ds,
256
343
  period: period,
344
+ cyclical_period: cyclical_period,
257
345
  next_payment: next_payment,
346
+ cycles_left: cycles_left,
347
+ subscription_plan: subscription_plan,
348
+ installment_plan: installment_plan,
349
+ charge_id: charge_id,
350
+ amount_left: amount_left,
351
+ amount_left_formatted: amount_left_formatted,
258
352
  additional_properties: additional_properties)
259
353
  end
260
354
 
@@ -286,8 +380,12 @@ module UnivapayClientSdk
286
380
  " schedule_settings: #{@schedule_settings}, only_direct_currency: #{@only_direct_currency},"\
287
381
  " first_charge_capture_after: #{@first_charge_capture_after},"\
288
382
  " first_charge_authorization_only: #{@first_charge_authorization_only}, status: #{@status},"\
289
- " metadata: #{@metadata}, mode: #{@mode}, created_on: #{@created_on}, period: #{@period},"\
290
- " next_payment: #{@next_payment}, additional_properties: #{@additional_properties}>"
383
+ " metadata: #{@metadata}, mode: #{@mode}, created_on: #{@created_on}, three_ds:"\
384
+ " #{@three_ds}, period: #{@period}, cyclical_period: #{@cyclical_period}, next_payment:"\
385
+ " #{@next_payment}, cycles_left: #{@cycles_left}, subscription_plan: #{@subscription_plan},"\
386
+ " installment_plan: #{@installment_plan}, charge_id: #{@charge_id}, amount_left:"\
387
+ " #{@amount_left}, amount_left_formatted: #{@amount_left_formatted}, additional_properties:"\
388
+ " #{@additional_properties}>"
291
389
  end
292
390
 
293
391
  # Provides a debugging-friendly string with detailed object information.
@@ -302,9 +400,13 @@ module UnivapayClientSdk
302
400
  " only_direct_currency: #{@only_direct_currency.inspect}, first_charge_capture_after:"\
303
401
  " #{@first_charge_capture_after.inspect}, first_charge_authorization_only:"\
304
402
  " #{@first_charge_authorization_only.inspect}, status: #{@status.inspect}, metadata:"\
305
- " #{@metadata.inspect}, mode: #{@mode.inspect}, created_on: #{@created_on.inspect}, period:"\
306
- " #{@period.inspect}, next_payment: #{@next_payment.inspect}, additional_properties:"\
307
- " #{@additional_properties}>"
403
+ " #{@metadata.inspect}, mode: #{@mode.inspect}, created_on: #{@created_on.inspect},"\
404
+ " three_ds: #{@three_ds.inspect}, period: #{@period.inspect}, cyclical_period:"\
405
+ " #{@cyclical_period.inspect}, next_payment: #{@next_payment.inspect}, cycles_left:"\
406
+ " #{@cycles_left.inspect}, subscription_plan: #{@subscription_plan.inspect},"\
407
+ " installment_plan: #{@installment_plan.inspect}, charge_id: #{@charge_id.inspect},"\
408
+ " amount_left: #{@amount_left.inspect}, amount_left_formatted:"\
409
+ " #{@amount_left_formatted.inspect}, additional_properties: #{@additional_properties}>"
308
410
  end
309
411
  end
310
412
  end
@@ -0,0 +1,116 @@
1
+ # univapay_client_sdk
2
+ #
3
+ # This file was automatically generated for Univapay
4
+ # by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module UnivapayClientSdk
7
+ # Installment plan applied to the subscription, as returned by the API. Covers
8
+ # both card-network installment plans (`revolving`, `fixed_cycles`) and legacy
9
+ # fixed-amount installment plans (`fixed_cycle_amount`).
10
+ class SubscriptionInstallmentPlanResponse < BaseModel
11
+ SKIP = Object.new
12
+ private_constant :SKIP
13
+
14
+ # Plan type selector.
15
+ # @return [CombinedPlanType]
16
+ attr_accessor :plan_type
17
+
18
+ # Number of installment cycles. Present when plan_type is fixed_cycles.
19
+ # @return [CombinedInstallmentFixedCycles]
20
+ attr_accessor :fixed_cycles
21
+
22
+ # Total target amount for the fixed_cycle_amount plan type, in the smallest
23
+ # currency unit. Present when plan_type is fixed_cycle_amount. Note the
24
+ # plural `fixed_cycles_amount` key differs from `subscription_plan`'s
25
+ # singular `fixed_cycle_amount`.
26
+ # @return [Integer]
27
+ attr_accessor :fixed_cycles_amount
28
+
29
+ # A mapping from model property names to API property names.
30
+ def self.names
31
+ @_hash = {} if @_hash.nil?
32
+ @_hash['plan_type'] = 'plan_type'
33
+ @_hash['fixed_cycles'] = 'fixed_cycles'
34
+ @_hash['fixed_cycles_amount'] = 'fixed_cycles_amount'
35
+ @_hash
36
+ end
37
+
38
+ # An array for optional fields
39
+ def self.optionals
40
+ %w[
41
+ plan_type
42
+ fixed_cycles
43
+ fixed_cycles_amount
44
+ ]
45
+ end
46
+
47
+ # An array for nullable fields
48
+ def self.nullables
49
+ %w[
50
+ fixed_cycles
51
+ fixed_cycles_amount
52
+ ]
53
+ end
54
+
55
+ def initialize(plan_type: SKIP, fixed_cycles: SKIP,
56
+ fixed_cycles_amount: SKIP, additional_properties: nil)
57
+ # Add additional model properties to the instance
58
+ additional_properties = {} if additional_properties.nil?
59
+
60
+ @plan_type = plan_type unless plan_type == SKIP
61
+ @fixed_cycles = fixed_cycles unless fixed_cycles == SKIP
62
+ @fixed_cycles_amount = fixed_cycles_amount unless fixed_cycles_amount == SKIP
63
+ @additional_properties = additional_properties
64
+ end
65
+
66
+ # Creates an instance of the object from a hash.
67
+ def self.from_hash(hash)
68
+ return nil unless hash
69
+
70
+ # Extract variables from the hash.
71
+ plan_type = hash.key?('plan_type') ? hash['plan_type'] : SKIP
72
+ fixed_cycles = hash.key?('fixed_cycles') ? hash['fixed_cycles'] : SKIP
73
+ fixed_cycles_amount =
74
+ hash.key?('fixed_cycles_amount') ? hash['fixed_cycles_amount'] : SKIP
75
+
76
+ # Create a new hash for additional properties, removing known properties.
77
+ new_hash = hash.reject { |k, _| names.value?(k) }
78
+
79
+ additional_properties = APIHelper.get_additional_properties(
80
+ new_hash, proc { |value| value }
81
+ )
82
+
83
+ # Create object from extracted values.
84
+ SubscriptionInstallmentPlanResponse.new(plan_type: plan_type,
85
+ fixed_cycles: fixed_cycles,
86
+ fixed_cycles_amount: fixed_cycles_amount,
87
+ additional_properties: additional_properties)
88
+ end
89
+
90
+ # Validates an instance of the object from a given value.
91
+ # @param [SubscriptionInstallmentPlanResponse | Hash] The value against the validation is performed.
92
+ def self.validate(value)
93
+ return true if value.instance_of? self
94
+
95
+ return false unless value.instance_of? Hash
96
+
97
+ true
98
+ end
99
+
100
+ # Provides a human-readable string representation of the object.
101
+ def to_s
102
+ class_name = self.class.name.split('::').last
103
+ "<#{class_name} plan_type: #{@plan_type}, fixed_cycles: #{@fixed_cycles},"\
104
+ " fixed_cycles_amount: #{@fixed_cycles_amount}, additional_properties:"\
105
+ " #{@additional_properties}>"
106
+ end
107
+
108
+ # Provides a debugging-friendly string with detailed object information.
109
+ def inspect
110
+ class_name = self.class.name.split('::').last
111
+ "<#{class_name} plan_type: #{@plan_type.inspect}, fixed_cycles: #{@fixed_cycles.inspect},"\
112
+ " fixed_cycles_amount: #{@fixed_cycles_amount.inspect}, additional_properties:"\
113
+ " #{@additional_properties}>"
114
+ end
115
+ end
116
+ end
@@ -78,14 +78,56 @@ module UnivapayClientSdk
78
78
  # @return [DateTime]
79
79
  attr_accessor :created_on
80
80
 
81
+ # 3-D Secure configuration and redirect details applied to the
82
+ # subscription's payments.
83
+ # @return [SubscriptionThreeDs]
84
+ attr_accessor :three_ds
85
+
81
86
  # Subscription Period schema.
82
87
  # @return [SubscriptionPeriod]
83
88
  attr_accessor :period
84
89
 
90
+ # ISO-8601 Duration for a custom billing frequency (e.g., P3D, P1M),
91
+ # returned instead of `period` when the subscription uses a custom cycle
92
+ # length rather than one of the fixed period presets. Mutually exclusive
93
+ # with `period` — exactly one of the two is present.
94
+ # @return [String]
95
+ attr_accessor :cyclical_period
96
+
85
97
  # Next scheduled payment details for a subscription.
86
98
  # @return [SubscriptionNextPayment]
87
99
  attr_accessor :next_payment
88
100
 
101
+ # Number of remaining billing cycles before the subscription completes. Only
102
+ # present for cycle-limited plans (`subscription_plan` or
103
+ # `installment_plan`); `null` for indefinite subscriptions.
104
+ # @return [Integer]
105
+ attr_accessor :cycles_left
106
+
107
+ # Configuration for limited-cycle subscriptions (Univapay side).
108
+ # @return [SubscriptionPlanSettings]
109
+ attr_accessor :subscription_plan
110
+
111
+ # Installment plan applied to the subscription, as returned by the API.
112
+ # Covers both card-network installment plans (`revolving`, `fixed_cycles`)
113
+ # and legacy fixed-amount installment plans (`fixed_cycle_amount`).
114
+ # @return [SubscriptionInstallmentPlanResponse]
115
+ attr_accessor :installment_plan
116
+
117
+ # Identifier of the charge associated with the subscription's installment
118
+ # plan. Only present when `installment_plan` is set.
119
+ # @return [UUID | String]
120
+ attr_accessor :charge_id
121
+
122
+ # Remaining amount to be charged over the life of the plan, in the smallest
123
+ # currency unit. Only present for cycle-limited plans.
124
+ # @return [Integer]
125
+ attr_accessor :amount_left
126
+
127
+ # `amount_left` formatted for display.
128
+ # @return [Float]
129
+ attr_accessor :amount_left_formatted
130
+
89
131
  # Merchant display name.
90
132
  # @return [String]
91
133
  attr_accessor :merchant_name
@@ -127,8 +169,16 @@ module UnivapayClientSdk
127
169
  @_hash['metadata'] = 'metadata'
128
170
  @_hash['mode'] = 'mode'
129
171
  @_hash['created_on'] = 'created_on'
172
+ @_hash['three_ds'] = 'three_ds'
130
173
  @_hash['period'] = 'period'
174
+ @_hash['cyclical_period'] = 'cyclical_period'
131
175
  @_hash['next_payment'] = 'next_payment'
176
+ @_hash['cycles_left'] = 'cycles_left'
177
+ @_hash['subscription_plan'] = 'subscription_plan'
178
+ @_hash['installment_plan'] = 'installment_plan'
179
+ @_hash['charge_id'] = 'charge_id'
180
+ @_hash['amount_left'] = 'amount_left'
181
+ @_hash['amount_left_formatted'] = 'amount_left_formatted'
132
182
  @_hash['merchant_name'] = 'merchant_name'
133
183
  @_hash['store_name'] = 'store_name'
134
184
  @_hash['payment_type'] = 'payment_type'
@@ -157,8 +207,16 @@ module UnivapayClientSdk
157
207
  metadata
158
208
  mode
159
209
  created_on
210
+ three_ds
160
211
  period
212
+ cyclical_period
161
213
  next_payment
214
+ cycles_left
215
+ subscription_plan
216
+ installment_plan
217
+ charge_id
218
+ amount_left
219
+ amount_left_formatted
162
220
  merchant_name
163
221
  store_name
164
222
  payment_type
@@ -174,6 +232,11 @@ module UnivapayClientSdk
174
232
  initial_amount_formatted
175
233
  subsequent_cycles_start
176
234
  first_charge_capture_after
235
+ cyclical_period
236
+ cycles_left
237
+ charge_id
238
+ amount_left
239
+ amount_left_formatted
177
240
  ]
178
241
  end
179
242
 
@@ -183,9 +246,13 @@ module UnivapayClientSdk
183
246
  subsequent_cycles_start: SKIP, schedule_settings: SKIP,
184
247
  only_direct_currency: SKIP, first_charge_capture_after: SKIP,
185
248
  first_charge_authorization_only: SKIP, status: SKIP,
186
- metadata: SKIP, mode: SKIP, created_on: SKIP, period: SKIP,
187
- next_payment: SKIP, merchant_name: SKIP, store_name: SKIP,
188
- payment_type: SKIP, next_payment_date: SKIP, user_data: SKIP,
249
+ metadata: SKIP, mode: SKIP, created_on: SKIP, three_ds: SKIP,
250
+ period: SKIP, cyclical_period: SKIP, next_payment: SKIP,
251
+ cycles_left: SKIP, subscription_plan: SKIP,
252
+ installment_plan: SKIP, charge_id: SKIP, amount_left: SKIP,
253
+ amount_left_formatted: SKIP, merchant_name: SKIP,
254
+ store_name: SKIP, payment_type: SKIP,
255
+ next_payment_date: SKIP, user_data: SKIP,
189
256
  additional_properties: nil)
190
257
  # Add additional model properties to the instance
191
258
  additional_properties = {} if additional_properties.nil?
@@ -213,8 +280,16 @@ module UnivapayClientSdk
213
280
  @metadata = metadata unless metadata == SKIP
214
281
  @mode = mode unless mode == SKIP
215
282
  @created_on = created_on unless created_on == SKIP
283
+ @three_ds = three_ds unless three_ds == SKIP
216
284
  @period = period unless period == SKIP
285
+ @cyclical_period = cyclical_period unless cyclical_period == SKIP
217
286
  @next_payment = next_payment unless next_payment == SKIP
287
+ @cycles_left = cycles_left unless cycles_left == SKIP
288
+ @subscription_plan = subscription_plan unless subscription_plan == SKIP
289
+ @installment_plan = installment_plan unless installment_plan == SKIP
290
+ @charge_id = charge_id unless charge_id == SKIP
291
+ @amount_left = amount_left unless amount_left == SKIP
292
+ @amount_left_formatted = amount_left_formatted unless amount_left_formatted == SKIP
218
293
  @merchant_name = merchant_name unless merchant_name == SKIP
219
294
  @store_name = store_name unless store_name == SKIP
220
295
  @payment_type = payment_type unless payment_type == SKIP
@@ -261,9 +336,21 @@ module UnivapayClientSdk
261
336
  else
262
337
  SKIP
263
338
  end
339
+ three_ds = SubscriptionThreeDs.from_hash(hash['three_ds']) if hash['three_ds']
264
340
  period = hash.key?('period') ? hash['period'] : SKIP
341
+ cyclical_period =
342
+ hash.key?('cyclical_period') ? hash['cyclical_period'] : SKIP
265
343
  next_payment = SubscriptionNextPayment.from_hash(hash['next_payment']) if
266
344
  hash['next_payment']
345
+ cycles_left = hash.key?('cycles_left') ? hash['cycles_left'] : SKIP
346
+ subscription_plan = SubscriptionPlanSettings.from_hash(hash['subscription_plan']) if
347
+ hash['subscription_plan']
348
+ installment_plan = SubscriptionInstallmentPlanResponse.from_hash(hash['installment_plan']) if
349
+ hash['installment_plan']
350
+ charge_id = hash.key?('charge_id') ? hash['charge_id'] : SKIP
351
+ amount_left = hash.key?('amount_left') ? hash['amount_left'] : SKIP
352
+ amount_left_formatted =
353
+ hash.key?('amount_left_formatted') ? hash['amount_left_formatted'] : SKIP
267
354
  merchant_name = hash.key?('merchant_name') ? hash['merchant_name'] : SKIP
268
355
  store_name = hash.key?('store_name') ? hash['store_name'] : SKIP
269
356
  payment_type = hash.key?('payment_type') ? hash['payment_type'] : SKIP
@@ -296,8 +383,16 @@ module UnivapayClientSdk
296
383
  metadata: metadata,
297
384
  mode: mode,
298
385
  created_on: created_on,
386
+ three_ds: three_ds,
299
387
  period: period,
388
+ cyclical_period: cyclical_period,
300
389
  next_payment: next_payment,
390
+ cycles_left: cycles_left,
391
+ subscription_plan: subscription_plan,
392
+ installment_plan: installment_plan,
393
+ charge_id: charge_id,
394
+ amount_left: amount_left,
395
+ amount_left_formatted: amount_left_formatted,
301
396
  merchant_name: merchant_name,
302
397
  store_name: store_name,
303
398
  payment_type: payment_type,
@@ -324,10 +419,14 @@ module UnivapayClientSdk
324
419
  " schedule_settings: #{@schedule_settings}, only_direct_currency: #{@only_direct_currency},"\
325
420
  " first_charge_capture_after: #{@first_charge_capture_after},"\
326
421
  " first_charge_authorization_only: #{@first_charge_authorization_only}, status: #{@status},"\
327
- " metadata: #{@metadata}, mode: #{@mode}, created_on: #{@created_on}, period: #{@period},"\
328
- " next_payment: #{@next_payment}, merchant_name: #{@merchant_name}, store_name:"\
329
- " #{@store_name}, payment_type: #{@payment_type}, next_payment_date: #{@next_payment_date},"\
330
- " user_data: #{@user_data}, additional_properties: #{@additional_properties}>"
422
+ " metadata: #{@metadata}, mode: #{@mode}, created_on: #{@created_on}, three_ds:"\
423
+ " #{@three_ds}, period: #{@period}, cyclical_period: #{@cyclical_period}, next_payment:"\
424
+ " #{@next_payment}, cycles_left: #{@cycles_left}, subscription_plan: #{@subscription_plan},"\
425
+ " installment_plan: #{@installment_plan}, charge_id: #{@charge_id}, amount_left:"\
426
+ " #{@amount_left}, amount_left_formatted: #{@amount_left_formatted}, merchant_name:"\
427
+ " #{@merchant_name}, store_name: #{@store_name}, payment_type: #{@payment_type},"\
428
+ " next_payment_date: #{@next_payment_date}, user_data: #{@user_data}, additional_properties:"\
429
+ " #{@additional_properties}>"
331
430
  end
332
431
 
333
432
  # Provides a debugging-friendly string with detailed object information.
@@ -342,11 +441,16 @@ module UnivapayClientSdk
342
441
  " only_direct_currency: #{@only_direct_currency.inspect}, first_charge_capture_after:"\
343
442
  " #{@first_charge_capture_after.inspect}, first_charge_authorization_only:"\
344
443
  " #{@first_charge_authorization_only.inspect}, status: #{@status.inspect}, metadata:"\
345
- " #{@metadata.inspect}, mode: #{@mode.inspect}, created_on: #{@created_on.inspect}, period:"\
346
- " #{@period.inspect}, next_payment: #{@next_payment.inspect}, merchant_name:"\
347
- " #{@merchant_name.inspect}, store_name: #{@store_name.inspect}, payment_type:"\
348
- " #{@payment_type.inspect}, next_payment_date: #{@next_payment_date.inspect}, user_data:"\
349
- " #{@user_data.inspect}, additional_properties: #{@additional_properties}>"
444
+ " #{@metadata.inspect}, mode: #{@mode.inspect}, created_on: #{@created_on.inspect},"\
445
+ " three_ds: #{@three_ds.inspect}, period: #{@period.inspect}, cyclical_period:"\
446
+ " #{@cyclical_period.inspect}, next_payment: #{@next_payment.inspect}, cycles_left:"\
447
+ " #{@cycles_left.inspect}, subscription_plan: #{@subscription_plan.inspect},"\
448
+ " installment_plan: #{@installment_plan.inspect}, charge_id: #{@charge_id.inspect},"\
449
+ " amount_left: #{@amount_left.inspect}, amount_left_formatted:"\
450
+ " #{@amount_left_formatted.inspect}, merchant_name: #{@merchant_name.inspect}, store_name:"\
451
+ " #{@store_name.inspect}, payment_type: #{@payment_type.inspect}, next_payment_date:"\
452
+ " #{@next_payment_date.inspect}, user_data: #{@user_data.inspect}, additional_properties:"\
453
+ " #{@additional_properties}>"
350
454
  end
351
455
  end
352
456
  end
@@ -79,6 +79,16 @@ module UnivapayClientSdk
79
79
  additional_properties: additional_properties)
80
80
  end
81
81
 
82
+ # Validates an instance of the object from a given value.
83
+ # @param [SubscriptionPlanSettings | Hash] The value against the validation is performed.
84
+ def self.validate(value)
85
+ return true if value.instance_of? self
86
+
87
+ return false unless value.instance_of? Hash
88
+
89
+ true
90
+ end
91
+
82
92
  # Provides a human-readable string representation of the object.
83
93
  def to_s
84
94
  class_name = self.class.name.split('::').last
@@ -0,0 +1,114 @@
1
+ # univapay_client_sdk
2
+ #
3
+ # This file was automatically generated for Univapay
4
+ # by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module UnivapayClientSdk
7
+ # 3-D Secure configuration and redirect details applied to the subscription's
8
+ # payments.
9
+ class SubscriptionThreeDs < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # 3-D Secure authentication mode applied to the subscription's payments.
14
+ # `if_available` enforces 3DS only if credentials are available for the
15
+ # recurring token and it has not already completed 3DS. `provided` indicates
16
+ # externally supplied MPI authentication data was used.
17
+ # @return [SubscriptionThreeDsMode]
18
+ attr_accessor :mode
19
+
20
+ # URL the customer is redirected to for 3-D Secure authentication.
21
+ # @return [String]
22
+ attr_accessor :redirect_endpoint
23
+
24
+ # Identifier of the 3-D Secure redirect.
25
+ # @return [UUID | String]
26
+ attr_accessor :redirect_id
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['mode'] = 'mode'
32
+ @_hash['redirect_endpoint'] = 'redirect_endpoint'
33
+ @_hash['redirect_id'] = 'redirect_id'
34
+ @_hash
35
+ end
36
+
37
+ # An array for optional fields
38
+ def self.optionals
39
+ %w[
40
+ mode
41
+ redirect_endpoint
42
+ redirect_id
43
+ ]
44
+ end
45
+
46
+ # An array for nullable fields
47
+ def self.nullables
48
+ %w[
49
+ mode
50
+ redirect_endpoint
51
+ redirect_id
52
+ ]
53
+ end
54
+
55
+ def initialize(mode: SKIP, redirect_endpoint: SKIP, redirect_id: SKIP,
56
+ additional_properties: nil)
57
+ # Add additional model properties to the instance
58
+ additional_properties = {} if additional_properties.nil?
59
+
60
+ @mode = mode unless mode == SKIP
61
+ @redirect_endpoint = redirect_endpoint unless redirect_endpoint == SKIP
62
+ @redirect_id = redirect_id unless redirect_id == SKIP
63
+ @additional_properties = additional_properties
64
+ end
65
+
66
+ # Creates an instance of the object from a hash.
67
+ def self.from_hash(hash)
68
+ return nil unless hash
69
+
70
+ # Extract variables from the hash.
71
+ mode = hash.key?('mode') ? hash['mode'] : SKIP
72
+ redirect_endpoint =
73
+ hash.key?('redirect_endpoint') ? hash['redirect_endpoint'] : SKIP
74
+ redirect_id = hash.key?('redirect_id') ? hash['redirect_id'] : SKIP
75
+
76
+ # Create a new hash for additional properties, removing known properties.
77
+ new_hash = hash.reject { |k, _| names.value?(k) }
78
+
79
+ additional_properties = APIHelper.get_additional_properties(
80
+ new_hash, proc { |value| value }
81
+ )
82
+
83
+ # Create object from extracted values.
84
+ SubscriptionThreeDs.new(mode: mode,
85
+ redirect_endpoint: redirect_endpoint,
86
+ redirect_id: redirect_id,
87
+ additional_properties: additional_properties)
88
+ end
89
+
90
+ # Validates an instance of the object from a given value.
91
+ # @param [SubscriptionThreeDs | Hash] The value against the validation is performed.
92
+ def self.validate(value)
93
+ return true if value.instance_of? self
94
+
95
+ return false unless value.instance_of? Hash
96
+
97
+ true
98
+ end
99
+
100
+ # Provides a human-readable string representation of the object.
101
+ def to_s
102
+ class_name = self.class.name.split('::').last
103
+ "<#{class_name} mode: #{@mode}, redirect_endpoint: #{@redirect_endpoint}, redirect_id:"\
104
+ " #{@redirect_id}, additional_properties: #{@additional_properties}>"
105
+ end
106
+
107
+ # Provides a debugging-friendly string with detailed object information.
108
+ def inspect
109
+ class_name = self.class.name.split('::').last
110
+ "<#{class_name} mode: #{@mode.inspect}, redirect_endpoint: #{@redirect_endpoint.inspect},"\
111
+ " redirect_id: #{@redirect_id.inspect}, additional_properties: #{@additional_properties}>"
112
+ end
113
+ end
114
+ end
@@ -0,0 +1,55 @@
1
+ # univapay_client_sdk
2
+ #
3
+ # This file was automatically generated for Univapay
4
+ # by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module UnivapayClientSdk
7
+ # 3-D Secure authentication mode applied to the subscription's payments.
8
+ # `if_available` enforces 3DS only if credentials are available for the
9
+ # recurring token and it has not already completed 3DS. `provided` indicates
10
+ # externally supplied MPI authentication data was used.
11
+ class SubscriptionThreeDsMode
12
+ SUBSCRIPTION_THREE_DS_MODE = [
13
+ # TODO: Write general description for NORMAL
14
+ NORMAL = 'normal'.freeze,
15
+
16
+ # TODO: Write general description for REQUIRE
17
+ REQUIRE = 'require'.freeze,
18
+
19
+ # TODO: Write general description for FORCE
20
+ FORCE = 'force'.freeze,
21
+
22
+ # TODO: Write general description for SKIP
23
+ SKIP = 'skip'.freeze,
24
+
25
+ # TODO: Write general description for IF_AVAILABLE
26
+ IF_AVAILABLE = 'if_available'.freeze,
27
+
28
+ # TODO: Write general description for PROVIDED
29
+ PROVIDED = 'provided'.freeze
30
+ ].freeze
31
+
32
+ def self.validate(value)
33
+ return false if value.nil?
34
+
35
+ SUBSCRIPTION_THREE_DS_MODE.include?(value)
36
+ end
37
+
38
+ def self.from_value(value, default_value = NORMAL)
39
+ return default_value if value.nil?
40
+
41
+ str = value.to_s.strip
42
+
43
+ case str.downcase
44
+ when 'normal' then NORMAL
45
+ when 'require' then REQUIRE
46
+ when 'force' then FORCE
47
+ when 'skip' then SKIP
48
+ when 'if_available' then IF_AVAILABLE
49
+ when 'provided' then PROVIDED
50
+ else
51
+ default_value
52
+ end
53
+ end
54
+ end
55
+ end
@@ -128,6 +128,9 @@ require_relative 'univapay_client_sdk/models/subscription_update_next_payment'
128
128
  require_relative 'univapay_client_sdk/models/subscription_next_payment'
129
129
  require_relative 'univapay_client_sdk/models/subscription_installment_plan'
130
130
  require_relative 'univapay_client_sdk/models/subscription_plan_settings'
131
+ require_relative 'univapay_client_sdk/models/' \
132
+ 'subscription_installment_plan_response'
133
+ require_relative 'univapay_client_sdk/models/subscription_three_ds'
131
134
  require_relative 'univapay_client_sdk/models/subscription_list_item'
132
135
  require_relative 'univapay_client_sdk/models/subscription_user_data'
133
136
  require_relative 'univapay_client_sdk/models/subscription_list'
@@ -315,6 +318,7 @@ require_relative 'univapay_client_sdk/models/' \
315
318
  require_relative 'univapay_client_sdk/models/bank_transfer_ledger_mode'
316
319
  require_relative 'univapay_client_sdk/models/subscription_update_status'
317
320
  require_relative 'univapay_client_sdk/models/subscription_terminate_with_status'
321
+ require_relative 'univapay_client_sdk/models/subscription_three_ds_mode'
318
322
  require_relative 'univapay_client_sdk/models/subscription_period'
319
323
  require_relative 'univapay_client_sdk/models/subscription_termination_mode'
320
324
  require_relative 'univapay_client_sdk/models/subscription_status'
@@ -350,6 +354,8 @@ require_relative 'univapay_client_sdk/models/transaction_history_refund_status'
350
354
  require_relative 'univapay_client_sdk/models/bank_transfer_event'
351
355
  require_relative 'univapay_client_sdk/models/cancel_event'
352
356
  require_relative 'univapay_client_sdk/models/charge_event'
357
+ require_relative 'univapay_client_sdk/models/combined_installment_fixed_cycles'
358
+ require_relative 'univapay_client_sdk/models/combined_plan_type'
353
359
  require_relative 'univapay_client_sdk/models/customs_declaration_event'
354
360
  require_relative 'univapay_client_sdk/models/installment_fixed_cycles'
355
361
  require_relative 'univapay_client_sdk/models/installment_plan_type'
@@ -44,10 +44,11 @@ class SubscriptionsApiTest < ApiTestBase
44
44
  'ia/Tokyo","preserve_end_of_month":false,"retry_interval":"P7D","termina'\
45
45
  'tion_mode":"immediate"},"only_direct_currency":false,"first_charge_auth'\
46
46
  'orization_only":false,"status":"current","metadata":{"order_id":"ORD-98'\
47
- '7"},"mode":"live","created_on":"2024-06-26T01:51:28.627023Z","period":"'\
48
- 'monthly","next_payment":{"id":"11ef3360-1f9a-c54a-8313-7f9847da313b","d'\
49
- 'ue_date":"2024-07-26","zone_id":"Asia/Tokyo","amount":1250,"currency":"'\
50
- 'USD","amount_formatted":12.5,"is_paid":false}}'
47
+ '7"},"mode":"live","created_on":"2024-06-26T01:51:28.627023Z","three_ds"'\
48
+ ':{"mode":"normal","redirect_endpoint":null,"redirect_id":null},"period"'\
49
+ ':"monthly","next_payment":{"id":"11ef3360-1f9a-c54a-8313-7f9847da313b",'\
50
+ '"due_date":"2024-07-26","zone_id":"Asia/Tokyo","amount":1250,"currency"'\
51
+ ':"USD","amount_formatted":12.5,"is_paid":false}}'
51
52
  )
52
53
  received_body = JSON.parse(@response_catcher.response.raw_body)
53
54
  assert(ComparisonHelper.match_body(expected_body, received_body))
@@ -84,29 +85,36 @@ class SubscriptionsApiTest < ApiTestBase
84
85
  'f541-c42d-653c-8c3d-dfe0a55f95c0","transaction_token_id":"11ef3413-dddd'\
85
86
  '-4ef0-b142-4d5e6f809193","amount":1250,"currency":"USD","amount_formatt'\
86
87
  'ed":12.5,"status":"current","mode":"live","created_on":"2024-06-26T01:5'\
87
- '1:28.627023Z","schedule_settings":{"zone_id":"Asia/Tokyo","retry_interv'\
88
- 'al":"P7D","termination_mode":"immediate"},"merchant_name":"管理画面ガイド","st'\
89
- 'ore_name":"管理画面ガイド_TEST店舗","payment_type":"card","next_payment_date":"2'\
90
- '024-07-26","user_data":{"type":"charge","cardholder_name":"taro yamada"'\
91
- ',"email":"taro@test.com","brand":"visa"}},{"id":"11ef3411-bbbb-4cde-9f2'\
92
- '0-2b3c4d5e6f71","store_id":"22af6520-d53e-764d-9d4e-ef01b66fa6d1","tran'\
93
- 'saction_token_id":"11ef3414-eeee-4f01-c253-5e6f80919204","amount":3000,'\
94
- '"currency":"JPY","amount_formatted":3000,"status":"current","mode":"liv'\
95
- 'e","created_on":"2024-07-11T09:20:00.627023Z","schedule_settings":{"zon'\
88
+ '1:28.627023Z","three_ds":{"mode":"normal","redirect_endpoint":null,"red'\
89
+ 'irect_id":null},"schedule_settings":{"zone_id":"Asia/Tokyo","retry_inte'\
90
+ 'rval":"P7D","termination_mode":"immediate"},"subscription_plan":{"plan_'\
91
+ 'type":"fixed_cycles","fixed_cycles":12},"merchant_name":"管理画面ガイド","stor'\
92
+ 'e_name":"管理画面ガイド_TEST店舗","payment_type":"card","next_payment_date":"202'\
93
+ '4-07-26","user_data":{"type":"charge","cardholder_name":"taro yamada","'\
94
+ 'email":"taro@test.com","brand":"visa"}},{"id":"11ef3411-bbbb-4cde-9f20-'\
95
+ '2b3c4d5e6f71","store_id":"22af6520-d53e-764d-9d4e-ef01b66fa6d1","transa'\
96
+ 'ction_token_id":"11ef3414-eeee-4f01-c253-5e6f80919204","amount":3000,"c'\
97
+ 'urrency":"JPY","amount_formatted":3000,"status":"current","mode":"live"'\
98
+ ',"created_on":"2024-07-11T09:20:00.627023Z","three_ds":{"mode":"normal"'\
99
+ ',"redirect_endpoint":null,"redirect_id":null},"schedule_settings":{"zon'\
96
100
  'e_id":"Asia/Tokyo","retry_interval":"P7D","termination_mode":"immediate'\
97
- '"},"merchant_name":"管理画面ガイド","store_name":"管理画面ガイド_Online店舗","payment_t'\
98
- 'ype":"card","next_payment_date":"2024-08-10","user_data":{"type":"charg'\
99
- 'e","cardholder_name":"hanako suzuki","email":"hanako@test.com","brand":'\
100
- '"mastercard"}},{"id":"11ef3412-cccc-4def-a031-3c4d5e6f8082","store_id":'\
101
- '"33af7631-e64f-875e-ae5f-f012c77fb7e2","transaction_token_id":"11ef3415'\
102
- '-ffff-4012-d364-6f8091920315","amount":9800,"currency":"JPY","amount_fo'\
103
- 'rmatted":9800,"status":"suspended","mode":"live","created_on":"2024-08-'\
104
- '15T13:05:22.627023Z","schedule_settings":{"zone_id":"Asia/Tokyo","retry'\
105
- '_interval":"P7D","termination_mode":"on_next_payment"},"merchant_name":'\
106
- '"管理画面ガイド","store_name":"管理画面ガイド_Osaka店舗","payment_type":"card","next_pa'\
107
- 'yment_date":"2024-09-15","user_data":{"type":"charge","cardholder_name"'\
108
- ':"jiro tanaka","email":"jiro@test.com","brand":"jcb"}}],"has_more":fals'\
109
- 'e,"total_hits":3}'
101
+ '"},"installment_plan":{"plan_type":"fixed_cycle_amount","fixed_cycles":'\
102
+ 'null,"fixed_cycles_amount":30000},"merchant_name":"管理画面ガイド","store_name'\
103
+ '":"管理画面ガイド_Online店舗","payment_type":"card","next_payment_date":"2024-08'\
104
+ '-10","user_data":{"type":"charge","cardholder_name":"hanako suzuki","em'\
105
+ 'ail":"hanako@test.com","brand":"mastercard"}},{"id":"11ef3412-cccc-4def'\
106
+ '-a031-3c4d5e6f8082","store_id":"33af7631-e64f-875e-ae5f-f012c77fb7e2","'\
107
+ 'transaction_token_id":"11ef3415-ffff-4012-d364-6f8091920315","amount":9'\
108
+ '800,"currency":"JPY","amount_formatted":9800,"status":"suspended","mode'\
109
+ '":"live","created_on":"2024-08-15T13:05:22.627023Z","three_ds":{"mode":'\
110
+ '"normal","redirect_endpoint":null,"redirect_id":null},"schedule_setting'\
111
+ 's":{"zone_id":"Asia/Tokyo","retry_interval":"P7D","termination_mode":"o'\
112
+ 'n_next_payment"},"installment_plan":{"plan_type":"revolving","fixed_cyc'\
113
+ 'les":null,"fixed_cycles_amount":null},"merchant_name":"管理画面ガイド","store_'\
114
+ 'name":"管理画面ガイド_Osaka店舗","payment_type":"card","next_payment_date":"2024'\
115
+ '-09-15","user_data":{"type":"charge","cardholder_name":"jiro tanaka","e'\
116
+ 'mail":"jiro@test.com","brand":"jcb"}}],"has_more":false,"total_hits":3}'\
117
+ ''
110
118
  )
111
119
  received_body = JSON.parse(@response_catcher.response.raw_body)
112
120
  assert(ComparisonHelper.match_body(expected_body, received_body))
@@ -179,15 +187,18 @@ class SubscriptionsApiTest < ApiTestBase
179
187
  'f541-c42d-653c-8c3d-dfe0a55f95c0","transaction_token_id":"11ef32a7-3a71'\
180
188
  '-8662-803f-1bc27702eeec","amount":1250,"currency":"USD","amount_formatt'\
181
189
  'ed":12.5,"status":"current","mode":"live","created_on":"2024-06-26T01:5'\
182
- '1:28.627023Z","schedule_settings":{"zone_id":"Asia/Tokyo","retry_interv'\
183
- 'al":"P7D","termination_mode":"immediate"},"merchant_name":"管理画面ガイド","st'\
184
- 'ore_name":"管理画面ガイド_TEST店舗","payment_type":"card","next_payment_date":"2'\
185
- '024-07-26","user_data":{"type":"charge","cardholder_name":"taro yamada"'\
186
- ',"email":"test@test.com","brand":"visa"}},{"id":"11ef3401-1a2b-4c3d-8e4'\
187
- 'f-5a6b7c8d9e0f","store_id":"11edf541-c42d-653c-8c3d-dfe0a55f95c0","tran'\
188
- 'saction_token_id":"11ef3402-2b3c-4d5e-9f60-6b7c8d9e0f11","amount":5000,'\
189
- '"currency":"JPY","amount_formatted":5000,"status":"current","mode":"liv'\
190
- 'e","created_on":"2024-07-01T10:00:00.627023Z","schedule_settings":{"zon'\
190
+ '1:28.627023Z","three_ds":{"mode":"normal","redirect_endpoint":null,"red'\
191
+ 'irect_id":null},"schedule_settings":{"zone_id":"Asia/Tokyo","retry_inte'\
192
+ 'rval":"P7D","termination_mode":"immediate"},"subscription_plan":{"plan_'\
193
+ 'type":"fixed_cycles","fixed_cycles":12},"merchant_name":"管理画面ガイド","stor'\
194
+ 'e_name":"管理画面ガイド_TEST店舗","payment_type":"card","next_payment_date":"202'\
195
+ '4-07-26","user_data":{"type":"charge","cardholder_name":"taro yamada","'\
196
+ 'email":"test@test.com","brand":"visa"}},{"id":"11ef3401-1a2b-4c3d-8e4f-'\
197
+ '5a6b7c8d9e0f","store_id":"11edf541-c42d-653c-8c3d-dfe0a55f95c0","transa'\
198
+ 'ction_token_id":"11ef3402-2b3c-4d5e-9f60-6b7c8d9e0f11","amount":5000,"c'\
199
+ 'urrency":"JPY","amount_formatted":5000,"status":"current","mode":"live"'\
200
+ ',"created_on":"2024-07-01T10:00:00.627023Z","three_ds":{"mode":"normal"'\
201
+ ',"redirect_endpoint":null,"redirect_id":null},"schedule_settings":{"zon'\
191
202
  'e_id":"Asia/Tokyo","retry_interval":"P7D","termination_mode":"immediate'\
192
203
  '"},"merchant_name":"管理画面ガイド","store_name":"管理画面ガイド_TEST店舗","payment_typ'\
193
204
  'e":"card","next_payment_date":"2024-08-01","user_data":{"type":"charge"'\
@@ -196,12 +207,14 @@ class SubscriptionsApiTest < ApiTestBase
196
207
  '1edf541-c42d-653c-8c3d-dfe0a55f95c0","transaction_token_id":"11ef3404-4'\
197
208
  'd5e-6f70-b182-8d9e0f112233","amount":9800,"currency":"JPY","amount_form'\
198
209
  'atted":9800,"status":"suspended","mode":"live","created_on":"2024-08-15'\
199
- 'T13:05:22.627023Z","schedule_settings":{"zone_id":"Asia/Tokyo","retry_i'\
200
- 'nterval":"P7D","termination_mode":"on_next_payment"},"merchant_name":"管'\
201
- '理画面ガイド","store_name":"管理画面ガイド_TEST店舗","payment_type":"card","next_payme'\
202
- 'nt_date":"2024-09-15","user_data":{"type":"charge","cardholder_name":"j'\
203
- 'iro tanaka","email":"jiro@test.com","brand":"jcb"}}],"has_more":false,"'\
204
- 'total_hits":3}'
210
+ 'T13:05:22.627023Z","three_ds":{"mode":"normal","redirect_endpoint":null'\
211
+ ',"redirect_id":null},"schedule_settings":{"zone_id":"Asia/Tokyo","retry'\
212
+ '_interval":"P7D","termination_mode":"on_next_payment"},"installment_pla'\
213
+ 'n":{"plan_type":"revolving","fixed_cycles":null,"fixed_cycles_amount":n'\
214
+ 'ull},"merchant_name":"管理画面ガイド","store_name":"管理画面ガイド_TEST店舗","payment_t'\
215
+ 'ype":"card","next_payment_date":"2024-09-15","user_data":{"type":"charg'\
216
+ 'e","cardholder_name":"jiro tanaka","email":"jiro@test.com","brand":"jcb'\
217
+ '"}}],"has_more":false,"total_hits":3}'
205
218
  )
206
219
  received_body = JSON.parse(@response_catcher.response.raw_body)
207
220
  assert(ComparisonHelper.match_body(expected_body, received_body))
@@ -273,11 +286,14 @@ class SubscriptionsApiTest < ApiTestBase
273
286
  'tion_mode":"immediate"},"only_direct_currency":false,"first_charge_capt'\
274
287
  'ure_after":null,"first_charge_authorization_only":false,"status":"curre'\
275
288
  'nt","metadata":{"order_id":"12345"},"mode":"test","created_on":"2024-06'\
276
- '-26T01:51:28.627023Z","period":"monthly","next_payment":{"id":"11ef335e'\
277
- '-9ae2-8322-8e79-e7ba4b56234e","due_date":"2024-07-26","zone_id":"Asia/T'\
278
- 'okyo","amount":1250,"currency":"USD","amount_formatted":12.5,"is_paid":'\
279
- 'false,"is_last_payment":false,"created_on":"2024-06-26T01:51:29.025129Z'\
280
- '","updated_on":"2024-06-26T01:51:29.025129Z","retry_date":null}}'
289
+ '-26T01:51:28.627023Z","three_ds":{"mode":"normal","redirect_endpoint":n'\
290
+ 'ull,"redirect_id":null},"period":"monthly","next_payment":{"id":"11ef33'\
291
+ '5e-9ae2-8322-8e79-e7ba4b56234e","due_date":"2024-07-26","zone_id":"Asia'\
292
+ '/Tokyo","amount":1250,"currency":"USD","amount_formatted":12.5,"is_paid'\
293
+ '":false,"is_last_payment":false,"created_on":"2024-06-26T01:51:29.02512'\
294
+ '9Z","updated_on":"2024-06-26T01:51:29.025129Z","retry_date":null},"cycl'\
295
+ 'es_left":5,"subscription_plan":{"plan_type":"fixed_cycles","fixed_cycle'\
296
+ 's":12},"amount_left":6250,"amount_left_formatted":62.5}'
281
297
  )
282
298
  received_body = JSON.parse(@response_catcher.response.raw_body)
283
299
  assert(ComparisonHelper.match_body(expected_body, received_body))
@@ -318,11 +334,13 @@ class SubscriptionsApiTest < ApiTestBase
318
334
  'tion_mode":"on_next_payment"},"only_direct_currency":false,"first_charg'\
319
335
  'e_capture_after":null,"first_charge_authorization_only":false,"status":'\
320
336
  '"current","metadata":{"order_id":"12345"},"mode":"test","created_on":"2'\
321
- '024-06-26T01:51:28.627023Z","period":"monthly","next_payment":{"id":"11'\
322
- 'ef335e-9ae2-8322-8e79-e7ba4b56234e","due_date":"2030-01-01","zone_id":"'\
323
- 'Asia/Tokyo","amount":1250,"currency":"USD","amount_formatted":12.5,"is_'\
324
- 'paid":false,"is_last_payment":false,"created_on":"2024-06-26T01:51:29.0'\
325
- '25129Z","updated_on":"2024-06-26T01:51:29.025129Z","retry_date":null}}'
337
+ '024-06-26T01:51:28.627023Z","three_ds":{"mode":"normal","redirect_endpo'\
338
+ 'int":null,"redirect_id":null},"period":"monthly","next_payment":{"id":"'\
339
+ '11ef335e-9ae2-8322-8e79-e7ba4b56234e","due_date":"2030-01-01","zone_id"'\
340
+ ':"Asia/Tokyo","amount":1250,"currency":"USD","amount_formatted":12.5,"i'\
341
+ 's_paid":false,"is_last_payment":false,"created_on":"2024-06-26T01:51:29'\
342
+ '.025129Z","updated_on":"2024-06-26T01:51:29.025129Z","retry_date":null}'\
343
+ '}'
326
344
  )
327
345
  received_body = JSON.parse(@response_catcher.response.raw_body)
328
346
  assert(ComparisonHelper.match_body(expected_body, received_body))
@@ -595,7 +613,8 @@ class SubscriptionsApiTest < ApiTestBase
595
613
  'schedule_settings":{"start_on":"2024-07-01","zone_id":"Asia/Tokyo","pre'\
596
614
  'serve_end_of_month":false,"retry_interval":"P7D","termination_mode":"on'\
597
615
  '_next_payment"},"status":"suspended","mode":"test","created_on":"2024-0'\
598
- '6-26T01:51:28.627023Z","period":"monthly"}'
616
+ '6-26T01:51:28.627023Z","three_ds":{"mode":"normal","redirect_endpoint":'\
617
+ 'null,"redirect_id":null},"period":"monthly"}'
599
618
  )
600
619
  received_body = JSON.parse(@response_catcher.response.raw_body)
601
620
  assert(ComparisonHelper.match_body(expected_body, received_body))
@@ -630,7 +649,8 @@ class SubscriptionsApiTest < ApiTestBase
630
649
  'schedule_settings":{"start_on":"2024-07-01","zone_id":"Asia/Tokyo","pre'\
631
650
  'serve_end_of_month":false,"retry_interval":"P7D","termination_mode":"im'\
632
651
  'mediate"},"status":"unpaid","mode":"test","created_on":"2024-06-26T01:5'\
633
- '1:28.627023Z","period":"monthly"}'
652
+ '1:28.627023Z","three_ds":{"mode":"normal","redirect_endpoint":null,"red'\
653
+ 'irect_id":null},"period":"monthly"}'
634
654
  )
635
655
  received_body = JSON.parse(@response_catcher.response.raw_body)
636
656
  assert(ComparisonHelper.match_body(expected_body, received_body))
@@ -667,7 +687,8 @@ class SubscriptionsApiTest < ApiTestBase
667
687
  'schedule_settings":{"start_on":"2024-07-01","zone_id":"Asia/Tokyo","pre'\
668
688
  'serve_end_of_month":false,"retry_interval":"P7D","termination_mode":"im'\
669
689
  'mediate"},"status":"current","mode":"test","created_on":"2024-06-26T01:'\
670
- '51:28.627023Z","period":"monthly"}'
690
+ '51:28.627023Z","three_ds":{"mode":"normal","redirect_endpoint":null,"re'\
691
+ 'direct_id":null},"period":"monthly"}'
671
692
  )
672
693
  received_body = JSON.parse(@response_catcher.response.raw_body)
673
694
  assert(ComparisonHelper.match_body(expected_body, received_body))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: univapay-client-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Univapay Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-18 00:00:00.000000000 Z
11
+ date: 2026-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apimatic_core_interfaces
@@ -210,6 +210,8 @@ files:
210
210
  - lib/univapay_client_sdk/models/checkout_supported_brand.rb
211
211
  - lib/univapay_client_sdk/models/checkout_theme.rb
212
212
  - lib/univapay_client_sdk/models/checkout_theme_colors.rb
213
+ - lib/univapay_client_sdk/models/combined_installment_fixed_cycles.rb
214
+ - lib/univapay_client_sdk/models/combined_plan_type.rb
213
215
  - lib/univapay_client_sdk/models/create_customer_id_request.rb
214
216
  - lib/univapay_client_sdk/models/create_customer_id_response.rb
215
217
  - lib/univapay_client_sdk/models/cursor_direction_query.rb
@@ -303,6 +305,7 @@ files:
303
305
  - lib/univapay_client_sdk/models/subscription_create_request.rb
304
306
  - lib/univapay_client_sdk/models/subscription_event.rb
305
307
  - lib/univapay_client_sdk/models/subscription_installment_plan.rb
308
+ - lib/univapay_client_sdk/models/subscription_installment_plan_response.rb
306
309
  - lib/univapay_client_sdk/models/subscription_list.rb
307
310
  - lib/univapay_client_sdk/models/subscription_list_item.rb
308
311
  - lib/univapay_client_sdk/models/subscription_next_payment.rb
@@ -321,6 +324,8 @@ files:
321
324
  - lib/univapay_client_sdk/models/subscription_suspend_request.rb
322
325
  - lib/univapay_client_sdk/models/subscription_terminate_with_status.rb
323
326
  - lib/univapay_client_sdk/models/subscription_termination_mode.rb
327
+ - lib/univapay_client_sdk/models/subscription_three_ds.rb
328
+ - lib/univapay_client_sdk/models/subscription_three_ds_mode.rb
324
329
  - lib/univapay_client_sdk/models/subscription_update_next_payment.rb
325
330
  - lib/univapay_client_sdk/models/subscription_update_request.rb
326
331
  - lib/univapay_client_sdk/models/subscription_update_schedule_settings.rb