bk-apimatic-sdk 1.0.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.
Files changed (140) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +203 -0
  4. data/bin/console +15 -0
  5. data/lib/boku_direct_payments_api/api_helper.rb +10 -0
  6. data/lib/boku_direct_payments_api/client.rb +99 -0
  7. data/lib/boku_direct_payments_api/configuration.rb +168 -0
  8. data/lib/boku_direct_payments_api/controllers/account_resources_controller.rb +45 -0
  9. data/lib/boku_direct_payments_api/controllers/base_controller.rb +60 -0
  10. data/lib/boku_direct_payments_api/controllers/charge_controller.rb +247 -0
  11. data/lib/boku_direct_payments_api/controllers/config_resources_controller.rb +50 -0
  12. data/lib/boku_direct_payments_api/controllers/consumer_registration_controller.rb +428 -0
  13. data/lib/boku_direct_payments_api/controllers/forex_controller.rb +38 -0
  14. data/lib/boku_direct_payments_api/controllers/fund_check_controller.rb +39 -0
  15. data/lib/boku_direct_payments_api/controllers/refund_controller.rb +80 -0
  16. data/lib/boku_direct_payments_api/controllers/seller_of_record_controller.rb +69 -0
  17. data/lib/boku_direct_payments_api/exceptions/api_exception.rb +21 -0
  18. data/lib/boku_direct_payments_api/http/http_call_back.rb +10 -0
  19. data/lib/boku_direct_payments_api/http/http_method_enum.rb +10 -0
  20. data/lib/boku_direct_payments_api/http/http_request.rb +10 -0
  21. data/lib/boku_direct_payments_api/http/http_response.rb +10 -0
  22. data/lib/boku_direct_payments_api/http/proxy_settings.rb +22 -0
  23. data/lib/boku_direct_payments_api/models/account_profile.rb +122 -0
  24. data/lib/boku_direct_payments_api/models/account_profile_attribute.rb +90 -0
  25. data/lib/boku_direct_payments_api/models/account_profile_request.rb +131 -0
  26. data/lib/boku_direct_payments_api/models/account_profile_response.rb +104 -0
  27. data/lib/boku_direct_payments_api/models/account_profile_response_record.rb +142 -0
  28. data/lib/boku_direct_payments_api/models/account_profile_result_status_enum.rb +47 -0
  29. data/lib/boku_direct_payments_api/models/account_profile_selector.rb +132 -0
  30. data/lib/boku_direct_payments_api/models/base_model.rb +110 -0
  31. data/lib/boku_direct_payments_api/models/begin_single_charge_request.rb +360 -0
  32. data/lib/boku_direct_payments_api/models/begin_single_charge_request_hosted.rb +110 -0
  33. data/lib/boku_direct_payments_api/models/begin_single_charge_request_qr_info.rb +74 -0
  34. data/lib/boku_direct_payments_api/models/begin_single_charge_response.rb +254 -0
  35. data/lib/boku_direct_payments_api/models/begin_single_charge_response_hosted.rb +90 -0
  36. data/lib/boku_direct_payments_api/models/begin_single_charge_response_qr_info.rb +85 -0
  37. data/lib/boku_direct_payments_api/models/business_details.rb +209 -0
  38. data/lib/boku_direct_payments_api/models/cancel_optin_request.rb +123 -0
  39. data/lib/boku_direct_payments_api/models/cancel_optin_response.rb +143 -0
  40. data/lib/boku_direct_payments_api/models/carrier_gw.rb +82 -0
  41. data/lib/boku_direct_payments_api/models/charge.rb +288 -0
  42. data/lib/boku_direct_payments_api/models/charge_msisdn_request.rb +233 -0
  43. data/lib/boku_direct_payments_api/models/charge_plus_optin_request.rb +390 -0
  44. data/lib/boku_direct_payments_api/models/charge_plus_optin_request_hosted.rb +96 -0
  45. data/lib/boku_direct_payments_api/models/charge_plus_optin_response.rb +278 -0
  46. data/lib/boku_direct_payments_api/models/charge_plus_optin_response_hosted.rb +75 -0
  47. data/lib/boku_direct_payments_api/models/charge_request.rb +332 -0
  48. data/lib/boku_direct_payments_api/models/charge_response.rb +253 -0
  49. data/lib/boku_direct_payments_api/models/charge_status_enum.rb +43 -0
  50. data/lib/boku_direct_payments_api/models/check_eligibility_request.rb +117 -0
  51. data/lib/boku_direct_payments_api/models/check_eligibility_response.rb +116 -0
  52. data/lib/boku_direct_payments_api/models/client_call.rb +91 -0
  53. data/lib/boku_direct_payments_api/models/confirm_optin_request.rb +141 -0
  54. data/lib/boku_direct_payments_api/models/confirm_optin_response.rb +211 -0
  55. data/lib/boku_direct_payments_api/models/confirm_verify_device_request.rb +161 -0
  56. data/lib/boku_direct_payments_api/models/confirm_verify_device_response.rb +137 -0
  57. data/lib/boku_direct_payments_api/models/eligibility_status_enum.rb +40 -0
  58. data/lib/boku_direct_payments_api/models/forex_request.rb +97 -0
  59. data/lib/boku_direct_payments_api/models/forex_response.rb +127 -0
  60. data/lib/boku_direct_payments_api/models/fund_check_request.rb +132 -0
  61. data/lib/boku_direct_payments_api/models/fund_check_response.rb +89 -0
  62. data/lib/boku_direct_payments_api/models/invalid_request_field.rb +93 -0
  63. data/lib/boku_direct_payments_api/models/mandate_constraint.rb +92 -0
  64. data/lib/boku_direct_payments_api/models/mandate_period_enum.rb +48 -0
  65. data/lib/boku_direct_payments_api/models/mcc_mnc_mapping.rb +85 -0
  66. data/lib/boku_direct_payments_api/models/method_enum.rb +36 -0
  67. data/lib/boku_direct_payments_api/models/msisdn_network_request.rb +97 -0
  68. data/lib/boku_direct_payments_api/models/msisdn_network_response.rb +116 -0
  69. data/lib/boku_direct_payments_api/models/network_info.rb +84 -0
  70. data/lib/boku_direct_payments_api/models/network_info_network.rb +168 -0
  71. data/lib/boku_direct_payments_api/models/optin_accept_networks.rb +87 -0
  72. data/lib/boku_direct_payments_api/models/optin_info.rb +99 -0
  73. data/lib/boku_direct_payments_api/models/optin_info_optin_network.rb +104 -0
  74. data/lib/boku_direct_payments_api/models/optin_info_optin_types.rb +128 -0
  75. data/lib/boku_direct_payments_api/models/optin_network.rb +115 -0
  76. data/lib/boku_direct_payments_api/models/optin_purpose_enum.rb +62 -0
  77. data/lib/boku_direct_payments_api/models/optin_request.rb +338 -0
  78. data/lib/boku_direct_payments_api/models/optin_request_hosted.rb +110 -0
  79. data/lib/boku_direct_payments_api/models/optin_request_qr_info.rb +75 -0
  80. data/lib/boku_direct_payments_api/models/optin_response.rb +220 -0
  81. data/lib/boku_direct_payments_api/models/optin_response_hosted.rb +87 -0
  82. data/lib/boku_direct_payments_api/models/optin_response_qr_info.rb +85 -0
  83. data/lib/boku_direct_payments_api/models/optin_state.rb +164 -0
  84. data/lib/boku_direct_payments_api/models/optin_status_enum.rb +51 -0
  85. data/lib/boku_direct_payments_api/models/optin_terms.rb +214 -0
  86. data/lib/boku_direct_payments_api/models/optin_type_enum.rb +45 -0
  87. data/lib/boku_direct_payments_api/models/payment_method_status_enum.rb +44 -0
  88. data/lib/boku_direct_payments_api/models/period.rb +89 -0
  89. data/lib/boku_direct_payments_api/models/period_unit_enum.rb +46 -0
  90. data/lib/boku_direct_payments_api/models/query_charge_request.rb +149 -0
  91. data/lib/boku_direct_payments_api/models/query_charge_response.rb +101 -0
  92. data/lib/boku_direct_payments_api/models/query_optin_request.rb +104 -0
  93. data/lib/boku_direct_payments_api/models/query_optin_response.rb +129 -0
  94. data/lib/boku_direct_payments_api/models/query_refund_request.rb +122 -0
  95. data/lib/boku_direct_payments_api/models/query_refund_response.rb +101 -0
  96. data/lib/boku_direct_payments_api/models/refund.rb +249 -0
  97. data/lib/boku_direct_payments_api/models/refund_charge_notification.rb +88 -0
  98. data/lib/boku_direct_payments_api/models/refund_charge_request.rb +231 -0
  99. data/lib/boku_direct_payments_api/models/refund_charge_response.rb +203 -0
  100. data/lib/boku_direct_payments_api/models/refund_status_enum.rb +43 -0
  101. data/lib/boku_direct_payments_api/models/refund_type_enum.rb +36 -0
  102. data/lib/boku_direct_payments_api/models/register_payment_method_request.rb +152 -0
  103. data/lib/boku_direct_payments_api/models/register_payment_method_response.rb +172 -0
  104. data/lib/boku_direct_payments_api/models/register_seller_of_record_request.rb +118 -0
  105. data/lib/boku_direct_payments_api/models/register_seller_of_record_response.rb +156 -0
  106. data/lib/boku_direct_payments_api/models/resend_otp_request.rb +167 -0
  107. data/lib/boku_direct_payments_api/models/resend_otp_response.rb +118 -0
  108. data/lib/boku_direct_payments_api/models/result.rb +154 -0
  109. data/lib/boku_direct_payments_api/models/result_status_enum.rb +36 -0
  110. data/lib/boku_direct_payments_api/models/reversal.rb +89 -0
  111. data/lib/boku_direct_payments_api/models/reverse_charge_request.rb +104 -0
  112. data/lib/boku_direct_payments_api/models/reverse_charge_response.rb +157 -0
  113. data/lib/boku_direct_payments_api/models/seller_of_record.rb +76 -0
  114. data/lib/boku_direct_payments_api/models/seller_of_record_status_enum.rb +44 -0
  115. data/lib/boku_direct_payments_api/models/send_sms.rb +89 -0
  116. data/lib/boku_direct_payments_api/models/settlement.rb +126 -0
  117. data/lib/boku_direct_payments_api/models/silent_mo.rb +78 -0
  118. data/lib/boku_direct_payments_api/models/status_enum.rb +40 -0
  119. data/lib/boku_direct_payments_api/models/subscription.rb +105 -0
  120. data/lib/boku_direct_payments_api/models/timeout.rb +75 -0
  121. data/lib/boku_direct_payments_api/models/type_enum.rb +36 -0
  122. data/lib/boku_direct_payments_api/models/validate_optin_request.rb +179 -0
  123. data/lib/boku_direct_payments_api/models/validate_optin_response.rb +195 -0
  124. data/lib/boku_direct_payments_api/models/verify_device_request.rb +135 -0
  125. data/lib/boku_direct_payments_api/models/verify_device_response.rb +137 -0
  126. data/lib/boku_direct_payments_api/utilities/date_time_helper.rb +11 -0
  127. data/lib/boku_direct_payments_api/utilities/file_wrapper.rb +28 -0
  128. data/lib/boku_direct_payments_api/utilities/xml_utilities.rb +12 -0
  129. data/lib/boku_direct_payments_api.rb +166 -0
  130. data/test/controllers/controller_test_base.rb +23 -0
  131. data/test/controllers/test_account_resources_controller.rb +44 -0
  132. data/test/controllers/test_charge_controller.rb +159 -0
  133. data/test/controllers/test_config_resources_controller.rb +47 -0
  134. data/test/controllers/test_consumer_registration_controller.rb +262 -0
  135. data/test/controllers/test_forex_controller.rb +40 -0
  136. data/test/controllers/test_fund_check_controller.rb +41 -0
  137. data/test/controllers/test_refund_controller.rb +76 -0
  138. data/test/controllers/test_seller_of_record_controller.rb +72 -0
  139. data/test/http_response_catcher.rb +19 -0
  140. metadata +255 -0
