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,428 @@
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
+ # ConsumerRegistrationController
8
+ class ConsumerRegistrationController < BaseController
9
+ # The `optin` API call is one of two ways to initiate the opt-in process.
10
+ # The other is `optin-info`, which uses cached information when available.
11
+ # While `optin` can be used to initiate all opt-ins, it is only _required_
12
+ # for the following cases:
13
+ # - One-time Pin (OTP) opt-ins – to trigger sending an OTP SMS to the
14
+ # device.
15
+ # - Carrier gateway opt-ins* – when `optin-info` does not return a static
16
+ # URL and a unique URL must be generated per opt-in.
17
+ # After a successful `optin` call, the opt-in typically enters the
18
+ # `pending-validate` status.
19
+ # ### Supported Optin Types
20
+ # - `otp` – Sends a one-time PIN to the consumer via SMS, confirmed via
21
+ # `confirm-optin`.
22
+ # - `hosted` – Redirects the consumer to an issuer-provided UI for
23
+ # verification.
24
+ # - `carrier-gw`* – Verifies the consumer via a ping through the carrier
25
+ # gateway.
26
+ # - `silent-mo`* – Verifies the consumer by sending a silent SMS from the
27
+ # device.
28
+ # _*These optin types are use-case specific and not required for most
29
+ # integrations. Only include them if explicitly directed._
30
+ # ### Related Methods
31
+ # The `optin` method is used in conjunction with the following to complete
32
+ # consumer approval:
33
+ # - `validate-optin` – Validates the phone number (billing account) the
34
+ # consumer is registering as a payment method.
35
+ # - `submit-optin-parameters` – Submits carrier-specific parameters such as
36
+ # an account PIN, if required.
37
+ # - `confirm-optin` – Finalizes the opt-in and activates it for billing.
38
+ # ### OTP Optin Defaults
39
+ # For OTP-based opt-ins using Boku-managed PINs, the following defaults
40
+ # apply:
41
+ # - PIN length: 4 digits
42
+ # - Validity period: 300 seconds
43
+ # - Maximum attempts: 3 (_Note: Carrier-managed PINs may follow different
44
+ # rules_).
45
+ # @param [OptinRequest] body Required parameter: TODO: type description
46
+ # here
47
+ # @return [OptinResponse] Response from the API call.
48
+ def optin(body)
49
+ @api_call
50
+ .request(new_request_builder(HttpMethodEnum::POST,
51
+ '/optin/3.0/optin',
52
+ Server::DEFAULT)
53
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
54
+ .xml_attributes(XmlAttributes.new
55
+ .value(body)
56
+ .root_element_name('optin-request'))
57
+ .header_param(new_parameter('application/xml', key: 'accept'))
58
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
59
+ .response(new_response_handler
60
+ .deserializer(XmlUtilities.method(:deserialize_xml))
61
+ .deserialize_into(OptinResponse)
62
+ .is_xml_response(true)
63
+ .xml_attribute(XmlAttributes.new
64
+ .root_element_name('optin-response')))
65
+ .execute
66
+ end
67
+
68
+ # **DISCLAIMER: This API or element is use-case specific and not needed for
69
+ # generic usage of our payment product. Please disregard unless otherwise
70
+ # directed to include in your integration.**
71
+ # The main purpose of an opt-in is to identify and verify the payment method
72
+ # that the end-user wants to register. In the process, the user confirms
73
+ # that they have control over the corresponding payment method. Once an
74
+ # opt-in has begun via an `optin` API call, the `validate-optin` call is
75
+ # used to complete this verification and in most cases retrieve the end-user
76
+ # details such as the account identifier of the user.
77
+ # Specifically for each opt-in type:
78
+ # * **otp**: Submit the OTP, and if correct receive confirmation that the
79
+ # user owns the MSISDN and handset.
80
+ # **Note**: default configuration on Boku-mananged PIN for the number of OTP
81
+ # verification attempts is 3 and the default PIN expiration is 300 seconds.
82
+ # * **carrier-gw**: Confirm receipt of the carrier-gw URL call on Boku's
83
+ # servers, and retrieve the MSISDN via a secure channel if the carrier-gw
84
+ # URL call itself is not sufficiently secured. Potentially block on an
85
+ # asynchronous user identification callback from the carrier.
86
+ # * **silent-mo**: Block upon receipt of the silent MO SMS if not yet
87
+ # received, and once complete retrieve the received MSISDN details.
88
+ # * **hosted**: Confirm successful authentication via opt-in UI, and
89
+ # retrieve the account identifier of the user.
90
+ # After a successful `validate-optin` call, an opt-in should usually be in
91
+ # status `pending-confirm` awaiting a call to `confirm-optin`. In the case
92
+ # of a OTP opt-in, if the PIN expires, a new opt-in will need to be
93
+ # initiated with a new 'optin' request.
94
+ # @param [ValidateOptinRequest] body Required parameter: TODO: type
95
+ # description here
96
+ # @return [ValidateOptinResponse] Response from the API call.
97
+ def validate_optin(body)
98
+ @api_call
99
+ .request(new_request_builder(HttpMethodEnum::POST,
100
+ '/optin/3.0/validate-optin',
101
+ Server::DEFAULT)
102
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
103
+ .xml_attributes(XmlAttributes.new
104
+ .value(body)
105
+ .root_element_name('validate-optin-request'))
106
+ .header_param(new_parameter('application/xml', key: 'accept'))
107
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
108
+ .response(new_response_handler
109
+ .deserializer(XmlUtilities.method(:deserialize_xml))
110
+ .deserialize_into(ValidateOptinResponse)
111
+ .is_xml_response(true)
112
+ .xml_attribute(XmlAttributes.new
113
+ .root_element_name('validate-optin-response')))
114
+ .execute
115
+ end
116
+
117
+ # Assuming an opt-in is in state `pending-confirm` (i.e. all necessary
118
+ # information about the end-user has already been collected), this call
119
+ # confirms that the opt-in should be activated for billing (after a
120
+ # successful call, optin-status should be `active`).
121
+ # **Note**
122
+ # * In some cases, such as a carrier-gw opt-in where sufficient information
123
+ # was returned in the carrier-gw URL call response, `confirm-optin` may be
124
+ # called directly without first calling `validate-optin`.
125
+ # * If `include-account-profile` is already set to true during
126
+ # `validate-optin`, Boku recommends that merchant sets the
127
+ # `include-account-profile` to false during `confirm-optin` to optimize the
128
+ # optin flow time as account-profile requires an external call to the
129
+ # carrier.
130
+ # @param [ConfirmOptinRequest] body Required parameter: TODO: type
131
+ # description here
132
+ # @return [ConfirmOptinResponse] Response from the API call.
133
+ def confirm_optin(body)
134
+ @api_call
135
+ .request(new_request_builder(HttpMethodEnum::POST,
136
+ '/optin/3.0/confirm-optin',
137
+ Server::DEFAULT)
138
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
139
+ .xml_attributes(XmlAttributes.new
140
+ .value(body)
141
+ .root_element_name('confirm-optin-request'))
142
+ .header_param(new_parameter('application/xml', key: 'accept'))
143
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
144
+ .response(new_response_handler
145
+ .deserializer(XmlUtilities.method(:deserialize_xml))
146
+ .deserialize_into(ConfirmOptinResponse)
147
+ .is_xml_response(true)
148
+ .xml_attribute(XmlAttributes.new
149
+ .root_element_name('confirm-optin-response')))
150
+ .execute
151
+ end
152
+
153
+ # The purpose of the ‘cancel-optin’ API is for deactivating the consumer’s
154
+ # opt-in stored by Boku and the issuer.
155
+ # A merchant can use this method in the following possible scenarios:
156
+ # * User contacts the merchant requesting to remove their payment method
157
+ # * Merchant determines that the consumer’s billing account has encountered
158
+ # a permanent error that should not be retried in the future
159
+ # A cancel-optin request **must** be sent when a user removes the payment
160
+ # method from the merchant account. Various payment methods enforce a 1:1
161
+ # mapping, that is, a single payment method account can only be associated
162
+ # to a single merchant account. In the case that the merchant does not call
163
+ # cancel-optin, a user would be unable to associate their payment method
164
+ # account with any other merchant account, even though the user has already
165
+ # requested to remove the payment method from the merchant account.
166
+ # The 'optin-id' received from the 'optin' request at the time the consumer
167
+ # added their payment method must be supplied in the 'cancel-optin' request.
168
+ # @param [CancelOptinRequest] body Required parameter: TODO: type
169
+ # description here
170
+ # @return [CancelOptinResponse] Response from the API call.
171
+ def cancel_optin(body)
172
+ @api_call
173
+ .request(new_request_builder(HttpMethodEnum::POST,
174
+ '/optin/3.0/cancel-optin',
175
+ Server::DEFAULT)
176
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
177
+ .xml_attributes(XmlAttributes.new
178
+ .value(body)
179
+ .root_element_name('cancel-optin-request'))
180
+ .header_param(new_parameter('application/xml', key: 'accept'))
181
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
182
+ .response(new_response_handler
183
+ .deserializer(XmlUtilities.method(:deserialize_xml))
184
+ .deserialize_into(CancelOptinResponse)
185
+ .is_xml_response(true)
186
+ .xml_attribute(XmlAttributes.new
187
+ .root_element_name('cancel-optin-response')))
188
+ .execute
189
+ end
190
+
191
+ # **DISCLAIMER: This API or element is use-case specific and not needed for
192
+ # generic usage of our payment product. Please disregard unless otherwise
193
+ # directed to include in your integration.**
194
+ # Check the carrier billing eligibility of a previously authenticated
195
+ # consumer. The request requires an optin-id. The eligibility check
196
+ # consists of checking the account status of the consumer as well as the
197
+ # billing eligibility.
198
+ # @param [CheckEligibilityRequest] body Required parameter: TODO: type
199
+ # description here
200
+ # @return [CheckEligibilityResponse] Response from the API call.
201
+ def check_eligibility(body)
202
+ @api_call
203
+ .request(new_request_builder(HttpMethodEnum::POST,
204
+ '/optin/3.0/check-eligibility',
205
+ Server::DEFAULT)
206
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
207
+ .xml_attributes(XmlAttributes.new
208
+ .value(body)
209
+ .root_element_name('check-eligibility-request'))
210
+ .header_param(new_parameter('application/xml', key: 'accept'))
211
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
212
+ .response(new_response_handler
213
+ .deserializer(XmlUtilities.method(:deserialize_xml))
214
+ .deserialize_into(CheckEligibilityResponse)
215
+ .is_xml_response(true)
216
+ .xml_attribute(XmlAttributes.new
217
+ .root_element_name('check-eligibility-response')))
218
+ .execute
219
+ end
220
+
221
+ # **DISCLAIMER: This API or element is use-case specific and not needed for
222
+ # generic usage of our payment product. Please disregard unless otherwise
223
+ # directed to include in your integration.**
224
+ # Sends a PIN code via SMS to device associated with consumer's active
225
+ # opt-in to verify the consumer still controls the device.
226
+ # For OTP validity semantics, see the 'optin' API method.
227
+ # For resend functionality see the 'resend-otp' API method.
228
+ # @param [VerifyDeviceRequest] body Optional parameter: TODO: type
229
+ # description here
230
+ # @return [VerifyDeviceResponse] Response from the API call.
231
+ def verify_device(body: nil)
232
+ @api_call
233
+ .request(new_request_builder(HttpMethodEnum::POST,
234
+ '/optin/3.0/verify-device',
235
+ Server::DEFAULT)
236
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
237
+ .xml_attributes(XmlAttributes.new
238
+ .value(body)
239
+ .root_element_name('verify-device-request'))
240
+ .header_param(new_parameter('application/xml', key: 'accept'))
241
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
242
+ .response(new_response_handler
243
+ .deserializer(XmlUtilities.method(:deserialize_xml))
244
+ .deserialize_into(VerifyDeviceResponse)
245
+ .is_xml_response(true)
246
+ .xml_attribute(XmlAttributes.new
247
+ .root_element_name('verify-device-response')))
248
+ .execute
249
+ end
250
+
251
+ # **DISCLAIMER: This API or element is use-case specific and not needed for
252
+ # generic usage of our payment product. Please disregard unless otherwise
253
+ # directed to include in your integration.**
254
+ # Confirm consumer has received PIN code sent to device associated with the
255
+ # active approval.
256
+ # @param [ConfirmVerifyDeviceRequest] body Optional parameter: TODO: type
257
+ # description here
258
+ # @return [ConfirmVerifyDeviceResponse] Response from the API call.
259
+ def confirm_verify_device(body: nil)
260
+ @api_call
261
+ .request(new_request_builder(HttpMethodEnum::POST,
262
+ '/optin/3.0/confirm-verify-device',
263
+ Server::DEFAULT)
264
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
265
+ .xml_attributes(XmlAttributes.new
266
+ .value(body)
267
+ .root_element_name('confirm-verify-device-request'))
268
+ .header_param(new_parameter('application/xml', key: 'accept'))
269
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
270
+ .response(new_response_handler
271
+ .deserializer(XmlUtilities.method(:deserialize_xml))
272
+ .deserialize_into(ConfirmVerifyDeviceResponse)
273
+ .is_xml_response(true)
274
+ .xml_attribute(XmlAttributes.new
275
+ .root_element_name('confirm-verify-device-response')))
276
+ .execute
277
+ end
278
+
279
+ # **DISCLAIMER: This API or element is use-case specific and not needed for
280
+ # generic usage of our payment product. Please disregard unless otherwise
281
+ # directed to include in your integration.**
282
+ # The purpose of the ‘msisdn-network’ API is to identify the mobile operator
283
+ # network for a provided msisdn. If the mobile operator network is
284
+ # successfully determined, a Boku network identifier is returned.
285
+ # @param [MsisdnNetworkRequest] body Required parameter: TODO: type
286
+ # description here
287
+ # @return [MsisdnNetworkResponse] Response from the API call.
288
+ def get_msisdn_network(body)
289
+ @api_call
290
+ .request(new_request_builder(HttpMethodEnum::POST,
291
+ '/optin/3.0/msisdn-network',
292
+ Server::DEFAULT)
293
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
294
+ .xml_attributes(XmlAttributes.new
295
+ .value(body)
296
+ .root_element_name('msisdn-network-request'))
297
+ .header_param(new_parameter('application/xml', key: 'accept'))
298
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
299
+ .response(new_response_handler
300
+ .deserializer(XmlUtilities.method(:deserialize_xml))
301
+ .deserialize_into(MsisdnNetworkResponse)
302
+ .is_xml_response(true)
303
+ .xml_attribute(XmlAttributes.new
304
+ .root_element_name('msisdn-network-response')))
305
+ .execute
306
+ end
307
+
308
+ # The 'optin-info' call returns available opt-in methods on a per-carrier
309
+ # basis, for all supported carriers. Namely, while the 'network-info'
310
+ # request returns all carrier networks in a country, the 'optin-info'
311
+ # request returns only carrier networks that support carrier billing with
312
+ # the merchant. The returned data is intended to be used for selecting from
313
+ # available opt-in methods, and where possible allow a client device to
314
+ # initiate an opt-in using only the data returned by this call, rather than
315
+ # having to make a round-trip call to `optin`. The data returned from
316
+ # 'optin-info' is not specific to any one specific transaction or set of
317
+ # parameters, and is designed to be reused across multiple opt-ins.
318
+ # # Referenced opt-in methods
319
+ # Several opt-in methods are provided. The appropriate opt-in method will
320
+ # vary based on consumer platform and consumer connectivity.
321
+ # The use of a one-time PIN optin can be used with consumers on any platform
322
+ # and with any connectivity. The carrier gateway method and the silent MO
323
+ # methods can be used to optimize the experience of consumers on mobile
324
+ # devices.
325
+ # | Optin Method | Platform | Connectivity |
326
+ # |--------------|----------|--------------|
327
+ # | **opt**: send a one-time PIN to the end-user via SMS, which will be
328
+ # confirmed via confirm-optin | Any | Carrier data network, Wifi |
329
+ # | **carrier-gw**: attempt to verify the consumer using a ping through a
330
+ # carrier gateway | Mobile device | Carrier data network |
331
+ # | **silent-mo**: verify the consumer by sending a silent SMS from the
332
+ # device | Mobile device | Carrier data network, WiFi |
333
+ # # 'optin-info' caching
334
+ # The `optin-info` data is relatively static, and usually only changes due
335
+ # to either a carrier system migration (changing URL or short-code), or in
336
+ # rare cases an emergency re-routing of traffic via an alternate route in
337
+ # the case of carrier outages. Therefore, optin-info data is cacheable for
338
+ # relatively long periods - Boku recommends roughly 5 minutes. HTTP cache
339
+ # control headers are provided with the response which, if followed,
340
+ # implement Boku's recommended caching strategy.
341
+ # # 'optin-info' placeholder values
342
+ # The `client-call` `url` and `send-sms` body returned by an optin-info call
343
+ # may contain values that must be filled out at runtime specific to the
344
+ # current request in the form of '{placeholder-name}'.
345
+ # When using these strings, all placeholders must be replaced. If an unknown
346
+ # placeholder is encountered, the containing element should be treated as
347
+ # invalid.
348
+ # The current list of placeholder values is as follows:
349
+ # * **merchant-request-id**: This value has the same semantics as the
350
+ # `merchant-request-id` value in an `optin-request`. It must be replaced
351
+ # with a ID unique to each usage of the URL / SMS message / etc.
352
+ # @param [String] merchant_id Required parameter: TODO: type description
353
+ # here
354
+ # @return [OptinInfo] Response from the API call.
355
+ def get_optin_info(merchant_id)
356
+ @api_call
357
+ .request(new_request_builder(HttpMethodEnum::GET,
358
+ '/optin/3.0/optin-info/{merchantId}',
359
+ Server::DEFAULT)
360
+ .template_param(new_parameter(merchant_id, key: 'merchantId')
361
+ .should_encode(true))
362
+ .header_param(new_parameter('application/xml', key: 'accept')))
363
+ .response(new_response_handler
364
+ .deserializer(XmlUtilities.method(:deserialize_xml))
365
+ .deserialize_into(OptinInfo)
366
+ .is_xml_response(true)
367
+ .xml_attribute(XmlAttributes.new
368
+ .root_element_name('optin-info')))
369
+ .execute
370
+ end
371
+
372
+ # Retrieves the status and all details of optin matching the given request
373
+ # criteria.
374
+ # Requires the following values to be exclusively provided: optin-id,
375
+ # merchant-id
376
+ # @param [QueryOptinRequest] body Optional parameter: TODO: type description
377
+ # here
378
+ # @return [QueryOptinResponse] Response from the API call.
379
+ def query_optin(body: nil)
380
+ @api_call
381
+ .request(new_request_builder(HttpMethodEnum::POST,
382
+ '/optin/3.0/query-optin',
383
+ Server::DEFAULT)
384
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
385
+ .xml_attributes(XmlAttributes.new
386
+ .value(body)
387
+ .root_element_name('query-optin-request'))
388
+ .header_param(new_parameter('application/xml', key: 'accept'))
389
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
390
+ .response(new_response_handler
391
+ .deserializer(XmlUtilities.method(:deserialize_xml))
392
+ .deserialize_into(QueryOptinResponse)
393
+ .is_xml_response(true)
394
+ .xml_attribute(XmlAttributes.new
395
+ .root_element_name('query-optin-response')))
396
+ .execute
397
+ end
398
+
399
+ # When a user has started an opt-in using the `otpin` method or a
400
+ # re-verification session using `verify-device` method, they may
401
+ # subsequently request the OTP to be re-sent. This may be required if
402
+ # network related issues prevented the successful delivery of the OTP
403
+ # message to the user. Currently 'resend-otp' is limited to three calls per
404
+ # unique opt-in. The PIN expiration is not reset when this method is called.
405
+ # @param [ResendOtpRequest] body Optional parameter: TODO: type description
406
+ # here
407
+ # @return [ResendOtpResponse] Response from the API call.
408
+ def resend_otp(body: nil)
409
+ @api_call
410
+ .request(new_request_builder(HttpMethodEnum::POST,
411
+ '/optin/3.0/resend-otp',
412
+ Server::DEFAULT)
413
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
414
+ .xml_attributes(XmlAttributes.new
415
+ .value(body)
416
+ .root_element_name('resend-otp-request'))
417
+ .header_param(new_parameter('application/xml', key: 'accept'))
418
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
419
+ .response(new_response_handler
420
+ .deserializer(XmlUtilities.method(:deserialize_xml))
421
+ .deserialize_into(ResendOtpResponse)
422
+ .is_xml_response(true)
423
+ .xml_attribute(XmlAttributes.new
424
+ .root_element_name('resend-otp-response')))
425
+ .execute
426
+ end
427
+ end
428
+ end
@@ -0,0 +1,38 @@
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
+ # ForexController
8
+ class ForexController < BaseController
9
+ # **DISCLAIMER: This API or element is use-case specific and not needed for
10
+ # generic usage of our payment product. Please disregard unless otherwise
11
+ # directed to include in your integration.**
12
+ # The 'forex' request retrieves the latest foreign exchange rate for a given
13
+ # source and destination currency. Boku's foreign exchange rates are daily
14
+ # average mid-point rates and are updated every 24 hours.
15
+ # @param [ForexRequest] body Required parameter: TODO: type description
16
+ # here
17
+ # @return [ForexResponse] Response from the API call.
18
+ def forex(body)
19
+ @api_call
20
+ .request(new_request_builder(HttpMethodEnum::POST,
21
+ '/billing/3.0/forex',
22
+ Server::DEFAULT)
23
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
24
+ .xml_attributes(XmlAttributes.new
25
+ .value(body)
26
+ .root_element_name('forex-request'))
27
+ .header_param(new_parameter('application/xml', key: 'accept'))
28
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
29
+ .response(new_response_handler
30
+ .deserializer(XmlUtilities.method(:deserialize_xml))
31
+ .deserialize_into(ForexResponse)
32
+ .is_xml_response(true)
33
+ .xml_attribute(XmlAttributes.new
34
+ .root_element_name('forex-response')))
35
+ .execute
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,39 @@
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
+ # FundCheckController
8
+ class FundCheckController < BaseController
9
+ # **DISCLAIMER: This API or element is use-case specific and not needed for
10
+ # generic usage of our payment product. Please disregard unless otherwise
11
+ # directed to include in your integration.**
12
+ # The 'fund-check' request schedules a balance check for a given optin for
13
+ # the amount send in request. If there is not enough balance, sms is send
14
+ # for further user action to top-up balance. Sms will only be send once
15
+ # every seven days for any number of fund-check request.
16
+ # @param [FundCheckRequest] body Required parameter: TODO: type description
17
+ # here
18
+ # @return [FundCheckResponse] Response from the API call.
19
+ def schedule_fund_check(body)
20
+ @api_call
21
+ .request(new_request_builder(HttpMethodEnum::POST,
22
+ '/billing/3.0/fund-check',
23
+ Server::DEFAULT)
24
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
25
+ .xml_attributes(XmlAttributes.new
26
+ .value(body)
27
+ .root_element_name('fund-check-request'))
28
+ .header_param(new_parameter('application/xml', key: 'accept'))
29
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
30
+ .response(new_response_handler
31
+ .deserializer(XmlUtilities.method(:deserialize_xml))
32
+ .deserialize_into(FundCheckResponse)
33
+ .is_xml_response(true)
34
+ .xml_attribute(XmlAttributes.new
35
+ .root_element_name('fund-check-response')))
36
+ .execute
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,80 @@
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
+ # RefundController
8
+ class RefundController < BaseController
9
+ # Refunds a confirmed payment from the consumer. The refund request must
10
+ # include the ID of the original charge and a valid reason code that matches
11
+ # one of Boku’s supported [refund codes](page:refund-reason-codes). By
12
+ # default, the full amount of the referenced charge is refunded.
13
+ # If the issuer supports partial refunds, merchants can specify a refund
14
+ # amount less than the full charge. Partial refunds may be issued multiple
15
+ # times until the full amount of the original charge has been refunded.
16
+ # @param [RefundChargeRequest] body Required parameter: TODO: type
17
+ # description here
18
+ # @param [String] host Optional parameter: TODO: type description here
19
+ # @return [RefundChargeResponse] Response from the API call.
20
+ def refund_charge(body,
21
+ host: nil)
22
+ @api_call
23
+ .request(new_request_builder(HttpMethodEnum::POST,
24
+ '/billing/3.0/refund-charge',
25
+ Server::DEFAULT)
26
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
27
+ .xml_attributes(XmlAttributes.new
28
+ .value(body)
29
+ .root_element_name('refund-charge-request'))
30
+ .header_param(new_parameter(host, key: 'Host'))
31
+ .header_param(new_parameter('application/xml', key: 'accept'))
32
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
33
+ .response(new_response_handler
34
+ .deserializer(XmlUtilities.method(:deserialize_xml))
35
+ .deserialize_into(RefundChargeResponse)
36
+ .is_xml_response(true)
37
+ .xml_attribute(XmlAttributes.new
38
+ .root_element_name('refund-charge-response')))
39
+ .execute
40
+ end
41
+
42
+ # Retrieves the status and all details of prior refunds matching the given
43
+ # request criteria.
44
+ # Each returned refund element is similar to a refund-charge-response:
45
+ # although some elements are missing, all present elements have the same
46
+ # names, format, and meaning as those in the original
47
+ # refund-charge-response.
48
+ # The query-refund API call is guaranteed to return transactions up to 1
49
+ # year old. If the transaction was created before that period, this API may
50
+ # return no results.
51
+ # Criteria are evaluated in an AND fashion, i.e. if more than one field is
52
+ # supplied then all will be used to filter the returned refund elements. In
53
+ # normal usage, this is not relevant, since you would only supply one of the
54
+ # three fields by itself.
55
+ # The query-refund request one of the following values to be exclusively
56
+ # provided: refund-id or merchant-request-id.
57
+ # @param [QueryRefundRequest] body Required parameter: TODO: type
58
+ # description here
59
+ # @return [QueryRefundResponse] Response from the API call.
60
+ def query_refund(body)
61
+ @api_call
62
+ .request(new_request_builder(HttpMethodEnum::POST,
63
+ '/billing/3.0/query-refund',
64
+ Server::DEFAULT)
65
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
66
+ .xml_attributes(XmlAttributes.new
67
+ .value(body)
68
+ .root_element_name('query-refund-request'))
69
+ .header_param(new_parameter('application/xml', key: 'accept'))
70
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
71
+ .response(new_response_handler
72
+ .deserializer(XmlUtilities.method(:deserialize_xml))
73
+ .deserialize_into(QueryRefundResponse)
74
+ .is_xml_response(true)
75
+ .xml_attribute(XmlAttributes.new
76
+ .root_element_name('query-refund-response')))
77
+ .execute
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,69 @@
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
+ # SellerOfRecordController
8
+ class SellerOfRecordController < BaseController
9
+ # **DISCLAIMER: This API or element is use-case specific and not needed for
10
+ # generic usage of our payment product. Please disregard unless otherwise
11
+ # directed to include in your integration.**
12
+ # The register-payment-method call notifies Boku to initiate the onboarding
13
+ # of a payment method. Once the payment method is "approved", the seller of
14
+ # record can accept payments using the requested payment method.
15
+ # @param [RegisterPaymentMethodRequest] body Required parameter: TODO: type
16
+ # description here
17
+ # @return [RegisterPaymentMethodResponse] Response from the API call.
18
+ def register_payment_method(body)
19
+ @api_call
20
+ .request(new_request_builder(HttpMethodEnum::POST,
21
+ '/seller-of-record/1.0/register-payment-method',
22
+ Server::DEFAULT)
23
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
24
+ .xml_attributes(XmlAttributes.new
25
+ .value(body)
26
+ .root_element_name('register-payment-method-request'))
27
+ .header_param(new_parameter('application/xml', key: 'accept'))
28
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
29
+ .response(new_response_handler
30
+ .deserializer(XmlUtilities.method(:deserialize_xml))
31
+ .deserialize_into(RegisterPaymentMethodResponse)
32
+ .is_xml_response(true)
33
+ .xml_attribute(XmlAttributes.new
34
+ .root_element_name('register-payment-method-response')))
35
+ .execute
36
+ end
37
+
38
+ # **DISCLAIMER: This API or element is use-case specific and not needed for
39
+ # generic usage of our payment product. Please disregard unless otherwise
40
+ # directed to include in your integration.**
41
+ # The 'register-seller-of-record' API collects required information for the
42
+ # seller of record to be onboarded on the Boku platform. Information
43
+ # provided here may be used to enable the seller of record with various
44
+ # payment methods. This API call returns a response with a
45
+ # seller-of-record-id, which will be used in subsequent API calls.
46
+ # @param [RegisterSellerOfRecordRequest] body Required parameter: TODO: type
47
+ # description here
48
+ # @return [RegisterSellerOfRecordResponse] Response from the API call.
49
+ def register_seller_of_record(body)
50
+ @api_call
51
+ .request(new_request_builder(HttpMethodEnum::POST,
52
+ '/seller-of-record/1.0/register-seller-of-record',
53
+ Server::DEFAULT)
54
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
55
+ .xml_attributes(XmlAttributes.new
56
+ .value(body)
57
+ .root_element_name('register-seller-of-record-request'))
58
+ .header_param(new_parameter('application/xml', key: 'accept'))
59
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
60
+ .response(new_response_handler
61
+ .deserializer(XmlUtilities.method(:deserialize_xml))
62
+ .deserialize_into(RegisterSellerOfRecordResponse)
63
+ .is_xml_response(true)
64
+ .xml_attribute(XmlAttributes.new
65
+ .root_element_name('register-seller-of-record-response')))
66
+ .execute
67
+ end
68
+ end
69
+ end