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,390 @@
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
+ # 'charge-plus-optin' Request - General Parameters
8
+ class ChargePlusOptinRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Type of charge
13
+ # @return [String]
14
+ attr_reader :charge_type
15
+
16
+ # ISO 3166-1 alpha-2 country code.
17
+ # @return [String]
18
+ attr_accessor :country
19
+
20
+ # ISO 4217 three-letter currency code.
21
+ # @return [String]
22
+ attr_accessor :currency
23
+
24
+ # ISO 4217 three-letter currency code.
25
+ # @return [ChargePlusOptinRequestHosted]
26
+ attr_accessor :hosted
27
+
28
+ # Unique identifier for the consumer, assigned by the merchant.
29
+ # @return [String]
30
+ attr_accessor :merchant_consumer_id
31
+
32
+ # Boku-assigned merchant ID.
33
+ # @return [String]
34
+ attr_accessor :merchant_id
35
+
36
+ # A description of the purchased item.
37
+ # @return [String]
38
+ attr_accessor :merchant_item_description
39
+
40
+ # Merchant-assigned unique request ID.
41
+ # Multiple requests received with the same merchant-request-id will be
42
+ # handled idempotently within the idempotency window.
43
+ # @return [String]
44
+ attr_accessor :merchant_request_id
45
+
46
+ # Merchant-assigned transaction ID.
47
+ # _***Boku recommends merchants send this ID for future reference.**_
48
+ # @return [String]
49
+ attr_accessor :merchant_transaction_id
50
+
51
+ # Supplies the URL for Boku to send a notification once the charge is
52
+ # complete.
53
+ # @return [String]
54
+ attr_accessor :notification_url
55
+
56
+ # The payment method selected by the consumer.
57
+ # Each wallet provider will be its own payment method. A list of available
58
+ # values will be provided on demand.
59
+ # @return [String]
60
+ attr_accessor :payment_method
61
+
62
+ # Total amount to charge, including tax.
63
+ # @return [Float]
64
+ attr_accessor :total_amount
65
+
66
+ # The Boku Bank ID selected by the consumer.
67
+ # _***Note: This field is required only for specific payment issuers. Please
68
+ # contact your Integration Manager to confirm whether it's needed for your
69
+ # integration.**_
70
+ # @return [String]
71
+ attr_accessor :bank_id
72
+
73
+ # The IP address of the consumer. Helps improve fraud detection by
74
+ # supporting internal risk checks and partner decisions. Supports IPv4 and
75
+ # IPv6 formats.
76
+ # @return [String]
77
+ attr_accessor :consumer_ip_address
78
+
79
+ # The IP address of the consumer. Helps improve fraud detection by
80
+ # supporting internal risk checks and partner decisions. Supports IPv4 and
81
+ # IPv6 formats.
82
+ # @return [Hash[String, String]]
83
+ attr_accessor :consumer_transaction_data
84
+
85
+ # Merchant-supplied metadata. This metadata is returned in the
86
+ # 'charge-plus-optin' response and can be available in merchant reports.
87
+ # @return [String]
88
+ attr_accessor :merchant_data
89
+
90
+ # Merchant-assigned unique opt-in ID.
91
+ # @return [String]
92
+ attr_accessor :merchant_optin_id
93
+
94
+ # Content defining the specific terms and conditions associated with this
95
+ # opt-in. This may include pricing details or user consent requirements
96
+ # presented to the end user during the opt-in flow.
97
+ # @return [OptinTerms]
98
+ attr_accessor :optin_terms
99
+
100
+ # Optin and Charge Request API can be made for specific Seller of Record
101
+ # previously registered with Boku.
102
+ # @return [SellerOfRecord]
103
+ attr_accessor :seller_of_record
104
+
105
+ # Optin and Charge Request API can be made for specific Seller of Record
106
+ # previously registered with Boku.
107
+ # @return [String]
108
+ attr_accessor :source_country
109
+
110
+ # Specifies how long to block waiting for a response
111
+ # @return [Timeout]
112
+ attr_accessor :timeout
113
+
114
+ # A mapping from model property names to API property names.
115
+ def self.names
116
+ @_hash = {} if @_hash.nil?
117
+ @_hash['charge_type'] = 'charge-type'
118
+ @_hash['country'] = 'country'
119
+ @_hash['currency'] = 'currency'
120
+ @_hash['hosted'] = 'hosted'
121
+ @_hash['merchant_consumer_id'] = 'merchant-consumer-id'
122
+ @_hash['merchant_id'] = 'merchant-id'
123
+ @_hash['merchant_item_description'] = 'merchant-item-description'
124
+ @_hash['merchant_request_id'] = 'merchant-request-id'
125
+ @_hash['merchant_transaction_id'] = 'merchant-transaction-id'
126
+ @_hash['notification_url'] = 'notification-url'
127
+ @_hash['payment_method'] = 'payment-method'
128
+ @_hash['total_amount'] = 'total-amount'
129
+ @_hash['bank_id'] = 'bank-id'
130
+ @_hash['consumer_ip_address'] = 'consumer-ip-address'
131
+ @_hash['consumer_transaction_data'] = 'consumer-transaction-data'
132
+ @_hash['merchant_data'] = 'merchant-data'
133
+ @_hash['merchant_optin_id'] = 'merchant-optin-id'
134
+ @_hash['optin_terms'] = 'optin-terms'
135
+ @_hash['seller_of_record'] = 'seller-of-record'
136
+ @_hash['source_country'] = 'source-country'
137
+ @_hash['timeout'] = 'timeout'
138
+ @_hash
139
+ end
140
+
141
+ # An array for optional fields
142
+ def self.optionals
143
+ %w[
144
+ bank_id
145
+ consumer_ip_address
146
+ consumer_transaction_data
147
+ merchant_data
148
+ merchant_optin_id
149
+ optin_terms
150
+ seller_of_record
151
+ source_country
152
+ timeout
153
+ ]
154
+ end
155
+
156
+ # An array for nullable fields
157
+ def self.nullables
158
+ []
159
+ end
160
+
161
+ def initialize(country = nil, currency = nil, hosted = nil,
162
+ merchant_consumer_id = nil, merchant_id = nil,
163
+ merchant_item_description = nil, merchant_request_id = nil,
164
+ merchant_transaction_id = nil, notification_url = nil,
165
+ payment_method = nil, total_amount = nil, bank_id = SKIP,
166
+ consumer_ip_address = SKIP, consumer_transaction_data = SKIP,
167
+ merchant_data = SKIP, merchant_optin_id = SKIP,
168
+ optin_terms = SKIP, seller_of_record = SKIP,
169
+ source_country = SKIP, timeout = SKIP)
170
+ @charge_type = 'hosted'
171
+ @country = country
172
+ @currency = currency
173
+ @hosted = hosted
174
+ @merchant_consumer_id = merchant_consumer_id
175
+ @merchant_id = merchant_id
176
+ @merchant_item_description = merchant_item_description
177
+ @merchant_request_id = merchant_request_id
178
+ @merchant_transaction_id = merchant_transaction_id
179
+ @notification_url = notification_url
180
+ @payment_method = payment_method
181
+ @total_amount = total_amount
182
+ @bank_id = bank_id unless bank_id == SKIP
183
+ @consumer_ip_address = consumer_ip_address unless consumer_ip_address == SKIP
184
+ unless consumer_transaction_data == SKIP
185
+ @consumer_transaction_data =
186
+ consumer_transaction_data
187
+ end
188
+ @merchant_data = merchant_data unless merchant_data == SKIP
189
+ @merchant_optin_id = merchant_optin_id unless merchant_optin_id == SKIP
190
+ @optin_terms = optin_terms unless optin_terms == SKIP
191
+ @seller_of_record = seller_of_record unless seller_of_record == SKIP
192
+ @source_country = source_country unless source_country == SKIP
193
+ @timeout = timeout unless timeout == SKIP
194
+ end
195
+
196
+ # Creates an instance of the object from a hash.
197
+ def self.from_hash(hash)
198
+ return nil unless hash
199
+
200
+ # Extract variables from the hash.
201
+ country = hash.key?('country') ? hash['country'] : nil
202
+ currency = hash.key?('currency') ? hash['currency'] : nil
203
+ hosted = ChargePlusOptinRequestHosted.from_hash(hash['hosted']) if hash['hosted']
204
+ merchant_consumer_id =
205
+ hash.key?('merchant-consumer-id') ? hash['merchant-consumer-id'] : nil
206
+ merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
207
+ merchant_item_description =
208
+ hash.key?('merchant-item-description') ? hash['merchant-item-description'] : nil
209
+ merchant_request_id =
210
+ hash.key?('merchant-request-id') ? hash['merchant-request-id'] : nil
211
+ merchant_transaction_id =
212
+ hash.key?('merchant-transaction-id') ? hash['merchant-transaction-id'] : nil
213
+ notification_url =
214
+ hash.key?('notification-url') ? hash['notification-url'] : nil
215
+ payment_method =
216
+ hash.key?('payment-method') ? hash['payment-method'] : nil
217
+ total_amount = hash.key?('total-amount') ? hash['total-amount'] : nil
218
+ bank_id = hash.key?('bank-id') ? hash['bank-id'] : SKIP
219
+ consumer_ip_address =
220
+ hash.key?('consumer-ip-address') ? hash['consumer-ip-address'] : SKIP
221
+ consumer_transaction_data =
222
+ hash.key?('consumer-transaction-data') ? hash['consumer-transaction-data'] : SKIP
223
+ merchant_data = hash.key?('merchant-data') ? hash['merchant-data'] : SKIP
224
+ merchant_optin_id =
225
+ hash.key?('merchant-optin-id') ? hash['merchant-optin-id'] : SKIP
226
+ optin_terms = OptinTerms.from_hash(hash['optin-terms']) if hash['optin-terms']
227
+ seller_of_record = SellerOfRecord.from_hash(hash['seller-of-record']) if
228
+ hash['seller-of-record']
229
+ source_country =
230
+ hash.key?('source-country') ? hash['source-country'] : SKIP
231
+ timeout = Timeout.from_hash(hash['timeout']) if hash['timeout']
232
+
233
+ # Create object from extracted values.
234
+ ChargePlusOptinRequest.new(country,
235
+ currency,
236
+ hosted,
237
+ merchant_consumer_id,
238
+ merchant_id,
239
+ merchant_item_description,
240
+ merchant_request_id,
241
+ merchant_transaction_id,
242
+ notification_url,
243
+ payment_method,
244
+ total_amount,
245
+ bank_id,
246
+ consumer_ip_address,
247
+ consumer_transaction_data,
248
+ merchant_data,
249
+ merchant_optin_id,
250
+ optin_terms,
251
+ seller_of_record,
252
+ source_country,
253
+ timeout)
254
+ end
255
+
256
+ def self.from_element(root)
257
+ charge_type = XmlUtilities.from_element(root, 'charge-type', String)
258
+ country = XmlUtilities.from_element(root, 'country', String)
259
+ currency = XmlUtilities.from_element(root, 'currency', String)
260
+ hosted = XmlUtilities.from_element(root, 'hosted',
261
+ ChargePlusOptinRequestHosted)
262
+ merchant_consumer_id = XmlUtilities.from_element(root,
263
+ 'merchant-consumer-id',
264
+ String)
265
+ merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
266
+ merchant_item_description = XmlUtilities.from_element(
267
+ root, 'merchant-item-description', String
268
+ )
269
+ merchant_request_id = XmlUtilities.from_element(root,
270
+ 'merchant-request-id',
271
+ String)
272
+ merchant_transaction_id = XmlUtilities.from_element(
273
+ root, 'merchant-transaction-id', String
274
+ )
275
+ notification_url = XmlUtilities.from_element(root, 'notification-url',
276
+ String)
277
+ payment_method = XmlUtilities.from_element(root, 'payment-method', String)
278
+ total_amount = XmlUtilities.from_element(root, 'total-amount', Float)
279
+ bank_id = XmlUtilities.from_element(root, 'bank-id', String)
280
+ consumer_ip_address = XmlUtilities.from_element(root,
281
+ 'consumer-ip-address',
282
+ String)
283
+ consumer_transaction_data = XmlUtilities.from_element_to_hash(
284
+ root, 'consumer-transaction-data', Hash
285
+ )
286
+ merchant_data = XmlUtilities.from_element(root, 'merchant-data', String)
287
+ merchant_optin_id = XmlUtilities.from_element(root, 'merchant-optin-id',
288
+ String)
289
+ optin_terms = XmlUtilities.from_element(root, 'terms', OptinTerms)
290
+ seller_of_record = XmlUtilities.from_element(root, 'seller-of-record',
291
+ SellerOfRecord)
292
+ source_country = XmlUtilities.from_element(root, 'source-country', String)
293
+ timeout = XmlUtilities.from_element(root, 'timeout', Timeout)
294
+
295
+ new(charge_type,
296
+ country,
297
+ currency,
298
+ hosted,
299
+ merchant_consumer_id,
300
+ merchant_id,
301
+ merchant_item_description,
302
+ merchant_request_id,
303
+ merchant_transaction_id,
304
+ notification_url,
305
+ payment_method,
306
+ total_amount,
307
+ bank_id,
308
+ consumer_ip_address,
309
+ consumer_transaction_data,
310
+ merchant_data,
311
+ merchant_optin_id,
312
+ optin_terms,
313
+ seller_of_record,
314
+ source_country,
315
+ timeout)
316
+ end
317
+
318
+ def to_xml_element(doc, root_name)
319
+ root = doc.create_element(root_name)
320
+
321
+ XmlUtilities.add_as_subelement(doc, root, 'charge-type', charge_type)
322
+ XmlUtilities.add_as_subelement(doc, root, 'country', country)
323
+ XmlUtilities.add_as_subelement(doc, root, 'currency', currency)
324
+ XmlUtilities.add_as_subelement(doc, root, 'hosted', hosted)
325
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-consumer-id',
326
+ merchant_consumer_id)
327
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
328
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-item-description',
329
+ merchant_item_description)
330
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-request-id',
331
+ merchant_request_id)
332
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-transaction-id',
333
+ merchant_transaction_id)
334
+ XmlUtilities.add_as_subelement(doc, root, 'notification-url',
335
+ notification_url)
336
+ XmlUtilities.add_as_subelement(doc, root, 'payment-method',
337
+ payment_method)
338
+ XmlUtilities.add_as_subelement(doc, root, 'total-amount', total_amount)
339
+ XmlUtilities.add_as_subelement(doc, root, 'bank-id', bank_id)
340
+ XmlUtilities.add_as_subelement(doc, root, 'consumer-ip-address',
341
+ consumer_ip_address)
342
+ XmlUtilities.add_hash_as_subelement(doc, root,
343
+ 'consumer-transaction-data',
344
+ consumer_transaction_data)
345
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-data', merchant_data)
346
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-optin-id',
347
+ merchant_optin_id)
348
+ XmlUtilities.add_as_subelement(doc, root, 'terms', optin_terms)
349
+ XmlUtilities.add_as_subelement(doc, root, 'seller-of-record',
350
+ seller_of_record)
351
+ XmlUtilities.add_as_subelement(doc, root, 'source-country',
352
+ source_country)
353
+ XmlUtilities.add_as_subelement(doc, root, 'timeout', timeout)
354
+
355
+ root
356
+ end
357
+
358
+ # Provides a human-readable string representation of the object.
359
+ def to_s
360
+ class_name = self.class.name.split('::').last
361
+ "<#{class_name} charge_type: #{@charge_type}, country: #{@country}, currency: #{@currency},"\
362
+ " hosted: #{@hosted}, merchant_consumer_id: #{@merchant_consumer_id}, merchant_id:"\
363
+ " #{@merchant_id}, merchant_item_description: #{@merchant_item_description},"\
364
+ " merchant_request_id: #{@merchant_request_id}, merchant_transaction_id:"\
365
+ " #{@merchant_transaction_id}, notification_url: #{@notification_url}, payment_method:"\
366
+ " #{@payment_method}, total_amount: #{@total_amount}, bank_id: #{@bank_id},"\
367
+ " consumer_ip_address: #{@consumer_ip_address}, consumer_transaction_data:"\
368
+ " #{@consumer_transaction_data}, merchant_data: #{@merchant_data}, merchant_optin_id:"\
369
+ " #{@merchant_optin_id}, optin_terms: #{@optin_terms}, seller_of_record:"\
370
+ " #{@seller_of_record}, source_country: #{@source_country}, timeout: #{@timeout}>"
371
+ end
372
+
373
+ # Provides a debugging-friendly string with detailed object information.
374
+ def inspect
375
+ class_name = self.class.name.split('::').last
376
+ "<#{class_name} charge_type: #{@charge_type.inspect}, country: #{@country.inspect},"\
377
+ " currency: #{@currency.inspect}, hosted: #{@hosted.inspect}, merchant_consumer_id:"\
378
+ " #{@merchant_consumer_id.inspect}, merchant_id: #{@merchant_id.inspect},"\
379
+ " merchant_item_description: #{@merchant_item_description.inspect}, merchant_request_id:"\
380
+ " #{@merchant_request_id.inspect}, merchant_transaction_id:"\
381
+ " #{@merchant_transaction_id.inspect}, notification_url: #{@notification_url.inspect},"\
382
+ " payment_method: #{@payment_method.inspect}, total_amount: #{@total_amount.inspect},"\
383
+ " bank_id: #{@bank_id.inspect}, consumer_ip_address: #{@consumer_ip_address.inspect},"\
384
+ " consumer_transaction_data: #{@consumer_transaction_data.inspect}, merchant_data:"\
385
+ " #{@merchant_data.inspect}, merchant_optin_id: #{@merchant_optin_id.inspect}, optin_terms:"\
386
+ " #{@optin_terms.inspect}, seller_of_record: #{@seller_of_record.inspect}, source_country:"\
387
+ " #{@source_country.inspect}, timeout: #{@timeout.inspect}>"
388
+ end
389
+ end
390
+ end
@@ -0,0 +1,96 @@
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
+ # ChargePlusOptinRequestHosted Model.
8
+ class ChargePlusOptinRequestHosted < 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
+ # True if a mobile-optimized purchase flow should be used for this request,
18
+ # false otherwise.
19
+ # Example: A non-mobile-optimized flow could display a QR code on the user's
20
+ # mobile. The user would be unable to scan the QR code because they are
21
+ # already on their mobile.
22
+ # A mobile-optimized flow could display a mobile login page to the user.
23
+ # @return [TrueClass | FalseClass]
24
+ attr_accessor :use_mobile_flow
25
+
26
+ # A mapping from model property names to API property names.
27
+ def self.names
28
+ @_hash = {} if @_hash.nil?
29
+ @_hash['forward_url'] = 'forward-url'
30
+ @_hash['use_mobile_flow'] = 'use-mobile-flow'
31
+ @_hash
32
+ end
33
+
34
+ # An array for optional fields
35
+ def self.optionals
36
+ %w[
37
+ use_mobile_flow
38
+ ]
39
+ end
40
+
41
+ # An array for nullable fields
42
+ def self.nullables
43
+ []
44
+ end
45
+
46
+ def initialize(forward_url = nil, use_mobile_flow = false)
47
+ @forward_url = forward_url
48
+ @use_mobile_flow = use_mobile_flow unless use_mobile_flow == SKIP
49
+ end
50
+
51
+ # Creates an instance of the object from a hash.
52
+ def self.from_hash(hash)
53
+ return nil unless hash
54
+
55
+ # Extract variables from the hash.
56
+ forward_url = hash.key?('forward-url') ? hash['forward-url'] : nil
57
+ use_mobile_flow = hash['use-mobile-flow'] ||= false
58
+
59
+ # Create object from extracted values.
60
+ ChargePlusOptinRequestHosted.new(forward_url,
61
+ use_mobile_flow)
62
+ end
63
+
64
+ def self.from_element(root)
65
+ forward_url = XmlUtilities.from_element(root, 'forward-url', String)
66
+ use_mobile_flow = XmlUtilities.from_element(root, 'use-mobile-flow',
67
+ TrueClass)
68
+
69
+ new(forward_url,
70
+ use_mobile_flow)
71
+ end
72
+
73
+ def to_xml_element(doc, root_name)
74
+ root = doc.create_element(root_name)
75
+
76
+ XmlUtilities.add_as_subelement(doc, root, 'forward-url', forward_url)
77
+ XmlUtilities.add_as_subelement(doc, root, 'use-mobile-flow',
78
+ use_mobile_flow)
79
+
80
+ root
81
+ end
82
+
83
+ # Provides a human-readable string representation of the object.
84
+ def to_s
85
+ class_name = self.class.name.split('::').last
86
+ "<#{class_name} forward_url: #{@forward_url}, use_mobile_flow: #{@use_mobile_flow}>"
87
+ end
88
+
89
+ # Provides a debugging-friendly string with detailed object information.
90
+ def inspect
91
+ class_name = self.class.name.split('::').last
92
+ "<#{class_name} forward_url: #{@forward_url.inspect}, use_mobile_flow:"\
93
+ " #{@use_mobile_flow.inspect}>"
94
+ end
95
+ end
96
+ end