@@ -0,0 +1,338 @@
1
+ # boku_direct_payments_api
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module BokuDirectPaymentsApi
7
+ # 'optin' Request - General Parameters
8
+ class OptinRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Two-letter country code in ISO 3166-1 alpha-2 format (e.g., `US`, `GB`,
13
+ # `DE`).
14
+ # @return [String]
15
+ attr_accessor :country
16
+
17
+ # Unique identifier for the consumer, assigned by the merchant.
18
+ # @return [String]
19
+ attr_accessor :merchant_consumer_id
20
+
21
+ # Boku assigned Merchant ID.
22
+ # @return [String]
23
+ attr_accessor :merchant_id
24
+
25
+ # Merchant assigned unique request ID. Multiple requests received with the
26
+ # same `requestId` will be handled idempotently within the configured
27
+ # idempotency window.
28
+ # @return [String]
29
+ attr_accessor :merchant_request_id
30
+
31
+ # Specifies which method to use to perform the opt-in.
32
+ # @return [OptinTypeEnum]
33
+ attr_accessor :optin_type
34
+
35
+ # A container element that allows the merchant to restrict which networks
36
+ # are permitted for this request.
37
+ # - If omitted, all networks enabled on the merchant account will be
38
+ # allowed.
39
+ # - If specified, only the networks listed and enabled for the merchant will
40
+ # be permitted.
41
+ # @return [OptinAcceptNetworks]
42
+ attr_accessor :accept_networks
43
+
44
+ # IP address of the end user at the time of opt-in. Used to support fraud
45
+ # detection through internal risk assessments and partner-specific
46
+ # decisioning. Supports both IPv4 and IPv6 formats.
47
+ # @return [String]
48
+ attr_accessor :consumer_ip_address
49
+
50
+ # Container for parameters required _**only**_ when `optin-type` is
51
+ # `hosted`.
52
+ # @return [OptinRequestHosted]
53
+ attr_accessor :hosted
54
+
55
+ # Merchant assigned unique optin ID (only supported for hosted and otp optin
56
+ # types). _Optional. However, if provided, it must remain the same for
57
+ # idempotent requests._
58
+ # @return [String]
59
+ attr_accessor :merchant_optin_id
60
+
61
+ # Consumer’s mobile phone number.
62
+ # @return [String]
63
+ attr_accessor :msisdn
64
+
65
+ # URL to which Boku will send a notification once the opt-in is ready for
66
+ # the `validate-optin` call.
67
+ # @return [String]
68
+ attr_accessor :notification_url
69
+
70
+ # Describes the optin or product type associated with the request—for
71
+ # example, a free trial, subscription, or other merchant-defined context.
72
+ # @return [String]
73
+ attr_accessor :optin_description
74
+
75
+ # The payment method selected by the consumer. Each wallet provider is
76
+ # represented as a distinct payment method. A full list of supported values
77
+ # is available upon request from your Boku integration team.
78
+ # @return [String]
79
+ attr_accessor :payment_method
80
+
81
+ # Optin and Charge Request API can be made for specific Seller of Record
82
+ # previously registered with Boku.
83
+ # @return [SellerOfRecord]
84
+ attr_accessor :seller_of_record
85
+
86
+ # Merchant assigned service name to display in the optin and verify device
87
+ # SMS messages. This field is only applicable when `optin-type` is `otp`.
88
+ # @return [String]
89
+ attr_accessor :service_name
90
+
91
+ # Country where the operation is initiated (e.g., the storefront location),
92
+ # specified using the ISO 3166-1 alpha-2 country code format.
93
+ # @return [String]
94
+ attr_accessor :source_country
95
+
96
+ # Content defining the specific terms and conditions associated with this
97
+ # opt-in. This may include pricing details or user consent requirements
98
+ # presented to the end user during the opt-in flow.
99
+ # @return [OptinTerms]
100
+ attr_accessor :terms
101
+
102
+ # A mapping from model property names to API property names.
103
+ def self.names
104
+ @_hash = {} if @_hash.nil?
105
+ @_hash['country'] = 'country'
106
+ @_hash['merchant_consumer_id'] = 'merchant-consumer-id'
107
+ @_hash['merchant_id'] = 'merchant-id'
108
+ @_hash['merchant_request_id'] = 'merchant-request-id'
109
+ @_hash['optin_type'] = 'optin-type'
110
+ @_hash['accept_networks'] = 'accept-networks'
111
+ @_hash['consumer_ip_address'] = 'consumer-ip-address'
112
+ @_hash['hosted'] = 'hosted'
113
+ @_hash['merchant_optin_id'] = 'merchant-optin-id'
114
+ @_hash['msisdn'] = 'msisdn'
115
+ @_hash['notification_url'] = 'notification-url'
116
+ @_hash['optin_description'] = 'optin-description'
117
+ @_hash['payment_method'] = 'payment-method'
118
+ @_hash['seller_of_record'] = 'seller-of-record'
119
+ @_hash['service_name'] = 'service-name'
120
+ @_hash['source_country'] = 'source-country'
121
+ @_hash['terms'] = 'terms'
122
+ @_hash
123
+ end
124
+
125
+ # An array for optional fields
126
+ def self.optionals
127
+ %w[
128
+ accept_networks
129
+ consumer_ip_address
130
+ hosted
131
+ merchant_optin_id
132
+ msisdn
133
+ notification_url
134
+ optin_description
135
+ payment_method
136
+ seller_of_record
137
+ service_name
138
+ source_country
139
+ terms
140
+ ]
141
+ end
142
+
143
+ # An array for nullable fields
144
+ def self.nullables
145
+ []
146
+ end
147
+
148
+ def initialize(country = nil, merchant_consumer_id = nil, merchant_id = nil,
149
+ merchant_request_id = nil, optin_type = nil,
150
+ accept_networks = SKIP, consumer_ip_address = SKIP,
151
+ hosted = SKIP, merchant_optin_id = SKIP, msisdn = SKIP,
152
+ notification_url = SKIP, optin_description = SKIP,
153
+ payment_method = SKIP, seller_of_record = SKIP,
154
+ service_name = SKIP, source_country = SKIP, terms = SKIP)
155
+ @country = country
156
+ @merchant_consumer_id = merchant_consumer_id
157
+ @merchant_id = merchant_id
158
+ @merchant_request_id = merchant_request_id
159
+ @optin_type = optin_type
160
+ @accept_networks = accept_networks unless accept_networks == SKIP
161
+ @consumer_ip_address = consumer_ip_address unless consumer_ip_address == SKIP
162
+ @hosted = hosted unless hosted == SKIP
163
+ @merchant_optin_id = merchant_optin_id unless merchant_optin_id == SKIP
164
+ @msisdn = msisdn unless msisdn == SKIP
165
+ @notification_url = notification_url unless notification_url == SKIP
166
+ @optin_description = optin_description unless optin_description == SKIP
167
+ @payment_method = payment_method unless payment_method == SKIP
168
+ @seller_of_record = seller_of_record unless seller_of_record == SKIP
169
+ @service_name = service_name unless service_name == SKIP
170
+ @source_country = source_country unless source_country == SKIP
171
+ @terms = terms unless terms == SKIP
172
+ end
173
+
174
+ # Creates an instance of the object from a hash.
175
+ def self.from_hash(hash)
176
+ return nil unless hash
177
+
178
+ # Extract variables from the hash.
179
+ country = hash.key?('country') ? hash['country'] : nil
180
+ merchant_consumer_id =
181
+ hash.key?('merchant-consumer-id') ? hash['merchant-consumer-id'] : nil
182
+ merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
183
+ merchant_request_id =
184
+ hash.key?('merchant-request-id') ? hash['merchant-request-id'] : nil
185
+ optin_type = hash.key?('optin-type') ? hash['optin-type'] : nil
186
+ accept_networks = OptinAcceptNetworks.from_hash(hash['accept-networks']) if
187
+ hash['accept-networks']
188
+ consumer_ip_address =
189
+ hash.key?('consumer-ip-address') ? hash['consumer-ip-address'] : SKIP
190
+ hosted = OptinRequestHosted.from_hash(hash['hosted']) if hash['hosted']
191
+ merchant_optin_id =
192
+ hash.key?('merchant-optin-id') ? hash['merchant-optin-id'] : SKIP
193
+ msisdn = hash.key?('msisdn') ? hash['msisdn'] : SKIP
194
+ notification_url =
195
+ hash.key?('notification-url') ? hash['notification-url'] : SKIP
196
+ optin_description =
197
+ hash.key?('optin-description') ? hash['optin-description'] : SKIP
198
+ payment_method =
199
+ hash.key?('payment-method') ? hash['payment-method'] : SKIP
200
+ seller_of_record = SellerOfRecord.from_hash(hash['seller-of-record']) if
201
+ hash['seller-of-record']
202
+ service_name = hash.key?('service-name') ? hash['service-name'] : SKIP
203
+ source_country =
204
+ hash.key?('source-country') ? hash['source-country'] : SKIP
205
+ terms = OptinTerms.from_hash(hash['terms']) if hash['terms']
206
+
207
+ # Create object from extracted values.
208
+ OptinRequest.new(country,
209
+ merchant_consumer_id,
210
+ merchant_id,
211
+ merchant_request_id,
212
+ optin_type,
213
+ accept_networks,
214
+ consumer_ip_address,
215
+ hosted,
216
+ merchant_optin_id,
217
+ msisdn,
218
+ notification_url,
219
+ optin_description,
220
+ payment_method,
221
+ seller_of_record,
222
+ service_name,
223
+ source_country,
224
+ terms)
225
+ end
226
+
227
+ def self.from_element(root)
228
+ country = XmlUtilities.from_element(root, 'country', String)
229
+ merchant_consumer_id = XmlUtilities.from_element(root,
230
+ 'merchant-consumer-id',
231
+ String)
232
+ merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
233
+ merchant_request_id = XmlUtilities.from_element(root,
234
+ 'merchant-request-id',
235
+ String)
236
+ optin_type = XmlUtilities.from_element(root, 'optin-type', String)
237
+ accept_networks = XmlUtilities.from_element(root, 'accept-networks',
238
+ OptinAcceptNetworks)
239
+ consumer_ip_address = XmlUtilities.from_element(root,
240
+ 'consumer-ip-address',
241
+ String)
242
+ hosted = XmlUtilities.from_element(root, 'hosted', OptinRequestHosted)
243
+ merchant_optin_id = XmlUtilities.from_element(root, 'merchant-optin-id',
244
+ String)
245
+ msisdn = XmlUtilities.from_element(root, 'msisdn', String)
246
+ notification_url = XmlUtilities.from_element(root, 'notification-url',
247
+ String)
248
+ optin_description = XmlUtilities.from_element(root, 'optin-description',
249
+ String)
250
+ payment_method = XmlUtilities.from_element(root, 'payment-method', String)
251
+ seller_of_record = XmlUtilities.from_element(root, 'seller-of-record',
252
+ SellerOfRecord)
253
+ service_name = XmlUtilities.from_element(root, 'service-name', String)
254
+ source_country = XmlUtilities.from_element(root, 'source-country', String)
255
+ terms = XmlUtilities.from_element(root, 'terms', OptinTerms)
256
+
257
+ new(country,
258
+ merchant_consumer_id,
259
+ merchant_id,
260
+ merchant_request_id,
261
+ optin_type,
262
+ accept_networks,
263
+ consumer_ip_address,
264
+ hosted,
265
+ merchant_optin_id,
266
+ msisdn,
267
+ notification_url,
268
+ optin_description,
269
+ payment_method,
270
+ seller_of_record,
271
+ service_name,
272
+ source_country,
273
+ terms)
274
+ end
275
+
276
+ def to_xml_element(doc, root_name)
277
+ root = doc.create_element(root_name)
278
+
279
+ XmlUtilities.add_as_subelement(doc, root, 'country', country)
280
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-consumer-id',
281
+ merchant_consumer_id)
282
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
283
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-request-id',
284
+ merchant_request_id)
285
+ XmlUtilities.add_as_subelement(doc, root, 'optin-type', optin_type)
286
+ XmlUtilities.add_as_subelement(doc, root, 'accept-networks',
287
+ accept_networks)
288
+ XmlUtilities.add_as_subelement(doc, root, 'consumer-ip-address',
289
+ consumer_ip_address)
290
+ XmlUtilities.add_as_subelement(doc, root, 'hosted', hosted)
291
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-optin-id',
292
+ merchant_optin_id)
293
+ XmlUtilities.add_as_subelement(doc, root, 'msisdn', msisdn)
294
+ XmlUtilities.add_as_subelement(doc, root, 'notification-url',
295
+ notification_url)
296
+ XmlUtilities.add_as_subelement(doc, root, 'optin-description',
297
+ optin_description)
298
+ XmlUtilities.add_as_subelement(doc, root, 'payment-method',
299
+ payment_method)
300
+ XmlUtilities.add_as_subelement(doc, root, 'seller-of-record',
301
+ seller_of_record)
302
+ XmlUtilities.add_as_subelement(doc, root, 'service-name', service_name)
303
+ XmlUtilities.add_as_subelement(doc, root, 'source-country',
304
+ source_country)
305
+ XmlUtilities.add_as_subelement(doc, root, 'terms', terms)
306
+
307
+ root
308
+ end
309
+
310
+ # Provides a human-readable string representation of the object.
311
+ def to_s
312
+ class_name = self.class.name.split('::').last
313
+ "<#{class_name} country: #{@country}, merchant_consumer_id: #{@merchant_consumer_id},"\
314
+ " merchant_id: #{@merchant_id}, merchant_request_id: #{@merchant_request_id}, optin_type:"\
315
+ " #{@optin_type}, accept_networks: #{@accept_networks}, consumer_ip_address:"\
316
+ " #{@consumer_ip_address}, hosted: #{@hosted}, merchant_optin_id: #{@merchant_optin_id},"\
317
+ " msisdn: #{@msisdn}, notification_url: #{@notification_url}, optin_description:"\
318
+ " #{@optin_description}, payment_method: #{@payment_method}, seller_of_record:"\
319
+ " #{@seller_of_record}, service_name: #{@service_name}, source_country: #{@source_country},"\
320
+ " terms: #{@terms}>"
321
+ end
322
+
323
+ # Provides a debugging-friendly string with detailed object information.
324
+ def inspect
325
+ class_name = self.class.name.split('::').last
326
+ "<#{class_name} country: #{@country.inspect}, merchant_consumer_id:"\
327
+ " #{@merchant_consumer_id.inspect}, merchant_id: #{@merchant_id.inspect},"\
328
+ " merchant_request_id: #{@merchant_request_id.inspect}, optin_type: #{@optin_type.inspect},"\
329
+ " accept_networks: #{@accept_networks.inspect}, consumer_ip_address:"\
330
+ " #{@consumer_ip_address.inspect}, hosted: #{@hosted.inspect}, merchant_optin_id:"\
331
+ " #{@merchant_optin_id.inspect}, msisdn: #{@msisdn.inspect}, notification_url:"\
332
+ " #{@notification_url.inspect}, optin_description: #{@optin_description.inspect},"\
333
+ " payment_method: #{@payment_method.inspect}, seller_of_record:"\
334
+ " #{@seller_of_record.inspect}, service_name: #{@service_name.inspect}, source_country:"\
335
+ " #{@source_country.inspect}, terms: #{@terms.inspect}>"
336
+ end
337
+ end
338
+ end
@@ -0,0 +1,110 @@
1
+ # boku_direct_payments_api
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module BokuDirectPaymentsApi
7
+ # Container for parameters required _**only**_ when `optin-type` is `hosted`.
8
+ class OptinRequestHosted < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Supplies the URL for Boku to redirect the consumer back to the merchant UI
13
+ # to complete authentication.
14
+ # @return [String]
15
+ attr_accessor :forward_url
16
+
17
+ # Specifies the format and content of the QR code information returned for
18
+ # issuers that support QR-based processing.
19
+ # @return [OptinRequestQrInfo]
20
+ attr_accessor :qr_info
21
+
22
+ # True if a mobile-optimized opt-in flow should be used for this request,
23
+ # false otherwise.
24
+ # Example: A non-mobile-optimized flow could display a QR code on the user's
25
+ # mobile. The user would be unable to scan the QR code because they are
26
+ # already on their mobile.
27
+ # A mobile-optimized flow could display a mobile login page to the user.
28
+ # @return [TrueClass | FalseClass]
29
+ attr_accessor :use_mobile_flow
30
+
31
+ # A mapping from model property names to API property names.
32
+ def self.names
33
+ @_hash = {} if @_hash.nil?
34
+ @_hash['forward_url'] = 'forward-url'
35
+ @_hash['qr_info'] = 'qr-info'
36
+ @_hash['use_mobile_flow'] = 'use-mobile-flow'
37
+ @_hash
38
+ end
39
+
40
+ # An array for optional fields
41
+ def self.optionals
42
+ %w[
43
+ qr_info
44
+ use_mobile_flow
45
+ ]
46
+ end
47
+
48
+ # An array for nullable fields
49
+ def self.nullables
50
+ []
51
+ end
52
+
53
+ def initialize(forward_url = nil, qr_info = SKIP, use_mobile_flow = false)
54
+ @forward_url = forward_url
55
+ @qr_info = qr_info unless qr_info == SKIP
56
+ @use_mobile_flow = use_mobile_flow unless use_mobile_flow == SKIP
57
+ end
58
+
59
+ # Creates an instance of the object from a hash.
60
+ def self.from_hash(hash)
61
+ return nil unless hash
62
+
63
+ # Extract variables from the hash.
64
+ forward_url = hash.key?('forward-url') ? hash['forward-url'] : nil
65
+ qr_info = OptinRequestQrInfo.from_hash(hash['qr-info']) if hash['qr-info']
66
+ use_mobile_flow = hash['use-mobile-flow'] ||= false
67
+
68
+ # Create object from extracted values.
69
+ OptinRequestHosted.new(forward_url,
70
+ qr_info,
71
+ use_mobile_flow)
72
+ end
73
+
74
+ def self.from_element(root)
75
+ forward_url = XmlUtilities.from_element(root, 'forward-url', String)
76
+ qr_info = XmlUtilities.from_element(root, 'qr-info', OptinRequestQrInfo)
77
+ use_mobile_flow = XmlUtilities.from_element(root, 'use-mobile-flow',
78
+ TrueClass)
79
+
80
+ new(forward_url,
81
+ qr_info,
82
+ use_mobile_flow)
83
+ end
84
+
85
+ def to_xml_element(doc, root_name)
86
+ root = doc.create_element(root_name)
87
+
88
+ XmlUtilities.add_as_subelement(doc, root, 'forward-url', forward_url)
89
+ XmlUtilities.add_as_subelement(doc, root, 'qr-info', qr_info)
90
+ XmlUtilities.add_as_subelement(doc, root, 'use-mobile-flow',
91
+ use_mobile_flow)
92
+
93
+ root
94
+ end
95
+
96
+ # Provides a human-readable string representation of the object.
97
+ def to_s
98
+ class_name = self.class.name.split('::').last
99
+ "<#{class_name} forward_url: #{@forward_url}, qr_info: #{@qr_info}, use_mobile_flow:"\
100
+ " #{@use_mobile_flow}>"
101
+ end
102
+
103
+ # Provides a debugging-friendly string with detailed object information.
104
+ def inspect
105
+ class_name = self.class.name.split('::').last
106
+ "<#{class_name} forward_url: #{@forward_url.inspect}, qr_info: #{@qr_info.inspect},"\
107
+ " use_mobile_flow: #{@use_mobile_flow.inspect}>"
108
+ end
109
+ end
110
+ end
@@ -0,0 +1,75 @@
1
+ # boku_direct_payments_api
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module BokuDirectPaymentsApi
7
+ # Specifies the format and content of the QR code information returned for
8
+ # issuers that support QR-based processing.
9
+ class OptinRequestQrInfo < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [TypeEnum]
15
+ attr_accessor :type
16
+
17
+ # A mapping from model property names to API property names.
18
+ def self.names
19
+ @_hash = {} if @_hash.nil?
20
+ @_hash['type'] = 'type'
21
+ @_hash
22
+ end
23
+
24
+ # An array for optional fields
25
+ def self.optionals
26
+ []
27
+ end
28
+
29
+ # An array for nullable fields
30
+ def self.nullables
31
+ []
32
+ end
33
+
34
+ def initialize(type = nil)
35
+ @type = type
36
+ end
37
+
38
+ # Creates an instance of the object from a hash.
39
+ def self.from_hash(hash)
40
+ return nil unless hash
41
+
42
+ # Extract variables from the hash.
43
+ type = hash.key?('type') ? hash['type'] : nil
44
+
45
+ # Create object from extracted values.
46
+ OptinRequestQrInfo.new(type)
47
+ end
48
+
49
+ def self.from_element(root)
50
+ type = XmlUtilities.from_element(root, 'type', String)
51
+
52
+ new(type)
53
+ end
54
+
55
+ def to_xml_element(doc, root_name)
56
+ root = doc.create_element(root_name)
57
+
58
+ XmlUtilities.add_as_subelement(doc, root, 'type', type)
59
+
60
+ root
61
+ end
62
+
63
+ # Provides a human-readable string representation of the object.
64
+ def to_s
65
+ class_name = self.class.name.split('::').last
66
+ "<#{class_name} type: #{@type}>"
67
+ end
68
+
69
+ # Provides a debugging-friendly string with detailed object information.
70
+ def inspect
71
+ class_name = self.class.name.split('::').last
72
+ "<#{class_name} type: #{@type.inspect}>"
73
+ end
74
+ end
75
+ end