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,247 @@
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
+ # ChargeController
8
+ class ChargeController < BaseController
9
+ # The 'charge' request processes a payment against a previously authorized
10
+ # opt-in. The 'optin-id' received in the 'optin'/'confirm-optin' response
11
+ # must be supplied in order to validate the consumer payment method.
12
+ # If the 'optin-id' and the other parameters of the request are valid, the
13
+ # charge is submitted to the issuer for processing. A 'charge-id' is
14
+ # returned in the API response.
15
+ # 'Charge' may operate as a synchronous request, fully asynchronous, or
16
+ # synchronous with fallback to asynchronous after a timeout. The timeout is
17
+ # supplied with the request, or can default to a value configurable for the
18
+ # merchant. The 'charge' method returns a unique 'charge-id' in all cases
19
+ # where the request has been accepted for processing, including success,
20
+ # failure, and pending cases.
21
+ # The 'charge' method is idempotent. If the same request is sent again (with
22
+ # the same 'merchant-request-id'), Boku will return the current status of
23
+ # the transaction. For example:
24
+ # * If the transaction has completed successfully, a response code of "0"
25
+ # will be returned.
26
+ # * If the transaction has completed with a billing error, a response code
27
+ # of "107" will be returned
28
+ # * If the charge request has been accepted and is being processed, a
29
+ # response code of "139" will be returned. Final confirmation may take
30
+ # several days, depending on the payment method (e.g., direct debit).
31
+ # @param [ChargeRequest] body Required parameter: TODO: type description
32
+ # here
33
+ # @return [ChargeResponse] Response from the API call.
34
+ def charge(body)
35
+ @api_call
36
+ .request(new_request_builder(HttpMethodEnum::POST,
37
+ '/billing/3.0/charge',
38
+ Server::DEFAULT)
39
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
40
+ .xml_attributes(XmlAttributes.new
41
+ .value(body)
42
+ .root_element_name('charge-request'))
43
+ .header_param(new_parameter('application/xml', key: 'accept'))
44
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
45
+ .response(new_response_handler
46
+ .deserializer(XmlUtilities.method(:deserialize_xml))
47
+ .deserialize_into(ChargeResponse)
48
+ .is_xml_response(true)
49
+ .xml_attribute(XmlAttributes.new
50
+ .root_element_name('charge-response')))
51
+ .execute
52
+ end
53
+
54
+ # Retrieves the status and all details of prior charges matching the given
55
+ # request criteria.
56
+ # Each returned charge element is similar to a charge-response: although
57
+ # some elements are missing, all present elements have the same names,
58
+ # format and meaning as those in the original charge-response.
59
+ # The query-charge API call is guaranteed to return transactions up to 1
60
+ # year old. If the transaction was created before that period, this API may
61
+ # return no results.
62
+ # Criteria are evaluated in an AND fashion, i.e. if more than one field is
63
+ # supplied then all will be used to filter the returned charge elements. In
64
+ # normal usage this is not relevant, since you would only supply one of the
65
+ # three fields by itself.
66
+ # The query-charge request one of the following values to be exclusively
67
+ # provided: charge-id, merchant-request-id, or merchant-transaction-id.
68
+ # @param [QueryChargeRequest] body Required parameter: TODO: type
69
+ # description here
70
+ # @return [QueryChargeResponse] Response from the API call.
71
+ def query_charge(body)
72
+ @api_call
73
+ .request(new_request_builder(HttpMethodEnum::POST,
74
+ '/billing/3.0/query-charge',
75
+ Server::DEFAULT)
76
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
77
+ .xml_attributes(XmlAttributes.new
78
+ .value(body)
79
+ .root_element_name('query-charge-request'))
80
+ .header_param(new_parameter('application/xml', key: 'accept'))
81
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
82
+ .response(new_response_handler
83
+ .deserializer(XmlUtilities.method(:deserialize_xml))
84
+ .deserialize_into(QueryChargeResponse)
85
+ .is_xml_response(true)
86
+ .xml_attribute(XmlAttributes.new
87
+ .root_element_name('query-charge-response')))
88
+ .execute
89
+ end
90
+
91
+ # **DISCLAIMER: This API is use-case specific and not required for standard
92
+ # payment product integrations. Please disregard unless otherwise directed
93
+ # to include in your integration.**
94
+ # The Reverse Charge API reverses a charge request. This method is
95
+ # typically used when the result of a prior charge is unknown, and the
96
+ # charge was made within the last hour.
97
+ # An unknown result can occur for several reasons:
98
+ # * Network issue
99
+ # * Request timed out by merchant
100
+ # * Response received but could not be recorded
101
+ # Reverse charge requests should be submitted within one hour of the
102
+ # original charge. Requests submitted after one hour will be rejected. In
103
+ # those cases, use the Refund Charge API instead.
104
+ # _**NOTE:** The Reverse Charge API is not applicable for direct debit
105
+ # charge requests. This is because direct debit transactions (e.g., BACS)
106
+ # are processed asynchronously through banking networks and cannot be
107
+ # programmatically reversed once submitted. Use the Refund Charge API to
108
+ # reverse a direct debit charge._
109
+ # Due to the 24-hour idempotency window on charge requests, a reverse
110
+ # charge made more than 24 hours after the original request could still
111
+ # succeed and impact settlement reports. Boku strongly recommends using the
112
+ # Refund Charge API for any charge ID older than 24 hours.
113
+ # In most cases, a reversal request will return a status of "OK" even if
114
+ # Boku never received the original charge.
115
+ # @param [ReverseChargeRequest] body Required parameter: TODO: type
116
+ # description here
117
+ # @return [ReverseChargeResponse] Response from the API call.
118
+ def reverse_charge(body)
119
+ @api_call
120
+ .request(new_request_builder(HttpMethodEnum::POST,
121
+ '/billing/3.0/reverse-charge',
122
+ Server::DEFAULT)
123
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
124
+ .xml_attributes(XmlAttributes.new
125
+ .value(body)
126
+ .root_element_name('reverse-charge-request'))
127
+ .header_param(new_parameter('application/xml', key: 'accept'))
128
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
129
+ .response(new_response_handler
130
+ .deserializer(XmlUtilities.method(:deserialize_xml))
131
+ .deserialize_into(ReverseChargeResponse)
132
+ .is_xml_response(true)
133
+ .xml_attribute(XmlAttributes.new
134
+ .root_element_name('reverse-charge-response')))
135
+ .execute
136
+ end
137
+
138
+ # The purpose of the 'begin-single-charge' API call is to initiate a one
139
+ # time charge. Currently, this feature is limited to eWallet payment methods
140
+ # only. The 'begin-single-charge' call initiates a process in which a
141
+ # consumer is required to authenticate themselves each time a purchase is
142
+ # requested. This API provides a payment option for consumers who choose not
143
+ # to save a payment method with the merchant.
144
+ # The Merchant can obtain information on the status of the charge made
145
+ # through the 'begin-single-charge' API in the following ways
146
+ # * 'query-charge' API
147
+ # * notification to a Merchant's notification URL specified in the
148
+ # 'begin-single-charge' request
149
+ # @param [BeginSingleChargeRequest] body Required parameter: TODO: type
150
+ # description here
151
+ # @return [BeginSingleChargeResponse] Response from the API call.
152
+ def begin_single_charge(body)
153
+ @api_call
154
+ .request(new_request_builder(HttpMethodEnum::POST,
155
+ '/billing/3.0/begin-single-charge',
156
+ Server::DEFAULT)
157
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
158
+ .xml_attributes(XmlAttributes.new
159
+ .value(body)
160
+ .root_element_name('begin-single-charge-request'))
161
+ .header_param(new_parameter('application/xml', key: 'accept'))
162
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
163
+ .response(new_response_handler
164
+ .deserializer(XmlUtilities.method(:deserialize_xml))
165
+ .deserialize_into(BeginSingleChargeResponse)
166
+ .is_xml_response(true)
167
+ .xml_attribute(XmlAttributes.new
168
+ .root_element_name('begin-single-charge-response')))
169
+ .execute
170
+ end
171
+
172
+ # **DISCLAIMER: This API or element is use-case specific and not needed for
173
+ # generic usage of our payment product. Please disregard unless otherwise
174
+ # directed to include in your integration.**
175
+ # The 'charge-msisdn' request processes a payment against previously
176
+ # obtained consumer consent for charging.
177
+ # If the 'network', 'msisdn' and 'country' and the other parameters of the
178
+ # request are valid, the charge is submitted to the operator for processing.
179
+ # A 'charge-id' is returned in the API response.
180
+ # 'Charge-msisdn' will operate as a synchronous request. The timeout is
181
+ # supplied with the request, or can default to a value configurable per
182
+ # merchant. The 'charge-msisdn' method returns a unique 'charge-id' in all
183
+ # cases where the request has been accepted for processing, including
184
+ # success, failure, and pending cases.
185
+ # The 'charge-msisdn' method is idempotent. If the same request is sent
186
+ # again (with the same 'merchant-request-id'), Boku will return the current
187
+ # status of the transaction. For example:
188
+ # If the transaction has completed successfully, a response code of "0" will
189
+ # be returned.
190
+ # If the transaction has completed with a billing error, a response code of
191
+ # "107" will be returned
192
+ # @param [ChargeMsisdnRequest] body Required parameter: TODO: type
193
+ # description here
194
+ # @return [ChargeResponse] Response from the API call.
195
+ def charge_msisdn(body)
196
+ @api_call
197
+ .request(new_request_builder(HttpMethodEnum::POST,
198
+ '/billing/3.0/charge-msisdn',
199
+ Server::DEFAULT)
200
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
201
+ .xml_attributes(XmlAttributes.new
202
+ .value(body)
203
+ .root_element_name('charge-msisdn-request'))
204
+ .header_param(new_parameter('application/xml', key: 'accept'))
205
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
206
+ .response(new_response_handler
207
+ .deserializer(XmlUtilities.method(:deserialize_xml))
208
+ .deserialize_into(ChargeResponse)
209
+ .is_xml_response(true)
210
+ .xml_attribute(XmlAttributes.new
211
+ .root_element_name('charge-response')))
212
+ .execute
213
+ end
214
+
215
+ # The purpose of the 'charge-plus-optin' API call is to initiate a one time
216
+ # charge and create an optin that becomes valid once the charge is complete.
217
+ # Currently, this feature is limited to certain eWallet payment methods
218
+ # only.
219
+ # After a `charge-plus-optin` call, an opt-in is usually in status
220
+ # `pending-validate`.
221
+ # The Merchant can obtain information on the status of the charge made
222
+ # through the 'charge-plus-optin' API in from the notification to the
223
+ # notification URL specified in the 'charge-plus-optin' request
224
+ # @param [ChargePlusOptinRequest] body Required parameter: TODO: type
225
+ # description here
226
+ # @return [ChargePlusOptinResponse] Response from the API call.
227
+ def charge_plus_optin(body)
228
+ @api_call
229
+ .request(new_request_builder(HttpMethodEnum::POST,
230
+ '/billing/3.0/charge-plus-optin',
231
+ Server::DEFAULT)
232
+ .header_param(new_parameter('application/xml', key: 'Content-Type'))
233
+ .xml_attributes(XmlAttributes.new
234
+ .value(body)
235
+ .root_element_name('charge-plus-optin-request'))
236
+ .header_param(new_parameter('application/xml', key: 'accept'))
237
+ .body_serializer(XmlUtilities.method(:serialize_to_xml)))
238
+ .response(new_response_handler
239
+ .deserializer(XmlUtilities.method(:deserialize_xml))
240
+ .deserialize_into(ChargePlusOptinResponse)
241
+ .is_xml_response(true)
242
+ .xml_attribute(XmlAttributes.new
243
+ .root_element_name('charge-plus-optin-response')))
244
+ .execute
245
+ end
246
+ end
247
+ end
@@ -0,0 +1,50 @@
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
+ # ConfigResourcesController
8
+ class ConfigResourcesController < 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 network-info call allows retrieval of relatively static data about the
13
+ # identity and properties of all mobile networks (carriers) available on the
14
+ # system.
15
+ # There are two main purposes for this information:
16
+ # * Some operations require knowledge of the particular mobile network the
17
+ # user's handset resides on. If using a mobile device, this may be derivable
18
+ # using the network-info in conjunction with the device MCC and MNC.
19
+ # * Some of the below API calls return the network upon which a particular
20
+ # transaction occurred by referring to the ID, so this API may provide
21
+ # information about what that ID means.
22
+ # The canonical network ID in this API uses an internal proprietary scheme,
23
+ # rather than a public standard identifier. Unfortunately there is no good
24
+ # international standard for representing networks at the granularity that
25
+ # makes sense for a high-level billing service - ITU E.212 specifies MCC and
26
+ # MNC codes, but most logical networks are represented by many different
27
+ # codes due to historical merging of smaller networks or simply different
28
+ # physical networks for regions within the same country. The MCC/MNC list
29
+ # also changes on a not infrequent basis, which E.212 is not always
30
+ # up-to-date with.
31
+ # Any network ID returned by the payment gateway or batch files is always
32
+ # guaranteed to be found in the 'network-info' response and associated with
33
+ # a human readable name.
34
+ # @return [NetworkInfo] Response from the API call.
35
+ def get_network_info
36
+ @api_call
37
+ .request(new_request_builder(HttpMethodEnum::GET,
38
+ '/config/3.0/network-info',
39
+ Server::DEFAULT)
40
+ .header_param(new_parameter('application/xml', key: 'accept')))
41
+ .response(new_response_handler
42
+ .deserializer(XmlUtilities.method(:deserialize_xml))
43
+ .deserialize_into(NetworkInfo)
44
+ .is_xml_response(true)
45
+ .xml_attribute(XmlAttributes.new
46
+ .root_element_name('network-info')))
47
+ .execute
48
+ end
49
+ end
50
+ end