apimatic-cp-sdk 0.0.1

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 (271) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +178 -0
  4. data/bin/console +15 -0
  5. data/lib/cell_point_api/api_helper.rb +10 -0
  6. data/lib/cell_point_api/apis/apple_pay_api.rb +51 -0
  7. data/lib/cell_point_api/apis/authentication_api.rb +81 -0
  8. data/lib/cell_point_api/apis/base_api.rb +67 -0
  9. data/lib/cell_point_api/apis/bulk_api.rb +93 -0
  10. data/lib/cell_point_api/apis/cards_api.rb +104 -0
  11. data/lib/cell_point_api/apis/notes_api.rb +66 -0
  12. data/lib/cell_point_api/apis/oauth_authorization_api.rb +44 -0
  13. data/lib/cell_point_api/apis/orders_api.rb +483 -0
  14. data/lib/cell_point_api/apis/payment_methods_api.rb +57 -0
  15. data/lib/cell_point_api/apis/proxy_api.rb +91 -0
  16. data/lib/cell_point_api/apis/transactions_api.rb +546 -0
  17. data/lib/cell_point_api/apis/wallet_api.rb +39 -0
  18. data/lib/cell_point_api/client.rb +145 -0
  19. data/lib/cell_point_api/configuration.rb +180 -0
  20. data/lib/cell_point_api/events/callbacks/callbacks_handler.rb +37 -0
  21. data/lib/cell_point_api/events/unknown_event.rb +32 -0
  22. data/lib/cell_point_api/exceptions/api_exception.rb +21 -0
  23. data/lib/cell_point_api/exceptions/oauth_provider_exception.rb +64 -0
  24. data/lib/cell_point_api/exceptions/problem_exception.rb +75 -0
  25. data/lib/cell_point_api/http/api_response.rb +19 -0
  26. data/lib/cell_point_api/http/auth/cpd_issued_jwt.rb +156 -0
  27. data/lib/cell_point_api/http/auth/merchant_issued_jwt.rb +53 -0
  28. data/lib/cell_point_api/http/http_call_back.rb +10 -0
  29. data/lib/cell_point_api/http/http_method_enum.rb +10 -0
  30. data/lib/cell_point_api/http/http_request.rb +10 -0
  31. data/lib/cell_point_api/http/http_response.rb +10 -0
  32. data/lib/cell_point_api/http/proxy_settings.rb +22 -0
  33. data/lib/cell_point_api/logging/configuration/api_logging_configuration.rb +186 -0
  34. data/lib/cell_point_api/logging/sdk_logger.rb +17 -0
  35. data/lib/cell_point_api/models/account.rb +168 -0
  36. data/lib/cell_point_api/models/account_status.rb +52 -0
  37. data/lib/cell_point_api/models/account_type.rb +44 -0
  38. data/lib/cell_point_api/models/action_base.rb +74 -0
  39. data/lib/cell_point_api/models/action_completion_response.rb +77 -0
  40. data/lib/cell_point_api/models/action_result_status.rb +40 -0
  41. data/lib/cell_point_api/models/action_type.rb +36 -0
  42. data/lib/cell_point_api/models/activity.rb +244 -0
  43. data/lib/cell_point_api/models/activity_data.rb +127 -0
  44. data/lib/cell_point_api/models/address_verification_status.rb +56 -0
  45. data/lib/cell_point_api/models/airline_ancillary.rb +244 -0
  46. data/lib/cell_point_api/models/airline_ancillary_data.rb +120 -0
  47. data/lib/cell_point_api/models/airline_fare.rb +348 -0
  48. data/lib/cell_point_api/models/airline_fare_data.rb +217 -0
  49. data/lib/cell_point_api/models/airline_industry_data.rb +152 -0
  50. data/lib/cell_point_api/models/airport.rb +144 -0
  51. data/lib/cell_point_api/models/amount.rb +105 -0
  52. data/lib/cell_point_api/models/ancillary_details.rb +366 -0
  53. data/lib/cell_point_api/models/apple_pay_config.rb +83 -0
  54. data/lib/cell_point_api/models/apple_pay_instrument_apple_pay_node.rb +119 -0
  55. data/lib/cell_point_api/models/apple_pay_payment_instrument.rb +123 -0
  56. data/lib/cell_point_api/models/apple_tokenized_token.rb +143 -0
  57. data/lib/cell_point_api/models/audience.rb +36 -0
  58. data/lib/cell_point_api/models/authorization.rb +145 -0
  59. data/lib/cell_point_api/models/authorization_group.rb +99 -0
  60. data/lib/cell_point_api/models/authorization_group1.rb +216 -0
  61. data/lib/cell_point_api/models/authorization_group_full.rb +193 -0
  62. data/lib/cell_point_api/models/authorize_order_by_id_post201_response.rb +128 -0
  63. data/lib/cell_point_api/models/auto_rental.rb +195 -0
  64. data/lib/cell_point_api/models/auto_rental_data.rb +76 -0
  65. data/lib/cell_point_api/models/auto_rental_industry_data.rb +182 -0
  66. data/lib/cell_point_api/models/base_model.rb +110 -0
  67. data/lib/cell_point_api/models/bin.rb +73 -0
  68. data/lib/cell_point_api/models/breadcrumb.rb +86 -0
  69. data/lib/cell_point_api/models/browser_info.rb +114 -0
  70. data/lib/cell_point_api/models/bundle.rb +195 -0
  71. data/lib/cell_point_api/models/bundled_activity.rb +229 -0
  72. data/lib/cell_point_api/models/bundled_airline_ancillary.rb +226 -0
  73. data/lib/cell_point_api/models/bundled_airline_fare.rb +330 -0
  74. data/lib/cell_point_api/models/bundled_auto_rental.rb +176 -0
  75. data/lib/cell_point_api/models/bundled_discount.rb +132 -0
  76. data/lib/cell_point_api/models/bundled_item_base.rb +123 -0
  77. data/lib/cell_point_api/models/bundled_lodging_reservation.rb +176 -0
  78. data/lib/cell_point_api/models/bundled_product.rb +161 -0
  79. data/lib/cell_point_api/models/buyer.rb +129 -0
  80. data/lib/cell_point_api/models/buyer_fingerprint.rb +125 -0
  81. data/lib/cell_point_api/models/buyer_history.rb +199 -0
  82. data/lib/cell_point_api/models/cancel.rb +109 -0
  83. data/lib/cell_point_api/models/cancelled_payment_transactions.rb +84 -0
  84. data/lib/cell_point_api/models/capabilities.rb +77 -0
  85. data/lib/cell_point_api/models/capture.rb +84 -0
  86. data/lib/cell_point_api/models/capture_payment_response.rb +159 -0
  87. data/lib/cell_point_api/models/card.rb +131 -0
  88. data/lib/cell_point_api/models/card_config.rb +105 -0
  89. data/lib/cell_point_api/models/card_identification.rb +126 -0
  90. data/lib/cell_point_api/models/card_instrument_card_node.rb +232 -0
  91. data/lib/cell_point_api/models/card_number.rb +122 -0
  92. data/lib/cell_point_api/models/card_payment_instrument.rb +136 -0
  93. data/lib/cell_point_api/models/card_scheme.rb +63 -0
  94. data/lib/cell_point_api/models/card_scheme_configuration.rb +87 -0
  95. data/lib/cell_point_api/models/carrier.rb +82 -0
  96. data/lib/cell_point_api/models/category.rb +36 -0
  97. data/lib/cell_point_api/models/client_assertion.rb +135 -0
  98. data/lib/cell_point_api/models/close.rb +89 -0
  99. data/lib/cell_point_api/models/close_refund_response.rb +73 -0
  100. data/lib/cell_point_api/models/closed_payment_transactions.rb +83 -0
  101. data/lib/cell_point_api/models/codeshare.rb +87 -0
  102. data/lib/cell_point_api/models/complete_person_name.rb +120 -0
  103. data/lib/cell_point_api/models/completion_redirect.rb +93 -0
  104. data/lib/cell_point_api/models/configuration.rb +86 -0
  105. data/lib/cell_point_api/models/contact_data.rb +82 -0
  106. data/lib/cell_point_api/models/cpu.rb +74 -0
  107. data/lib/cell_point_api/models/device_os.rb +60 -0
  108. data/lib/cell_point_api/models/discount.rb +150 -0
  109. data/lib/cell_point_api/models/discount_data.rb +83 -0
  110. data/lib/cell_point_api/models/driver.rb +86 -0
  111. data/lib/cell_point_api/models/external_transaction.rb +227 -0
  112. data/lib/cell_point_api/models/externally_tokenized_card.rb +81 -0
  113. data/lib/cell_point_api/models/failover.rb +105 -0
  114. data/lib/cell_point_api/models/failure_category.rb +62 -0
  115. data/lib/cell_point_api/models/failure_module.rb +58 -0
  116. data/lib/cell_point_api/models/fingerprint.rb +82 -0
  117. data/lib/cell_point_api/models/fraud_assessment.rb +163 -0
  118. data/lib/cell_point_api/models/fulfilled_activity.rb +207 -0
  119. data/lib/cell_point_api/models/fulfilled_airline_ancillary.rb +207 -0
  120. data/lib/cell_point_api/models/fulfilled_airline_fare.rb +207 -0
  121. data/lib/cell_point_api/models/fulfilled_auto_rental.rb +207 -0
  122. data/lib/cell_point_api/models/fulfilled_bundle.rb +207 -0
  123. data/lib/cell_point_api/models/fulfilled_discount.rb +178 -0
  124. data/lib/cell_point_api/models/fulfilled_line_item_base.rb +177 -0
  125. data/lib/cell_point_api/models/fulfilled_lodging_reservation.rb +207 -0
  126. data/lib/cell_point_api/models/fulfilled_order.rb +148 -0
  127. data/lib/cell_point_api/models/fulfilled_product.rb +207 -0
  128. data/lib/cell_point_api/models/fulfilled_tax_line.rb +162 -0
  129. data/lib/cell_point_api/models/fulfillment_data.rb +90 -0
  130. data/lib/cell_point_api/models/fulfillment_status.rb +41 -0
  131. data/lib/cell_point_api/models/funding_type.rb +40 -0
  132. data/lib/cell_point_api/models/gender.rb +40 -0
  133. data/lib/cell_point_api/models/hpp_data.rb +155 -0
  134. data/lib/cell_point_api/models/identifying_document.rb +159 -0
  135. data/lib/cell_point_api/models/identifying_document_type.rb +60 -0
  136. data/lib/cell_point_api/models/industry_data.rb +124 -0
  137. data/lib/cell_point_api/models/informational_price_row.rb +97 -0
  138. data/lib/cell_point_api/models/informational_price_section.rb +104 -0
  139. data/lib/cell_point_api/models/itinerary_type.rb +47 -0
  140. data/lib/cell_point_api/models/journey_segment.rb +83 -0
  141. data/lib/cell_point_api/models/line_item_base.rb +101 -0
  142. data/lib/cell_point_api/models/line_item_type.rb +60 -0
  143. data/lib/cell_point_api/models/links.rb +86 -0
  144. data/lib/cell_point_api/models/location.rb +153 -0
  145. data/lib/cell_point_api/models/lodging_industry_data.rb +216 -0
  146. data/lib/cell_point_api/models/lodging_reservation.rb +195 -0
  147. data/lib/cell_point_api/models/lodging_reservation_data.rb +76 -0
  148. data/lib/cell_point_api/models/loyalty_account.rb +103 -0
  149. data/lib/cell_point_api/models/network_info.rb +76 -0
  150. data/lib/cell_point_api/models/non_negative_amount.rb +105 -0
  151. data/lib/cell_point_api/models/non_positive_amount.rb +105 -0
  152. data/lib/cell_point_api/models/note.rb +139 -0
  153. data/lib/cell_point_api/models/note_request.rb +90 -0
  154. data/lib/cell_point_api/models/oauth_provider_error.rb +62 -0
  155. data/lib/cell_point_api/models/oauth_scope_cpd_issued_jwt.rb +158 -0
  156. data/lib/cell_point_api/models/oauth_token.rb +96 -0
  157. data/lib/cell_point_api/models/order.rb +414 -0
  158. data/lib/cell_point_api/models/order_canceled_reason.rb +56 -0
  159. data/lib/cell_point_api/models/order_core.rb +343 -0
  160. data/lib/cell_point_api/models/order_extended.rb +150 -0
  161. data/lib/cell_point_api/models/order_payment_summary.rb +117 -0
  162. data/lib/cell_point_api/models/order_status.rb +161 -0
  163. data/lib/cell_point_api/models/order_status_type.rb +58 -0
  164. data/lib/cell_point_api/models/order_transactions.rb +88 -0
  165. data/lib/cell_point_api/models/owner.rb +131 -0
  166. data/lib/cell_point_api/models/page_type.rb +26 -0
  167. data/lib/cell_point_api/models/passenger.rb +229 -0
  168. data/lib/cell_point_api/models/password_change_type.rb +41 -0
  169. data/lib/cell_point_api/models/pay_pal_action.rb +129 -0
  170. data/lib/cell_point_api/models/pay_pal_payment_instrument.rb +88 -0
  171. data/lib/cell_point_api/models/payment_data.rb +102 -0
  172. data/lib/cell_point_api/models/payment_data_header.rb +94 -0
  173. data/lib/cell_point_api/models/payment_data_version.rb +26 -0
  174. data/lib/cell_point_api/models/payment_field.rb +68 -0
  175. data/lib/cell_point_api/models/payment_instrument_base.rb +87 -0
  176. data/lib/cell_point_api/models/payment_method.rb +52 -0
  177. data/lib/cell_point_api/models/payment_methods_for_order_get200_response.rb +157 -0
  178. data/lib/cell_point_api/models/payment_methods_search_vouchers_post200_response.rb +82 -0
  179. data/lib/cell_point_api/models/payment_processor.rb +121 -0
  180. data/lib/cell_point_api/models/payment_status.rb +122 -0
  181. data/lib/cell_point_api/models/payment_transaction.rb +605 -0
  182. data/lib/cell_point_api/models/payment_transaction_authorized_amount.rb +105 -0
  183. data/lib/cell_point_api/models/payment_transaction_canceled_amount.rb +105 -0
  184. data/lib/cell_point_api/models/payment_transaction_captured_amount.rb +105 -0
  185. data/lib/cell_point_api/models/payment_transaction_pending_authorize_amount.rb +106 -0
  186. data/lib/cell_point_api/models/payment_transaction_pending_cancel_amount.rb +106 -0
  187. data/lib/cell_point_api/models/payment_transaction_pending_capture_amount.rb +106 -0
  188. data/lib/cell_point_api/models/payment_transaction_processing_fee.rb +106 -0
  189. data/lib/cell_point_api/models/payment_transaction_refunded_amount.rb +105 -0
  190. data/lib/cell_point_api/models/payments_v1_bulks_response.rb +74 -0
  191. data/lib/cell_point_api/models/payments_v1_orders_payments_retry_failed_refunds_request.rb +74 -0
  192. data/lib/cell_point_api/models/payments_v1_refunds_closures_request.rb +74 -0
  193. data/lib/cell_point_api/models/payments_v1_refunds_retry_failed_refunds_request.rb +74 -0
  194. data/lib/cell_point_api/models/payments_v1_schemes_response.rb +76 -0
  195. data/lib/cell_point_api/models/paypal_config.rb +94 -0
  196. data/lib/cell_point_api/models/person.rb +161 -0
  197. data/lib/cell_point_api/models/person_name.rb +89 -0
  198. data/lib/cell_point_api/models/phone.rb +132 -0
  199. data/lib/cell_point_api/models/pk_payment_method.rb +111 -0
  200. data/lib/cell_point_api/models/pk_payment_token.rb +94 -0
  201. data/lib/cell_point_api/models/postal_address.rb +217 -0
  202. data/lib/cell_point_api/models/price_summary.rb +191 -0
  203. data/lib/cell_point_api/models/product.rb +179 -0
  204. data/lib/cell_point_api/models/product_data.rb +104 -0
  205. data/lib/cell_point_api/models/property.rb +110 -0
  206. data/lib/cell_point_api/models/provider.rb +129 -0
  207. data/lib/cell_point_api/models/psp.rb +26 -0
  208. data/lib/cell_point_api/models/redirect_action.rb +116 -0
  209. data/lib/cell_point_api/models/refund_item.rb +310 -0
  210. data/lib/cell_point_api/models/refund_method.rb +36 -0
  211. data/lib/cell_point_api/models/refund_order_group_post201_response.rb +91 -0
  212. data/lib/cell_point_api/models/refund_reason.rb +104 -0
  213. data/lib/cell_point_api/models/refund_request.rb +161 -0
  214. data/lib/cell_point_api/models/refund_status.rb +44 -0
  215. data/lib/cell_point_api/models/refund_transaction.rb +311 -0
  216. data/lib/cell_point_api/models/refund_transaction_amount.rb +105 -0
  217. data/lib/cell_point_api/models/refund_type.rb +38 -0
  218. data/lib/cell_point_api/models/related_payment.rb +106 -0
  219. data/lib/cell_point_api/models/related_refund.rb +106 -0
  220. data/lib/cell_point_api/models/rental_location.rb +226 -0
  221. data/lib/cell_point_api/models/retry_refund_response.rb +73 -0
  222. data/lib/cell_point_api/models/reward.rb +101 -0
  223. data/lib/cell_point_api/models/room.rb +100 -0
  224. data/lib/cell_point_api/models/sales_channel.rb +36 -0
  225. data/lib/cell_point_api/models/save_pk_payment_token_request.rb +83 -0
  226. data/lib/cell_point_api/models/save_wallet_payment_token_request.rb +83 -0
  227. data/lib/cell_point_api/models/screen.rb +97 -0
  228. data/lib/cell_point_api/models/search_vouchers_request.rb +119 -0
  229. data/lib/cell_point_api/models/security_code.rb +83 -0
  230. data/lib/cell_point_api/models/security_code_match_status.rb +50 -0
  231. data/lib/cell_point_api/models/status.rb +43 -0
  232. data/lib/cell_point_api/models/status1.rb +52 -0
  233. data/lib/cell_point_api/models/summary.rb +82 -0
  234. data/lib/cell_point_api/models/tax.rb +134 -0
  235. data/lib/cell_point_api/models/taxes_and_fees_breakdown_page.rb +82 -0
  236. data/lib/cell_point_api/models/token_post200_response.rb +96 -0
  237. data/lib/cell_point_api/models/tokenized_card.rb +229 -0
  238. data/lib/cell_point_api/models/tokenized_card_with_contact_data.rb +247 -0
  239. data/lib/cell_point_api/models/tokenized_data.rb +169 -0
  240. data/lib/cell_point_api/models/total_row.rb +83 -0
  241. data/lib/cell_point_api/models/transaction_action.rb +108 -0
  242. data/lib/cell_point_api/models/transaction_action_result.rb +94 -0
  243. data/lib/cell_point_api/models/transaction_base.rb +132 -0
  244. data/lib/cell_point_api/models/transaction_failure.rb +222 -0
  245. data/lib/cell_point_api/models/travel_journey.rb +139 -0
  246. data/lib/cell_point_api/models/travel_leg.rb +194 -0
  247. data/lib/cell_point_api/models/trigger_bulk_request.rb +83 -0
  248. data/lib/cell_point_api/models/type.rb +67 -0
  249. data/lib/cell_point_api/models/type1.rb +47 -0
  250. data/lib/cell_point_api/models/type2.rb +40 -0
  251. data/lib/cell_point_api/models/type3.rb +41 -0
  252. data/lib/cell_point_api/models/type4.rb +56 -0
  253. data/lib/cell_point_api/models/type5.rb +78 -0
  254. data/lib/cell_point_api/models/uplift_config.rb +73 -0
  255. data/lib/cell_point_api/models/uplift_payment_instrument.rb +102 -0
  256. data/lib/cell_point_api/models/vehicle.rb +139 -0
  257. data/lib/cell_point_api/models/voucher_config.rb +92 -0
  258. data/lib/cell_point_api/models/voucher_issuer.rb +26 -0
  259. data/lib/cell_point_api/models/voucher_payment_instrument.rb +233 -0
  260. data/lib/cell_point_api/models/voucher_payment_instrument_node.rb +198 -0
  261. data/lib/cell_point_api/models/voucher_type.rb +36 -0
  262. data/lib/cell_point_api/models/wallet_instrument_wallet_node.rb +136 -0
  263. data/lib/cell_point_api/models/wallet_payment_instrument.rb +123 -0
  264. data/lib/cell_point_api/models/wallet_tokenized_token.rb +148 -0
  265. data/lib/cell_point_api/models/wallet_tokenized_token_identification.rb +75 -0
  266. data/lib/cell_point_api/models/wallet_type.rb +36 -0
  267. data/lib/cell_point_api/utilities/date_time_helper.rb +11 -0
  268. data/lib/cell_point_api/utilities/file_wrapper.rb +28 -0
  269. data/lib/cell_point_api/utilities/union_type_lookup.rb +260 -0
  270. data/lib/cell_point_api.rb +301 -0
  271. metadata +354 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 167bee40294a08e1b16d78e5f7ad38beacf1caac8a95e59ebfb20ee7565a67a4
