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,278 @@
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
+ # ChargePlusOptinResponse Model.
8
+ class ChargePlusOptinResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Boku-assigned merchant ID.
13
+ # @return [String]
14
+ attr_accessor :merchant_id
15
+
16
+ # Merchant-assigned unique request ID.
17
+ # @return [String]
18
+ attr_accessor :merchant_request_id
19
+
20
+ # Merchant-assigned transaction ID.
21
+ # _***Boku recommends merchants send this ID for future reference**_
22
+ # @return [String]
23
+ attr_accessor :merchant_transaction_id
24
+
25
+ # The payment method selected
26
+ # @return [String]
27
+ attr_accessor :payment_method
28
+
29
+ # The 'result' element is defined in every response type. It is used to
30
+ # convey the outcome of an API request.
31
+ # @return [Result]
32
+ attr_accessor :result
33
+
34
+ # The Boku Bank ID selected by the consumer.
35
+ # @return [String]
36
+ attr_accessor :bank_id
37
+
38
+ # Boku-generated unique ID for the charge.
39
+ # If null, no charge was created, e.g. because the request was rejected.
40
+ # @return [String]
41
+ attr_accessor :charge_id
42
+
43
+ # Status of the charge at the time this response was returned.
44
+ # If 'in-progress' is returned, the charge call should be re-issued with the
45
+ # same request ID until a final status is reached.
46
+ # If null, no charge was created (e.g., because the request was rejected).
47
+ # @return [ChargeStatusEnum]
48
+ attr_accessor :charge_status
49
+
50
+ # ISO 3166-1 alpha-2 country code.
51
+ # @return [String]
52
+ attr_accessor :country
53
+
54
+ # ISO 3166-1 alpha-2 country code.
55
+ # @return [ChargePlusOptinResponseHosted]
56
+ attr_accessor :hosted
57
+
58
+ # Merchant-supplied metadata
59
+ # @return [String]
60
+ attr_accessor :merchant_data
61
+
62
+ # Boku-assigned unique opt-in ID.
63
+ # @return [String]
64
+ attr_accessor :optin_id
65
+
66
+ # Gives the state of the opt-in at the time this response was returned
67
+ # @return [OptinState]
68
+ attr_accessor :optin_state
69
+
70
+ # Optin and Charge Request API can be made for specific Seller of Record
71
+ # previously registered with Boku.
72
+ # @return [SellerOfRecord]
73
+ attr_accessor :seller_of_record
74
+
75
+ # Time request was received ("YYYY-MM-DD hh:mm:ss").
76
+ # All timestamps are in UTC.
77
+ # @return [String]
78
+ attr_accessor :timestamp
79
+
80
+ # A mapping from model property names to API property names.
81
+ def self.names
82
+ @_hash = {} if @_hash.nil?
83
+ @_hash['merchant_id'] = 'merchant-id'
84
+ @_hash['merchant_request_id'] = 'merchant-request-id'
85
+ @_hash['merchant_transaction_id'] = 'merchant-transaction-id'
86
+ @_hash['payment_method'] = 'payment-method'
87
+ @_hash['result'] = 'result'
88
+ @_hash['bank_id'] = 'bank-id'
89
+ @_hash['charge_id'] = 'charge-id'
90
+ @_hash['charge_status'] = 'charge-status'
91
+ @_hash['country'] = 'country'
92
+ @_hash['hosted'] = 'hosted'
93
+ @_hash['merchant_data'] = 'merchant-data'
94
+ @_hash['optin_id'] = 'optin-id'
95
+ @_hash['optin_state'] = 'optin-state'
96
+ @_hash['seller_of_record'] = 'seller-of-record'
97
+ @_hash['timestamp'] = 'timestamp'
98
+ @_hash
99
+ end
100
+
101
+ # An array for optional fields
102
+ def self.optionals
103
+ %w[
104
+ bank_id
105
+ charge_id
106
+ charge_status
107
+ country
108
+ hosted
109
+ merchant_data
110
+ optin_id
111
+ optin_state
112
+ seller_of_record
113
+ timestamp
114
+ ]
115
+ end
116
+
117
+ # An array for nullable fields
118
+ def self.nullables
119
+ []
120
+ end
121
+
122
+ def initialize(merchant_id = nil, merchant_request_id = nil,
123
+ merchant_transaction_id = nil, payment_method = nil,
124
+ result = nil, bank_id = SKIP, charge_id = SKIP,
125
+ charge_status = SKIP, country = SKIP, hosted = SKIP,
126
+ merchant_data = SKIP, optin_id = SKIP, optin_state = SKIP,
127
+ seller_of_record = SKIP, timestamp = SKIP)
128
+ @merchant_id = merchant_id
129
+ @merchant_request_id = merchant_request_id
130
+ @merchant_transaction_id = merchant_transaction_id
131
+ @payment_method = payment_method
132
+ @result = result
133
+ @bank_id = bank_id unless bank_id == SKIP
134
+ @charge_id = charge_id unless charge_id == SKIP
135
+ @charge_status = charge_status unless charge_status == SKIP
136
+ @country = country unless country == SKIP
137
+ @hosted = hosted unless hosted == SKIP
138
+ @merchant_data = merchant_data unless merchant_data == SKIP
139
+ @optin_id = optin_id unless optin_id == SKIP
140
+ @optin_state = optin_state unless optin_state == SKIP
141
+ @seller_of_record = seller_of_record unless seller_of_record == SKIP
142
+ @timestamp = timestamp unless timestamp == SKIP
143
+ end
144
+
145
+ # Creates an instance of the object from a hash.
146
+ def self.from_hash(hash)
147
+ return nil unless hash
148
+
149
+ # Extract variables from the hash.
150
+ merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
151
+ merchant_request_id =
152
+ hash.key?('merchant-request-id') ? hash['merchant-request-id'] : nil
153
+ merchant_transaction_id =
154
+ hash.key?('merchant-transaction-id') ? hash['merchant-transaction-id'] : nil
155
+ payment_method =
156
+ hash.key?('payment-method') ? hash['payment-method'] : nil
157
+ result = Result.from_hash(hash['result']) if hash['result']
158
+ bank_id = hash.key?('bank-id') ? hash['bank-id'] : SKIP
159
+ charge_id = hash.key?('charge-id') ? hash['charge-id'] : SKIP
160
+ charge_status = hash.key?('charge-status') ? hash['charge-status'] : SKIP
161
+ country = hash.key?('country') ? hash['country'] : SKIP
162
+ hosted = ChargePlusOptinResponseHosted.from_hash(hash['hosted']) if hash['hosted']
163
+ merchant_data = hash.key?('merchant-data') ? hash['merchant-data'] : SKIP
164
+ optin_id = hash.key?('optin-id') ? hash['optin-id'] : SKIP
165
+ optin_state = OptinState.from_hash(hash['optin-state']) if hash['optin-state']
166
+ seller_of_record = SellerOfRecord.from_hash(hash['seller-of-record']) if
167
+ hash['seller-of-record']
168
+ timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP
169
+
170
+ # Create object from extracted values.
171
+ ChargePlusOptinResponse.new(merchant_id,
172
+ merchant_request_id,
173
+ merchant_transaction_id,
174
+ payment_method,
175
+ result,
176
+ bank_id,
177
+ charge_id,
178
+ charge_status,
179
+ country,
180
+ hosted,
181
+ merchant_data,
182
+ optin_id,
183
+ optin_state,
184
+ seller_of_record,
185
+ timestamp)
186
+ end
187
+
188
+ def self.from_element(root)
189
+ merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
190
+ merchant_request_id = XmlUtilities.from_element(root,
191
+ 'merchant-request-id',
192
+ String)
193
+ merchant_transaction_id = XmlUtilities.from_element(
194
+ root, 'merchant-transaction-id', String
195
+ )
196
+ payment_method = XmlUtilities.from_element(root, 'payment-method', String)
197
+ result = XmlUtilities.from_element(root, 'result', Result)
198
+ bank_id = XmlUtilities.from_element(root, 'bank-id', String)
199
+ charge_id = XmlUtilities.from_element(root, 'charge-id', String)
200
+ charge_status = XmlUtilities.from_element(root, 'charge-status', String)
201
+ country = XmlUtilities.from_element(root, 'country', String)
202
+ hosted = XmlUtilities.from_element(root, 'hosted',
203
+ ChargePlusOptinResponseHosted)
204
+ merchant_data = XmlUtilities.from_element(root, 'merchant-data', String)
205
+ optin_id = XmlUtilities.from_element(root, 'optin-id', String)
206
+ optin_state = XmlUtilities.from_element(root, 'optin-state', OptinState)
207
+ seller_of_record = XmlUtilities.from_element(root, 'seller-of-record',
208
+ SellerOfRecord)
209
+ timestamp = XmlUtilities.from_element(root, 'timestamp', String)
210
+
211
+ new(merchant_id,
212
+ merchant_request_id,
213
+ merchant_transaction_id,
214
+ payment_method,
215
+ result,
216
+ bank_id,
217
+ charge_id,
218
+ charge_status,
219
+ country,
220
+ hosted,
221
+ merchant_data,
222
+ optin_id,
223
+ optin_state,
224
+ seller_of_record,
225
+ timestamp)
226
+ end
227
+
228
+ def to_xml_element(doc, root_name)
229
+ root = doc.create_element(root_name)
230
+
231
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
232
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-request-id',
233
+ merchant_request_id)
234
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-transaction-id',
235
+ merchant_transaction_id)
236
+ XmlUtilities.add_as_subelement(doc, root, 'payment-method',
237
+ payment_method)
238
+ XmlUtilities.add_as_subelement(doc, root, 'result', result)
239
+ XmlUtilities.add_as_subelement(doc, root, 'bank-id', bank_id)
240
+ XmlUtilities.add_as_subelement(doc, root, 'charge-id', charge_id)
241
+ XmlUtilities.add_as_subelement(doc, root, 'charge-status', charge_status)
242
+ XmlUtilities.add_as_subelement(doc, root, 'country', country)
243
+ XmlUtilities.add_as_subelement(doc, root, 'hosted', hosted)
244
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-data', merchant_data)
245
+ XmlUtilities.add_as_subelement(doc, root, 'optin-id', optin_id)
246
+ XmlUtilities.add_as_subelement(doc, root, 'optin-state', optin_state)
247
+ XmlUtilities.add_as_subelement(doc, root, 'seller-of-record',
248
+ seller_of_record)
249
+ XmlUtilities.add_as_subelement(doc, root, 'timestamp', timestamp)
250
+
251
+ root
252
+ end
253
+
254
+ # Provides a human-readable string representation of the object.
255
+ def to_s
256
+ class_name = self.class.name.split('::').last
257
+ "<#{class_name} merchant_id: #{@merchant_id}, merchant_request_id: #{@merchant_request_id},"\
258
+ " merchant_transaction_id: #{@merchant_transaction_id}, payment_method: #{@payment_method},"\
259
+ " result: #{@result}, bank_id: #{@bank_id}, charge_id: #{@charge_id}, charge_status:"\
260
+ " #{@charge_status}, country: #{@country}, hosted: #{@hosted}, merchant_data:"\
261
+ " #{@merchant_data}, optin_id: #{@optin_id}, optin_state: #{@optin_state}, seller_of_record:"\
262
+ " #{@seller_of_record}, timestamp: #{@timestamp}>"
263
+ end
264
+
265
+ # Provides a debugging-friendly string with detailed object information.
266
+ def inspect
267
+ class_name = self.class.name.split('::').last
268
+ "<#{class_name} merchant_id: #{@merchant_id.inspect}, merchant_request_id:"\
269
+ " #{@merchant_request_id.inspect}, merchant_transaction_id:"\
270
+ " #{@merchant_transaction_id.inspect}, payment_method: #{@payment_method.inspect}, result:"\
271
+ " #{@result.inspect}, bank_id: #{@bank_id.inspect}, charge_id: #{@charge_id.inspect},"\
272
+ " charge_status: #{@charge_status.inspect}, country: #{@country.inspect}, hosted:"\
273
+ " #{@hosted.inspect}, merchant_data: #{@merchant_data.inspect}, optin_id:"\
274
+ " #{@optin_id.inspect}, optin_state: #{@optin_state.inspect}, seller_of_record:"\
275
+ " #{@seller_of_record.inspect}, timestamp: #{@timestamp.inspect}>"
276
+ end
277
+ end
278
+ 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
+ # ChargePlusOptinResponseHosted Model.
8
+ class ChargePlusOptinResponseHosted < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # URL, where the user should be redirected to so the charge can be
13
+ # authorized
14
+ # @return [String]
15
+ attr_accessor :redirect_url
16
+
17
+ # A mapping from model property names to API property names.
18
+ def self.names
19
+ @_hash = {} if @_hash.nil?
20
+ @_hash['redirect_url'] = 'redirect-url'
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(redirect_url = nil)
35
+ @redirect_url = redirect_url
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
+ redirect_url = hash.key?('redirect-url') ? hash['redirect-url'] : nil
44
+
45
+ # Create object from extracted values.
46
+ ChargePlusOptinResponseHosted.new(redirect_url)
47
+ end
48
+
49
+ def self.from_element(root)
50
+ redirect_url = XmlUtilities.from_element(root, 'redirect-url', String)
51
+
52
+ new(redirect_url)
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, 'redirect-url', redirect_url)
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} redirect_url: #{@redirect_url}>"
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} redirect_url: #{@redirect_url.inspect}>"
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,332 @@
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' Request - General Parameters
8
+ class ChargeRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # ISO 4217 three-letter currency code.
13
+ # @return [String]
14
+ attr_accessor :currency
15
+
16
+ # Boku-assigned merchant ID.
17
+ # @return [String]
18
+ attr_accessor :merchant_id
19
+
20
+ # A short purchase description that appears on the consumer bill. A string
21
+ # longer than 20 characters will be truncated.
22
+ # @return [String]
23
+ attr_accessor :merchant_item_description
24
+
25
+ # Merchant-assigned unique request ID.
26
+ # Multiple requests received with the same merchant-request-id will be
27
+ # handled idempotently within the idempotency window.
28
+ # @return [String]
29
+ attr_accessor :merchant_request_id
30
+
31
+ # Merchant-assigned transaction ID.
32
+ # _***Boku recommends merchants send this ID for future reference**_
33
+ # @return [String]
34
+ attr_accessor :merchant_transaction_id
35
+
36
+ # Total amount to charge, including tax.
37
+ # @return [Float]
38
+ attr_accessor :total_amount
39
+
40
+ # The IP address of the consumer. Helps improve fraud detection by
41
+ # supporting internal risk checks and partner decisions. Supports IPv4 and
42
+ # IPv6 formats.
43
+ # @return [String]
44
+ attr_accessor :consumer_ip_address
45
+
46
+ # Merchant-supplied metadata. This metadata is returned in the 'charge'
47
+ # response and can be available in merchant reports.
48
+ # @return [String]
49
+ attr_accessor :merchant_data
50
+
51
+ # Merchant-assigned unique opt-in ID.
52
+ # @return [String]
53
+ attr_accessor :merchant_optin_id
54
+
55
+ # Supplies the URL for Boku to send a notification once the charge is
56
+ # complete.
57
+ # _***Required only for transactions open longer than 24 hours, such as
58
+ # direct debits. Consult your Integration Manager to confirm if this is
59
+ # needed for your integration.**_
60
+ # @return [String]
61
+ attr_accessor :notification_url
62
+
63
+ # Boku-assigned consumer opt-in ID.
64
+ # @return [String]
65
+ attr_accessor :optin_id
66
+
67
+ # A merchant-defined identifier for the subscription product. Required only
68
+ # when the opt-in purpose is 'subscription-mandate'. The SKU used in the
69
+ # charge request must match the one provided during opt-in.
70
+ # @return [String]
71
+ attr_accessor :product_sku
72
+
73
+ # Optin and Charge Request API can be made for specific Seller of Record
74
+ # previously registered with Boku.
75
+ # @return [SellerOfRecord]
76
+ attr_accessor :seller_of_record
77
+
78
+ # **DISCLAIMER: This API or element is use-case specific and not needed for
79
+ # generic usage of our payment product. Please disregard unless otherwise
80
+ # directed to include in your integration.**
81
+ # Element containing settlement information about the original charge.
82
+ # @return [Settlement]
83
+ attr_accessor :settlement
84
+
85
+ # ISO 3166-1 alpha-2 country code where this operation is occurring (e.g.,
86
+ # which storefront).
87
+ # @return [String]
88
+ attr_accessor :source_country
89
+
90
+ # ISO 3166-1 alpha-2 country code where this operation is occurring (e.g.,
91
+ # which storefront).
92
+ # @return [Subscription]
93
+ attr_accessor :subscription
94
+
95
+ # Specifies how long to block waiting for a response
96
+ # @return [Timeout]
97
+ attr_accessor :timeout
98
+
99
+ # A mapping from model property names to API property names.
100
+ def self.names
101
+ @_hash = {} if @_hash.nil?
102
+ @_hash['currency'] = 'currency'
103
+ @_hash['merchant_id'] = 'merchant-id'
104
+ @_hash['merchant_item_description'] = 'merchant-item-description'
105
+ @_hash['merchant_request_id'] = 'merchant-request-id'
106
+ @_hash['merchant_transaction_id'] = 'merchant-transaction-id'
107
+ @_hash['total_amount'] = 'total-amount'
108
+ @_hash['consumer_ip_address'] = 'consumer-ip-address'
109
+ @_hash['merchant_data'] = 'merchant-data'
110
+ @_hash['merchant_optin_id'] = 'merchant-optin-id'
111
+ @_hash['notification_url'] = 'notification-url'
112
+ @_hash['optin_id'] = 'optin-id'
113
+ @_hash['product_sku'] = 'product-sku'
114
+ @_hash['seller_of_record'] = 'seller-of-record'
115
+ @_hash['settlement'] = 'settlement'
116
+ @_hash['source_country'] = 'source-country'
117
+ @_hash['subscription'] = 'subscription'
118
+ @_hash['timeout'] = 'timeout'
119
+ @_hash
120
+ end
121
+
122
+ # An array for optional fields
123
+ def self.optionals
124
+ %w[
125
+ consumer_ip_address
126
+ merchant_data
127
+ merchant_optin_id
128
+ notification_url
129
+ optin_id
130
+ product_sku
131
+ seller_of_record
132
+ settlement
133
+ source_country
134
+ subscription
135
+ timeout
136
+ ]
137
+ end
138
+
139
+ # An array for nullable fields
140
+ def self.nullables
141
+ []
142
+ end
143
+
144
+ def initialize(currency = nil, merchant_id = nil,
145
+ merchant_item_description = nil, merchant_request_id = nil,
146
+ merchant_transaction_id = nil, total_amount = nil,
147
+ consumer_ip_address = SKIP, merchant_data = SKIP,
148
+ merchant_optin_id = SKIP, notification_url = SKIP,
149
+ optin_id = SKIP, product_sku = SKIP, seller_of_record = SKIP,
150
+ settlement = SKIP, source_country = SKIP,
151
+ subscription = SKIP, timeout = SKIP)
152
+ @currency = currency
153
+ @merchant_id = merchant_id
154
+ @merchant_item_description = merchant_item_description
155
+ @merchant_request_id = merchant_request_id
156
+ @merchant_transaction_id = merchant_transaction_id
157
+ @total_amount = total_amount
158
+ @consumer_ip_address = consumer_ip_address unless consumer_ip_address == SKIP
159
+ @merchant_data = merchant_data unless merchant_data == SKIP
160
+ @merchant_optin_id = merchant_optin_id unless merchant_optin_id == SKIP
161
+ @notification_url = notification_url unless notification_url == SKIP
162
+ @optin_id = optin_id unless optin_id == SKIP
163
+ @product_sku = product_sku unless product_sku == SKIP
164
+ @seller_of_record = seller_of_record unless seller_of_record == SKIP
165
+ @settlement = settlement unless settlement == SKIP
166
+ @source_country = source_country unless source_country == SKIP
167
+ @subscription = subscription unless subscription == SKIP
168
+ @timeout = timeout unless timeout == SKIP
169
+ end
170
+
171
+ # Creates an instance of the object from a hash.
172
+ def self.from_hash(hash)
173
+ return nil unless hash
174
+
175
+ # Extract variables from the hash.
176
+ currency = hash.key?('currency') ? hash['currency'] : nil
177
+ merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
178
+ merchant_item_description =
179
+ hash.key?('merchant-item-description') ? hash['merchant-item-description'] : nil
180
+ merchant_request_id =
181
+ hash.key?('merchant-request-id') ? hash['merchant-request-id'] : nil
182
+ merchant_transaction_id =
183
+ hash.key?('merchant-transaction-id') ? hash['merchant-transaction-id'] : nil
184
+ total_amount = hash.key?('total-amount') ? hash['total-amount'] : nil
185
+ consumer_ip_address =
186
+ hash.key?('consumer-ip-address') ? hash['consumer-ip-address'] : SKIP
187
+ merchant_data = hash.key?('merchant-data') ? hash['merchant-data'] : SKIP
188
+ merchant_optin_id =
189
+ hash.key?('merchant-optin-id') ? hash['merchant-optin-id'] : SKIP
190
+ notification_url =
191
+ hash.key?('notification-url') ? hash['notification-url'] : SKIP
192
+ optin_id = hash.key?('optin-id') ? hash['optin-id'] : SKIP
193
+ product_sku = hash.key?('product-sku') ? hash['product-sku'] : SKIP
194
+ seller_of_record = SellerOfRecord.from_hash(hash['seller-of-record']) if
195
+ hash['seller-of-record']
196
+ settlement = Settlement.from_hash(hash['settlement']) if hash['settlement']
197
+ source_country =
198
+ hash.key?('source-country') ? hash['source-country'] : SKIP
199
+ subscription = Subscription.from_hash(hash['subscription']) if hash['subscription']
200
+ timeout = Timeout.from_hash(hash['timeout']) if hash['timeout']
201
+
202
+ # Create object from extracted values.
203
+ ChargeRequest.new(currency,
204
+ merchant_id,
205
+ merchant_item_description,
206
+ merchant_request_id,
207
+ merchant_transaction_id,
208
+ total_amount,
209
+ consumer_ip_address,
210
+ merchant_data,
211
+ merchant_optin_id,
212
+ notification_url,
213
+ optin_id,
214
+ product_sku,
215
+ seller_of_record,
216
+ settlement,
217
+ source_country,
218
+ subscription,
219
+ timeout)
220
+ end
221
+
222
+ def self.from_element(root)
223
+ currency = XmlUtilities.from_element(root, 'currency', String)
224
+ merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
225
+ merchant_item_description = XmlUtilities.from_element(
226
+ root, 'merchant-item-description', String
227
+ )
228
+ merchant_request_id = XmlUtilities.from_element(root,
229
+ 'merchant-request-id',
230
+ String)
231
+ merchant_transaction_id = XmlUtilities.from_element(
232
+ root, 'merchant-transaction-id', String
233
+ )
234
+ total_amount = XmlUtilities.from_element(root, 'total-amount', Float)
235
+ consumer_ip_address = XmlUtilities.from_element(root,
236
+ 'consumer-ip-address',
237
+ String)
238
+ merchant_data = XmlUtilities.from_element(root, 'merchant-data', String)
239
+ merchant_optin_id = XmlUtilities.from_element(root, 'merchant-optin-id',
240
+ String)
241
+ notification_url = XmlUtilities.from_element(root, 'notification-url',
242
+ String)
243
+ optin_id = XmlUtilities.from_element(root, 'optin-id', String)
244
+ product_sku = XmlUtilities.from_element(root, 'product-sku', String)
245
+ seller_of_record = XmlUtilities.from_element(root, 'seller-of-record',
246
+ SellerOfRecord)
247
+ settlement = XmlUtilities.from_element(root, 'Settlement', Settlement)
248
+ source_country = XmlUtilities.from_element(root, 'source-country', String)
249
+ subscription = XmlUtilities.from_element(root, 'subscription',
250
+ Subscription)
251
+ timeout = XmlUtilities.from_element(root, 'timeout', Timeout)
252
+
253
+ new(currency,
254
+ merchant_id,
255
+ merchant_item_description,
256
+ merchant_request_id,
257
+ merchant_transaction_id,
258
+ total_amount,
259
+ consumer_ip_address,
260
+ merchant_data,
261
+ merchant_optin_id,
262
+ notification_url,
263
+ optin_id,
264
+ product_sku,
265
+ seller_of_record,
266
+ settlement,
267
+ source_country,
268
+ subscription,
269
+ timeout)
270
+ end
271
+
272
+ def to_xml_element(doc, root_name)
273
+ root = doc.create_element(root_name)
274
+
275
+ XmlUtilities.add_as_subelement(doc, root, 'currency', currency)
276
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
277
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-item-description',
278
+ merchant_item_description)
279
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-request-id',
280
+ merchant_request_id)
281
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-transaction-id',
282
+ merchant_transaction_id)
283
+ XmlUtilities.add_as_subelement(doc, root, 'total-amount', total_amount)
284
+ XmlUtilities.add_as_subelement(doc, root, 'consumer-ip-address',
285
+ consumer_ip_address)
286
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-data', merchant_data)
287
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-optin-id',
288
+ merchant_optin_id)
289
+ XmlUtilities.add_as_subelement(doc, root, 'notification-url',
290
+ notification_url)
291
+ XmlUtilities.add_as_subelement(doc, root, 'optin-id', optin_id)
292
+ XmlUtilities.add_as_subelement(doc, root, 'product-sku', product_sku)
293
+ XmlUtilities.add_as_subelement(doc, root, 'seller-of-record',
294
+ seller_of_record)
295
+ XmlUtilities.add_as_subelement(doc, root, 'Settlement', settlement)
296
+ XmlUtilities.add_as_subelement(doc, root, 'source-country',
297
+ source_country)
298
+ XmlUtilities.add_as_subelement(doc, root, 'subscription', subscription)
299
+ XmlUtilities.add_as_subelement(doc, root, 'timeout', timeout)
300
+
301
+ root
302
+ end
303
+
304
+ # Provides a human-readable string representation of the object.
305
+ def to_s
306
+ class_name = self.class.name.split('::').last
307
+ "<#{class_name} currency: #{@currency}, merchant_id: #{@merchant_id},"\
308
+ " merchant_item_description: #{@merchant_item_description}, merchant_request_id:"\
309
+ " #{@merchant_request_id}, merchant_transaction_id: #{@merchant_transaction_id},"\
310
+ " total_amount: #{@total_amount}, consumer_ip_address: #{@consumer_ip_address},"\
311
+ " merchant_data: #{@merchant_data}, merchant_optin_id: #{@merchant_optin_id},"\
312
+ " notification_url: #{@notification_url}, optin_id: #{@optin_id}, product_sku:"\
313
+ " #{@product_sku}, seller_of_record: #{@seller_of_record}, settlement: #{@settlement},"\
314
+ " source_country: #{@source_country}, subscription: #{@subscription}, timeout: #{@timeout}>"
315
+ end
316
+
317
+ # Provides a debugging-friendly string with detailed object information.
318
+ def inspect
319
+ class_name = self.class.name.split('::').last
320
+ "<#{class_name} currency: #{@currency.inspect}, merchant_id: #{@merchant_id.inspect},"\
321
+ " merchant_item_description: #{@merchant_item_description.inspect}, merchant_request_id:"\
322
+ " #{@merchant_request_id.inspect}, merchant_transaction_id:"\
323
+ " #{@merchant_transaction_id.inspect}, total_amount: #{@total_amount.inspect},"\
324
+ " consumer_ip_address: #{@consumer_ip_address.inspect}, merchant_data:"\
325
+ " #{@merchant_data.inspect}, merchant_optin_id: #{@merchant_optin_id.inspect},"\
326
+ " notification_url: #{@notification_url.inspect}, optin_id: #{@optin_id.inspect},"\
327
+ " product_sku: #{@product_sku.inspect}, seller_of_record: #{@seller_of_record.inspect},"\
328
+ " settlement: #{@settlement.inspect}, source_country: #{@source_country.inspect},"\
329
+ " subscription: #{@subscription.inspect}, timeout: #{@timeout.inspect}>"
330
+ end
331
+ end
332
+ end