4
+ data.tar.gz: 7b9586af540a9a7ef14ec73e391b853f828801a087c7339b95b71ded605d4566
5
+ SHA512:
6
+ metadata.gz: b3095dec4714f6fd8b940b270749e45b1399c94594f60b809f9559ad8a8e83f48dbe1c47838f798cc0e8130182cc09bf7f47101ede372d7202fc2048fb228bb9
7
+ data.tar.gz: '0812e8e68f94d8b1b98244e449e3ff417ee2c534bead530add3f84b6df0eb9e2b240ef7c45551f1a1c278e30571be36e5bb27380fcd0af4fa004a6c86949fee8'
data/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ License:
2
+ ========
3
+ The MIT License (MIT)
4
+ http://opensource.org/licenses/MIT
5
+
6
+ Copyright (c) 2014 - 2026 APIMATIC Limited
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in
16
+ all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ THE SOFTWARE.
25
+
26
+ Trade Mark:
27
+ ==========
28
+ APIMATIC is a trade mark for APIMATIC Limited
data/README.md ADDED
@@ -0,0 +1,178 @@
1
+
2
+ # Getting Started with CellPoint API
3
+
4
+ ## Introduction
5
+
6
+ Service for interacting with CellPoint Digital's Payment Orchestration Platform (POP).
7
+
8
+ ## Install the Package
9
+
10
+ Install the gem from the command line:
11
+
12
+ ```bash
13
+ gem install apimatic-cp-sdk -v 0.0.1
14
+ ```
15
+
16
+ Or add the gem to your Gemfile and run `bundle`:
17
+
18
+ ```ruby
19
+ gem 'apimatic-cp-sdk', '0.0.1'
20
+ ```
21
+
22
+ For additional gem details, see the [RubyGems page for the apimatic-cp-sdk gem](https://rubygems.org/gems/apimatic-cp-sdk/versions/0.0.1).
23
+
24
+ ## IRB Console Usage
25
+
26
+ You can explore the SDK interactively using IRB in two ways
27
+
28
+ ### 1. Use IRB with Installed Gem
29
+
30
+ Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and type the following command to start the irb console.
31
+
32
+ ```bash
33
+ irb
34
+ ```
35
+
36
+ Now you can load the SDK in the IRB
37
+
38
+ ```ruby
39
+ require 'cell_point_api'
40
+ include CellPointApi
41
+ ```
42
+
43
+ ### 2. Use IRB within SDK
44
+
45
+ Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and navigate to the root folder of SDK.
46
+
47
+ ```
48
+ cd path/to/cell_point_api
49
+ ```
50
+
51
+ Now you can start the preconfigured irb console by running the following command
52
+
53
+ ```bash
54
+ ruby bin/console
55
+ ```
56
+
57
+ **_Note:_** This automatically loads the SDK from lib/
58
+
59
+ ## Initialize the API Client
60
+
61
+ **_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/client.md)
62
+
63
+ The following parameters are configurable for the API Client:
64
+
65
+ | Parameter | Type | Description |
66
+ | --- | --- | --- |
67
+ | environment | [`Environment`](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/README.md#environments) | The API environment. <br> **Default: `Environment.PRODUCTION`** |
68
+ | connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
69
+ | adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
70
+ | timeout | `Float` | The value to use for connection timeout. <br> **Default: 30** |
71
+ | max_retries | `Integer` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
72
+ | retry_interval | `Float` | Pause in seconds between retries. <br> **Default: 1** |
73
+ | backoff_factor | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff. <br> **Default: 2** |
74
+ | retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
75
+ | retry_methods | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put get put]** |
76
+ | http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
77
+ | proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
78
+ | logging_configuration | [`LoggingConfiguration`](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/logging-configuration.md) | The SDK logging configuration for API calls |
79
+ | cpd_issued_jwt_credentials | [`CpdIssuedJwtCredentials`](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant |
80
+ | merchant_issued_jwt_credentials | [`MerchantIssuedJwtCredentials`](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/auth/oauth-2-bearer-token.md) | The credential object for OAuth 2 Bearer token |
81
+
82
+ The API client can be initialized as follows:
83
+
84
+ ### Code-Based Client Initialization
85
+
86
+ ```ruby
87
+ require 'cell_point_api'
88
+ include CellPointApi
89
+
90
+ client = Client.new(
91
+ cpd_issued_jwt_credentials: CpdIssuedJwtCredentials.new(
92
+ oauth_client_id: 'OAuthClientId',
93
+ oauth_client_secret: 'OAuthClientSecret',
94
+ oauth_scopes: [
95
+ OauthScopeCpdIssuedJwt::BUYER,
96
+ OauthScopeCpdIssuedJwt::DASHBOARDSVIEW
97
+ ]
98
+ ),
99
+ merchant_issued_jwt_credentials: MerchantIssuedJwtCredentials.new(
100
+ access_token: 'AccessToken'
101
+ ),
102
+ environment: Environment::PRODUCTION,
103
+ logging_configuration: LoggingConfiguration.new(
104
+ log_level: Logger::INFO,
105
+ request_logging_config: RequestLoggingConfiguration.new(
106
+ log_body: true
107
+ ),
108
+ response_logging_config: ResponseLoggingConfiguration.new(
109
+ log_headers: true
110
+ )
111
+ )
112
+ )
113
+ ```
114
+
115
+ ### Environment-Based Client Initialization
116
+
117
+ ```ruby
118
+ require 'cell_point_api'
119
+ include CellPointApi
120
+
121
+ # Create client from environment
122
+ client = Client.from_env
123
+ ```
124
+
125
+ See the [`Environment-Based Client Initialization`](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/environment-based-client-initialization.md) section for details.
126
+
127
+ ## Environments
128
+
129
+ The SDK can be configured to use a different environment for making API calls. Available environments are:
130
+
131
+ ### Fields
132
+
133
+ | Name | Description |
134
+ | --- | --- |
135
+ | PRODUCTION | **Default** |
136
+
137
+ ## Authorization
138
+
139
+ This API uses the following authentication schemes.
140
+
141
+ * [`cpdIssuedJWT (OAuth 2 Client Credentials Grant)`](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/auth/oauth-2-client-credentials-grant.md)
142
+ * [`merchantIssuedJWT (OAuth 2 Bearer token)`](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/auth/oauth-2-bearer-token.md)
143
+
144
+ ## List of APIs
145
+
146
+ * [Apple Pay](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/controllers/apple-pay.md)
147
+ * [Payment Methods](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/controllers/payment-methods.md)
148
+ * [Authentication](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/controllers/authentication.md)
149
+ * [Bulk](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/controllers/bulk.md)
150
+ * [Cards](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/controllers/cards.md)
151
+ * [Notes](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/controllers/notes.md)
152
+ * [Orders](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/controllers/orders.md)
153
+ * [Proxy](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/controllers/proxy.md)
154
+ * [Transactions](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/controllers/transactions.md)
155
+ * [Wallet](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/controllers/wallet.md)
156
+
157
+ ## SDK Infrastructure
158
+
159
+ ### Configuration
160
+
161
+ * [ProxySettings](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/proxy-settings.md)
162
+ * [Environment-Based Client Initialization](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/environment-based-client-initialization.md)
163
+ * [AbstractLogger](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/abstract-logger.md)
164
+ * [LoggingConfiguration](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/logging-configuration.md)
165
+ * [RequestLoggingConfiguration](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/request-logging-configuration.md)
166
+ * [ResponseLoggingConfiguration](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/response-logging-configuration.md)
167
+
168
+ ### HTTP
169
+
170
+ * [HttpResponse](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/http-response.md)
171
+ * [HttpRequest](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/http-request.md)
172
+
173
+ ### Utilities
174
+
175
+ * [ApiResponse](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/api-response.md)
176
+ * [ApiHelper](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/api-helper.md)
177
+ * [DateTimeHelper](https://www.github.com/sdks-io/apimatic-cp-ruby-sdk/tree/0.0.1/doc/date-time-helper.md)
178
+
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Load the lib folder into Ruby's load path
4
+ $LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
5
+
6
+ # Require the gem
7
+ require 'cell_point_api'
8
+
9
+ puts 'CellPointApi SDK loaded!'
10
+ puts 'You can now create a client with: client = CellPointApi::Client.new'
11
+ puts 'Or use from_env: client = CellPointApi::Client.from_env'
12
+
13
+ # Start an interactive IRB session
14
+ require 'irb'
15
+ IRB.start
@@ -0,0 +1,10 @@
1
+ # cell_point_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CellPointApi
7
+ # API utility class
8
+ class APIHelper < CoreLibrary::ApiHelper
9
+ end
10
+ end
@@ -0,0 +1,51 @@
1
+ # cell_point_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CellPointApi
7
+ # ApplePayApi
8
+ class ApplePayApi < BaseApi
9
+ # Stores an Apple Pay token for later use.
10
+ # @param [String] order_id Required parameter: The order to store the Apple
11
+ # Pay token against.
12
+ # @param [UUID | String] idempotency_key Optional parameter: A unique
13
+ # identifier. If you don't receive a response (for example, in case of a
14
+ # timeout), you can safely retry the request with the same header. If the
15
+ # system already processed the request, the response to the first attempt
16
+ # will be returned without duplication. Idempotency-Keys will last for
17
+ # 24hrs. After this time, please do a GET call to the resource to check the
18
+ # status. > This is used only in `POST` requests, so they have the same
19
+ # idempotency guarantees as `PUT`.
20
+ # @param [SavePkPaymentTokenRequest] body Optional parameter: RequestBody
21
+ # containing the encrypted Apple Pay token.
22
+ # @return [ApiResponse] Complete http response with raw body and status code.
23
+ def apple_pay_store_encrypted_token(order_id,
24
+ idempotency_key: nil,
25
+ body: nil)
26
+ warn 'Endpoint apple_pay_store_encrypted_token in ApplePayApi is depreca'\
27
+ 'ted'
28
+ @api_call
29
+ .request(new_request_builder(HttpMethodEnum::POST,
30
+ '/payments/v1/orders/{orderId}/apple-pay-tokens',
31
+ Server::DEFAULT)
32
+ .template_param(new_parameter(order_id, key: 'orderId')
33
+ .is_required(true)
34
+ .should_encode(true))
35
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
36
+ .header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
37
+ .body_param(new_parameter(body))
38
+ .header_param(new_parameter('application/json', key: 'accept'))
39
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
40
+ .auth(Single.new('cpdIssuedJWT')))
41
+ .response(new_response_handler
42
+ .deserializer(APIHelper.method(:custom_type_deserializer))
43
+ .deserialize_into(AppleTokenizedToken.method(:from_hash))
44
+ .is_api_response(true)
45
+ .local_error('400',
46
+ 'Bad Request',
47
+ ProblemException))
48
+ .execute
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,81 @@
1
+ # cell_point_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CellPointApi
7
+ # AuthenticationApi
8
+ class AuthenticationApi < BaseApi
9
+ # Retrieve an Access Token for desired scope using Private Key JWT Flow.
10
+ # Prerequisites for Private Key JWT Flow:
11
+ # 1. CellPoint must be configured to use merchant's `jwks` (JSON Web Key
12
+ # Set) endpoint to validate Private JWT.
13
+ # ***Flow Diagram***
14
+ # ![diagram_001](media/diagram_001.png)
15
+ # For more details, see Authorizations for this endpoint below:
16
+ # @param [String] grant_type Optional parameter: The type of grant
17
+ # requested. This must be `client_credentials`.
18
+ # @param [String] client_assertion_type Optional parameter: The type of
19
+ # client assertion. This must be
20
+ # `urn:ietf:params:oauth:client-assertion-type:jwt-bearer`.
21
+ # @param [String] client_id Optional parameter: The client ID, as provided
22
+ # by Cellpoint.
23
+ # @param [Audience] audience Optional parameter: The intended audience for
24
+ # the client assertion.
25
+ # @param [String] scope Optional parameter: The requested permissions for
26
+ # the client. A space separated list of permissions.
27
+ # @param [String] client_assertion Optional parameter: A JWT signed by the
28
+ # caller. The JWT must contain the following claims: - `iss`: The client ID,
29
+ # as provided by Cellpoint. - `sub`: The client ID, as provided by
30
+ # Cellpoint. - `aud`: The appropriate auth server, example:
31
+ # https://auth.api.test.cellpoint.app/
32
+ # @return [ApiResponse] Complete http response with raw body and status code.
33
+ def get_access_token(grant_type: nil,
34
+ client_assertion_type: nil,
35
+ client_id: nil,
36
+ audience: nil,
37
+ scope: nil,
38
+ client_assertion: nil)
39
+ @api_call
40
+ .request(new_request_builder(HttpMethodEnum::POST,
41
+ '/oauth2/token',
42
+ Server::DEFAULT)
43
+ .form_param(new_parameter(grant_type, key: 'grant_type'))
44
+ .form_param(new_parameter(client_assertion_type, key: 'client_assertion_type'))
45
+ .form_param(new_parameter(client_id, key: 'client_id'))
46
+ .form_param(new_parameter(audience, key: 'audience'))
47
+ .form_param(new_parameter(scope, key: 'scope'))
48
+ .form_param(new_parameter(client_assertion, key: 'client_assertion'))
49
+ .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type'))
50
+ .header_param(new_parameter('application/json', key: 'accept'))
51
+ .auth(Single.new('merchantIssuedJWT')))
52
+ .response(new_response_handler
53
+ .deserializer(APIHelper.method(:custom_type_deserializer))
54
+ .deserialize_into(TokenPost200Response.method(:from_hash))
55
+ .is_api_response(true)
56
+ .local_error('400',
57
+ 'Bad Request',
58
+ ProblemException)
59
+ .local_error('401',
60
+ 'Authorization Required',
61
+ APIException)
62
+ .local_error('404',
63
+ 'Resource Not Found',
64
+ APIException)
65
+ .local_error('406',
66
+ 'Cannot generate content acceptable according to the `Accept`'\
67
+ ' headers in the request',
68
+ ProblemException)
69
+ .local_error('500',
70
+ 'Internal Server Error',
71
+ ProblemException)
72
+ .local_error('502',
73
+ 'Bad Gateway',
74
+ APIException)
75
+ .local_error('503',
76
+ 'Service Unavailable',
77
+ APIException))
78
+ .execute
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,67 @@
1
+ # cell_point_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CellPointApi
7
+ # BaseApi.
8
+ class BaseApi
9
+ include CoreLibrary
10
+ attr_accessor :config, :http_call_back
11
+
12
+ def self.user_agent
13
+ 'Ruby-SDK/0.0.1 (OS: {os-info}, Engine: {engine}/{engine-version})'
14
+ end
15
+
16
+ def self.user_agent_parameters
17
+ {
18
+ '{engine}' => { 'value' => RUBY_ENGINE, 'encode' => false },
19
+ '{engine-version}' => { 'value' => RUBY_ENGINE_VERSION, 'encode' => false },
20
+ '{os-info}' => { 'value' => RUBY_PLATFORM, 'encode' => false }
21
+ }
22
+ end
23
+
24
+ GLOBAL_ERRORS = {
25
+ 'default' => ErrorCase.new
26
+ .error_message('HTTP response not OK.')
27
+ .exception_type(APIException)
28
+ }.freeze
29
+
30
+ # Initialization constructor.
31
+ # @param [GlobalConfiguration] global_configuration The instance of GlobalConfiguration.
32
+ def initialize(global_configuration)
33
+ @global_configuration = global_configuration
34
+ @config = @global_configuration.client_configuration
35
+ @http_call_back = @config.http_callback
36
+ @api_call = ApiCall.new(@global_configuration)
37
+ end
38
+
39
+ # Creates a new instance of the request builder.
40
+ # @param [String] http_method The HTTP method to use in the request.
41
+ # @param [String] path The endpoint path to use in the request.
42
+ # @param [String] server The server to extract the base uri for the request.
43
+ # @return [RequestBuilder] The instance of RequestBuilder.
44
+ def new_request_builder(http_method, path, server)
45
+ RequestBuilder.new
46
+ .http_method(http_method)
47
+ .path(path)
48
+ .server(server)
49
+ end
50
+
51
+ # Creates a new instance of the response handler.
52
+ # @return [ResponseHandler] The instance of ResponseHandler.
53
+ def new_response_handler
54
+ ResponseHandler.new
55
+ end
56
+
57
+ # Creates a new instance of the parameter.
58
+ # @param [String|optional] key The key of the parameter.
59
+ # @param [Object] value The value of the parameter.
60
+ # @return [Parameter] The instance of Parameter.
61
+ def new_parameter(value, key: nil)
62
+ Parameter.new
63
+ .key(key)
64
+ .value(value)
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,93 @@
1
+ # cell_point_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CellPointApi
7
+ # BulkApi
8
+ class BulkApi < BaseApi
9
+ # Get summary information about a bulk.
10
+ # @param [String] bulk_id Required parameter: Bulk to retrieve
11
+ # @return [ApiResponse] Complete http response with raw body and status code.
12
+ def get_bulk_by_id(bulk_id)
13
+ @api_call
14
+ .request(new_request_builder(HttpMethodEnum::GET,
15
+ '/payments/v1/bulks/{bulkId}',
16
+ Server::DEFAULT)
17
+ .template_param(new_parameter(bulk_id, key: 'bulkId')
18
+ .is_required(true)
19
+ .should_encode(true))
20
+ .header_param(new_parameter('application/json', key: 'accept'))
21
+ .auth(Single.new('cpdIssuedJWT')))
22
+ .response(new_response_handler
23
+ .deserializer(APIHelper.method(:custom_type_deserializer))
24
+ .deserialize_into(Summary.method(:from_hash))
25
+ .is_api_response(true)
26
+ .local_error('400',
27
+ 'Bad Request',
28
+ ProblemException)
29
+ .local_error('401',
30
+ 'Authorization Required',
31
+ APIException)
32
+ .local_error('404',
33
+ 'Resource Not Found',
34
+ APIException)
35
+ .local_error('406',
36
+ 'Cannot generate content acceptable according to the `Accept`'\
37
+ ' headers in the request',
38
+ ProblemException)
39
+ .local_error('500',
40
+ 'Internal Server Error',
41
+ ProblemException)
42
+ .local_error('502',
43
+ 'Bad Gateway',
44
+ APIException)
45
+ .local_error('503',
46
+ 'Service Unavailable',
47
+ APIException))
48
+ .execute
49
+ end
50
+
51
+ # Trigger a bulk.
52
+ # @param [TriggerBulkRequest] request Required parameter: Bulk request to
53
+ # trigger.
54
+ # @return [ApiResponse] Complete http response with raw body and status code.
55
+ def trigger_bulk(request)
56
+ @api_call
57
+ .request(new_request_builder(HttpMethodEnum::POST,
58
+ '/payments/v1/bulks',
59
+ Server::DEFAULT)
60
+ .query_param(new_parameter(request, key: 'request')
61
+ .is_required(true))
62
+ .header_param(new_parameter('application/json', key: 'accept'))
63
+ .auth(Single.new('cpdIssuedJWT')))
64
+ .response(new_response_handler
65
+ .deserializer(APIHelper.method(:custom_type_deserializer))
66
+ .deserialize_into(PaymentsV1BulksResponse.method(:from_hash))
67
+ .is_api_response(true)
68
+ .local_error('400',
69
+ 'Bad Request',
70
+ ProblemException)
71
+ .local_error('401',
72
+ 'Authorization Required',
73
+ APIException)
74
+ .local_error('404',
75
+ 'Resource Not Found',
76
+ APIException)
77
+ .local_error('406',
78
+ 'Cannot generate content acceptable according to the `Accept`'\
79
+ ' headers in the request',
80
+ ProblemException)
81
+ .local_error('500',
82
+ 'Internal Server Error',
83
+ ProblemException)
84
+ .local_error('502',
85
+ 'Bad Gateway',
86
+ APIException)
87
+ .local_error('503',
88
+ 'Service Unavailable',
89
+ APIException))
90
+ .execute
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,104 @@
1
+ # cell_point_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CellPointApi
7
+ # CardsApi
8
+ class CardsApi < BaseApi
9
+ # Tokenize a card to use for a later authorization.
10
+ # Tokenization is useful to prevent other parts system from having to
11
+ # interact with PCI information.
12
+ # Tokens are single-use and will expire after 15 minutes.
13
+ # @param [String] order_id Required parameter: Order to retrieve the payment
14
+ # methods that the buyer has available to pay for it with.
15
+ # @param [Card] body Optional parameter: Request body containing the card
16
+ # details.
17
+ # @return [ApiResponse] Complete http response with raw body and status code.
18
+ def card_tokenize(order_id,
19
+ body: nil)
20
+ @api_call
21
+ .request(new_request_builder(HttpMethodEnum::POST,
22
+ '/payments/v1/orders/{orderId}/card-tokens',
23
+ Server::DEFAULT)
24
+ .template_param(new_parameter(order_id, key: 'orderId')
25
+ .is_required(true)
26
+ .should_encode(true))
27
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
28
+ .body_param(new_parameter(body))
29
+ .header_param(new_parameter('application/json', key: 'accept'))
30
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
31
+ .auth(Single.new('cpdIssuedJWT')))
32
+ .response(new_response_handler
33
+ .deserializer(APIHelper.method(:custom_type_deserializer))
34
+ .deserialize_into(TokenizedCard.method(:from_hash))
35
+ .is_api_response(true)
36
+ .local_error('400',
37
+ 'Bad Request',
38
+ ProblemException))
39
+ .execute
40
+ end
41
+
42
+ # Tokenize an externally tokenized data to use for a later authorization.
43
+ # Tokenization is useful to prevent other parts system from having to
44
+ # interact with PCI information.
45
+ # Tokens are single-use and will expire after 15 minutes.
46
+ # Unlike the regular tokenization, this endpoint is used to tokenize data
47
+ # that has already been tokenized by a third party,
48
+ # such as a payment gateway or a wallet provider. Such data typically
49
+ # billing details too.
50
+ # This endpoint will return these billing details.
51
+ # @param [String] order_id Required parameter: Order to retrieve the payment
52
+ # methods that the buyer has available to pay for it with.
53
+ # @param [ExternallyTokenizedCard] body Optional parameter: Request body
54
+ # containing the card details.
55
+ # @return [ApiResponse] Complete http response with raw body and status code.
56
+ def external_card_tokenize(order_id,
57
+ body: nil)
58
+ @api_call
59
+ .request(new_request_builder(HttpMethodEnum::POST,
60
+ '/payments/v1/orders/{orderId}/external-card-tokens',
61
+ Server::DEFAULT)
62
+ .template_param(new_parameter(order_id, key: 'orderId')
63
+ .is_required(true)
64
+ .should_encode(true))
65
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
66
+ .body_param(new_parameter(body))
67
+ .header_param(new_parameter('application/json', key: 'accept'))
68
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
69
+ .auth(Single.new('cpdIssuedJWT')))
70
+ .response(new_response_handler
71
+ .deserializer(APIHelper.method(:custom_type_deserializer))
72
+ .deserialize_into(TokenizedCardWithContactData.method(:from_hash))
73
+ .is_api_response(true)
74
+ .local_error('400',
75
+ 'Bad Request',
76
+ ProblemException))
77
+ .execute
78
+ end
79
+
80
+ # Lookup the card scheme via BIN data.
81
+ # @param [Bin] body Optional parameter: Request body containing the card
82
+ # BIN.
83
+ # @return [ApiResponse] Complete http response with raw body and status code.
84
+ def card_scheme_lookup(body: nil)
85
+ @api_call
86
+ .request(new_request_builder(HttpMethodEnum::POST,
87
+ '/payments/v1/schemes',
88
+ Server::DEFAULT)
89
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
90
+ .body_param(new_parameter(body))
91
+ .header_param(new_parameter('application/json', key: 'accept'))
92
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
93
+ .auth(Single.new('cpdIssuedJWT')))
94
+ .response(new_response_handler
95
+ .deserializer(APIHelper.method(:custom_type_deserializer))
96
+ .deserialize_into(PaymentsV1SchemesResponse.method(:from_hash))
97
+ .is_api_response(true)
98
+ .local_error('400',
99
+ 'Bad Request',
100
+ ProblemException))
101
+ .execute
102
+ end
103
+ end
104
+ end