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
@@ -0,0 +1,143 @@
1
+ # cell_point_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module CellPointApi
8
+ # AppleTokenizedToken Model.
9
+ class AppleTokenizedToken < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Card token identifier. Used for both cards and Apple Pay.
14
+ # @return [String]
15
+ attr_accessor :token
16
+
17
+ # When Apple Pay token will expire.
18
+ # TBD
19
+ # @return [DateTime]
20
+ attr_accessor :expires_at
21
+
22
+ # Display Payment Card Name.
23
+ # A string, suitable for display, that describes the card.
24
+ # For debit and credit cards, the display name often includes the card brand
25
+ # and the last four digits of the credit card number when available, for
26
+ # example: “************0492”, “Visa 1233”, “MasterCard 5678”, “AmEx 9876”.
27
+ # For Apple Pay Cash cards, the display name is “Apple Pay Cash”. However,
28
+ # there is no guarantee about the display name’s content or format.
29
+ # To protect the user’s privacy, Apple Pay sets the display name only after
30
+ # the user authorizes the purchase.
31
+ # @return [String]
32
+ attr_accessor :display_name
33
+
34
+ # Display Payment Card Name.
35
+ # A string, suitable for display, that describes the card.
36
+ # For debit and credit cards, the display name often includes the card brand
37
+ # and the last four digits of the credit card number when available, for
38
+ # example: “************0492”, “Visa 1233”, “MasterCard 5678”, “AmEx 9876”.
39
+ # For Apple Pay Cash cards, the display name is “Apple Pay Cash”. However,
40
+ # there is no guarantee about the display name’s content or format.
41
+ # To protect the user’s privacy, Apple Pay sets the display name only after
42
+ # the user authorizes the purchase.
43
+ # @return [String]
44
+ attr_accessor :order_id
45
+
46
+ # Card Scheme networks connects acquiring banks to issuing banks so that a
47
+ # customer transaction can be verified.
48
+ # Is a middle man that also provide additional services, such as data
49
+ # processing, international transactions, etc.
50
+ # @return [CardScheme]
51
+ attr_accessor :scheme
52
+
53
+ # A mapping from model property names to API property names.
54
+ def self.names
55
+ @_hash = {} if @_hash.nil?
56
+ @_hash['token'] = 'token'
57
+ @_hash['expires_at'] = 'expiresAt'
58
+ @_hash['display_name'] = 'displayName'
59
+ @_hash['order_id'] = 'orderId'
60
+ @_hash['scheme'] = 'scheme'
61
+ @_hash
62
+ end
63
+
64
+ # An array for optional fields
65
+ def self.optionals
66
+ %w[
67
+ expires_at
68
+ display_name
69
+ order_id
70
+ scheme
71
+ ]
72
+ end
73
+
74
+ # An array for nullable fields
75
+ def self.nullables
76
+ []
77
+ end
78
+
79
+ def initialize(token:, expires_at: SKIP, display_name: SKIP, order_id: SKIP,
80
+ scheme: SKIP, additional_properties: nil)
81
+ # Add additional model properties to the instance
82
+ additional_properties = {} if additional_properties.nil?
83
+
84
+ @token = token
85
+ @expires_at = expires_at unless expires_at == SKIP
86
+ @display_name = display_name unless display_name == SKIP
87
+ @order_id = order_id unless order_id == SKIP
88
+ @scheme = scheme unless scheme == SKIP
89
+ @additional_properties = additional_properties
90
+ end
91
+
92
+ # Creates an instance of the object from a hash.
93
+ def self.from_hash(hash)
94
+ return nil unless hash
95
+
96
+ # Extract variables from the hash.
97
+ token = hash.key?('token') ? hash['token'] : nil
98
+ expires_at = if hash.key?('expiresAt')
99
+ (DateTimeHelper.from_rfc3339(hash['expiresAt']) if hash['expiresAt'])
100
+ else
101
+ SKIP
102
+ end
103
+ display_name = hash.key?('displayName') ? hash['displayName'] : SKIP
104
+ order_id = hash.key?('orderId') ? hash['orderId'] : SKIP
105
+ scheme = hash.key?('scheme') ? hash['scheme'] : SKIP
106
+
107
+ # Create a new hash for additional properties, removing known properties.
108
+ new_hash = hash.reject { |k, _| names.value?(k) }
109
+
110
+ additional_properties = APIHelper.get_additional_properties(
111
+ new_hash, proc { |value| value }
112
+ )
113
+
114
+ # Create object from extracted values.
115
+ AppleTokenizedToken.new(token: token,
116
+ expires_at: expires_at,
117
+ display_name: display_name,
118
+ order_id: order_id,
119
+ scheme: scheme,
120
+ additional_properties: additional_properties)
121
+ end
122
+
123
+ def to_custom_expires_at
124
+ DateTimeHelper.to_rfc3339(expires_at)
125
+ end
126
+
127
+ # Provides a human-readable string representation of the object.
128
+ def to_s
129
+ class_name = self.class.name.split('::').last
130
+ "<#{class_name} token: #{@token}, expires_at: #{@expires_at}, display_name:"\
131
+ " #{@display_name}, order_id: #{@order_id}, scheme: #{@scheme}, additional_properties:"\
132
+ " #{@additional_properties}>"
133
+ end
134
+
135
+ # Provides a debugging-friendly string with detailed object information.
136
+ def inspect
137
+ class_name = self.class.name.split('::').last
138
+ "<#{class_name} token: #{@token.inspect}, expires_at: #{@expires_at.inspect}, display_name:"\
139
+ " #{@display_name.inspect}, order_id: #{@order_id.inspect}, scheme: #{@scheme.inspect},"\
140
+ " additional_properties: #{@additional_properties}>"
141
+ end
142
+ end
143
+ end
@@ -0,0 +1,36 @@
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
+ # The intended audience for the client assertion.
8
+ class Audience
9
+ AUDIENCE = [
10
+ # TODO: Write general description for PAYMENTS
11
+ PAYMENTS = 'payments'.freeze,
12
+
13
+ # TODO: Write general description for DOCUMENTPROXY
14
+ DOCUMENTPROXY = 'document-proxy'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ AUDIENCE.include?(value)
21
+ end
22
+
23
+ def self.from_value(value, default_value = PAYMENTS)
24
+ return default_value if value.nil?
25
+
26
+ str = value.to_s.strip
27
+
28
+ case str.downcase
29
+ when 'payments' then PAYMENTS
30
+ when 'documentproxy' then DOCUMENTPROXY
31
+ else
32
+ default_value
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,145 @@
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
+ # Contains the authorization request object.
8
+ class Authorization < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The payment instrument to be used for the authorization.
13
+ # @return [Object]
14
+ attr_accessor :payment_instrument
15
+
16
+ # Amount to be authorized related to the order, if it's null, the order's
17
+ # total amount will be authorized, if it's bigger than the order's total
18
+ # amount, no authorization will happen
19
+ # @return [NonNegativeAmount]
20
+ attr_accessor :amount
21
+
22
+ # Whether the Terms and Conditions have been accepted.
23
+ # Before the order can transition to a PAID state, the terms and conditions
24
+ # must be accepted.
25
+ # Each payment can mark itself as accepting those terms, but if the payments
26
+ # weren't marked so,
27
+ # an additional call to this `confirm-payments` operation in `Orders` would
28
+ # be required after all the payments have been made.
29
+ # The first payment to accept the terms and conditions accepts it for all
30
+ # further payments for the same order.
31
+ # Further requests to accept the terms and conditions do nothing.
32
+ # @return [TrueClass | FalseClass]
33
+ attr_accessor :has_accepted_terms_and_conditions
34
+
35
+ # Custom data to attach to the authorization for tracking and analytical
36
+ # reasons by a merchant.
37
+ # > Note: These properties are not used by CellPoint Digital for any payment
38
+ # processing and will not be passed to any acquirers.
39
+ # @return [Hash[String, String]]
40
+ attr_accessor :custom
41
+
42
+ # A mapping from model property names to API property names.
43
+ def self.names
44
+ @_hash = {} if @_hash.nil?
45
+ @_hash['payment_instrument'] = 'paymentInstrument'
46
+ @_hash['amount'] = 'amount'
47
+ @_hash['has_accepted_terms_and_conditions'] =
48
+ 'hasAcceptedTermsAndConditions'
49
+ @_hash['custom'] = 'custom'
50
+ @_hash
51
+ end
52
+
53
+ # An array for optional fields
54
+ def self.optionals
55
+ %w[
56
+ amount
57
+ custom
58
+ ]
59
+ end
60
+
61
+ # An array for nullable fields
62
+ def self.nullables
63
+ []
64
+ end
65
+
66
+ def initialize(payment_instrument:, has_accepted_terms_and_conditions:,
67
+ amount: SKIP, custom: SKIP, additional_properties: nil)
68
+ # Add additional model properties to the instance
69
+ additional_properties = {} if additional_properties.nil?
70
+
71
+ @payment_instrument = payment_instrument
72
+ @amount = amount unless amount == SKIP
73
+ @has_accepted_terms_and_conditions = has_accepted_terms_and_conditions
74
+ @custom = custom unless custom == SKIP
75
+ @additional_properties = additional_properties
76
+ end
77
+
78
+ # Creates an instance of the object from a hash.
79
+ def self.from_hash(hash)
80
+ return nil unless hash
81
+
82
+ # Extract variables from the hash.
83
+ payment_instrument = hash.key?('paymentInstrument') ? APIHelper.deserialize_union_type(
84
+ UnionTypeLookUp.get(:AuthorizationPaymentInstrument), hash['paymentInstrument']
85
+ ) : nil
86
+ has_accepted_terms_and_conditions =
87
+ hash.key?('hasAcceptedTermsAndConditions') ? hash['hasAcceptedTermsAndConditions'] : nil
88
+ amount = NonNegativeAmount.from_hash(hash['amount']) if hash['amount']
89
+ custom = hash.key?('custom') ? hash['custom'] : SKIP
90
+
91
+ # Create a new hash for additional properties, removing known properties.
92
+ new_hash = hash.reject { |k, _| names.value?(k) }
93
+
94
+ additional_properties = APIHelper.get_additional_properties(
95
+ new_hash, proc { |value| value }
96
+ )
97
+
98
+ # Create object from extracted values.
99
+ Authorization.new(payment_instrument: payment_instrument,
100
+ has_accepted_terms_and_conditions: has_accepted_terms_and_conditions,
101
+ amount: amount,
102
+ custom: custom,
103
+ additional_properties: additional_properties)
104
+ end
105
+
106
+ # Validates an instance of the object from a given value.
107
+ # @param [Authorization | Hash] The value against the validation is performed.
108
+ def self.validate(value)
109
+ if value.instance_of? self
110
+ return (
111
+ UnionTypeLookUp.get(:AuthorizationPaymentInstrument)
112
+ .validate(value.payment_instrument) and
113
+ APIHelper.valid_type?(value.has_accepted_terms_and_conditions,
114
+ ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass })
115
+ )
116
+ end
117
+
118
+ return false unless value.instance_of? Hash
119
+
120
+ (
121
+ UnionTypeLookUp.get(:AuthorizationPaymentInstrument)
122
+ .validate(value['paymentInstrument']) and
123
+ APIHelper.valid_type?(value['hasAcceptedTermsAndConditions'],
124
+ ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass })
125
+ )
126
+ end
127
+
128
+ # Provides a human-readable string representation of the object.
129
+ def to_s
130
+ class_name = self.class.name.split('::').last
131
+ "<#{class_name} payment_instrument: #{@payment_instrument}, amount: #{@amount},"\
132
+ " has_accepted_terms_and_conditions: #{@has_accepted_terms_and_conditions}, custom:"\
133
+ " #{@custom}, additional_properties: #{@additional_properties}>"
134
+ end
135
+
136
+ # Provides a debugging-friendly string with detailed object information.
137
+ def inspect
138
+ class_name = self.class.name.split('::').last
139
+ "<#{class_name} payment_instrument: #{@payment_instrument.inspect}, amount:"\
140
+ " #{@amount.inspect}, has_accepted_terms_and_conditions:"\
141
+ " #{@has_accepted_terms_and_conditions.inspect}, custom: #{@custom.inspect},"\
142
+ " additional_properties: #{@additional_properties}>"
143
+ end
144
+ end
145
+ end
@@ -0,0 +1,99 @@
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
+ # A means of grouping line items together into separate authorizations for
8
+ # Aggregate Payments.
9
+ class AuthorizationGroup < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Unique id within the order for the authorization group.
14
+ # If an authorization group exists, all line items must correspond to an
15
+ # appropriate authorization group.
16
+ # @return [String]
17
+ attr_accessor :id
18
+
19
+ # Total amount of authorization. Should match the total when adding all line
20
+ # items with authorization group identifier.
21
+ # @return [NonNegativeAmount]
22
+ attr_accessor :total_amount
23
+
24
+ # Should only be specified for payments handled by an external supplier.
25
+ # @return [String]
26
+ attr_accessor :external_supplier
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['id'] = 'id'
32
+ @_hash['total_amount'] = 'totalAmount'
33
+ @_hash['external_supplier'] = 'externalSupplier'
34
+ @_hash
35
+ end
36
+
37
+ # An array for optional fields
38
+ def self.optionals
39
+ %w[
40
+ external_supplier
41
+ ]
42
+ end
43
+
44
+ # An array for nullable fields
45
+ def self.nullables
46
+ []
47
+ end
48
+
49
+ def initialize(id:, total_amount:, external_supplier: SKIP,
50
+ additional_properties: nil)
51
+ # Add additional model properties to the instance
52
+ additional_properties = {} if additional_properties.nil?
53
+
54
+ @id = id
55
+ @total_amount = total_amount
56
+ @external_supplier = external_supplier unless external_supplier == SKIP
57
+ @additional_properties = additional_properties
58
+ end
59
+
60
+ # Creates an instance of the object from a hash.
61
+ def self.from_hash(hash)
62
+ return nil unless hash
63
+
64
+ # Extract variables from the hash.
65
+ id = hash.key?('id') ? hash['id'] : nil
66
+ total_amount = NonNegativeAmount.from_hash(hash['totalAmount']) if hash['totalAmount']
67
+ external_supplier =
68
+ hash.key?('externalSupplier') ? hash['externalSupplier'] : SKIP
69
+
70
+ # Create a new hash for additional properties, removing known properties.
71
+ new_hash = hash.reject { |k, _| names.value?(k) }
72
+
73
+ additional_properties = APIHelper.get_additional_properties(
74
+ new_hash, proc { |value| value }
75
+ )
76
+
77
+ # Create object from extracted values.
78
+ AuthorizationGroup.new(id: id,
79
+ total_amount: total_amount,
80
+ external_supplier: external_supplier,
81
+ additional_properties: additional_properties)
82
+ end
83
+
84
+ # Provides a human-readable string representation of the object.
85
+ def to_s
86
+ class_name = self.class.name.split('::').last
87
+ "<#{class_name} id: #{@id}, total_amount: #{@total_amount}, external_supplier:"\
88
+ " #{@external_supplier}, additional_properties: #{@additional_properties}>"
89
+ end
90
+
91
+ # Provides a debugging-friendly string with detailed object information.
92
+ def inspect
93
+ class_name = self.class.name.split('::').last
94
+ "<#{class_name} id: #{@id.inspect}, total_amount: #{@total_amount.inspect},"\
95
+ " external_supplier: #{@external_supplier.inspect}, additional_properties:"\
96
+ " #{@additional_properties}>"
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,216 @@
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
+ # AuthorizationGroup1 Model.
8
+ class AuthorizationGroup1 < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Unique id within the order for the authorization group.
13
+ # If an authorization group exists, all line items must correspond to an
14
+ # appropriate authorization group.
15
+ # @return [String]
16
+ attr_accessor :id
17
+
18
+ # Total amount of authorization. Should match the total when adding all line
19
+ # items with authorization group identifier.
20
+ # @return [NonNegativeAmount]
21
+ attr_accessor :total_amount
22
+
23
+ # Should only be specified for payments handled by an external supplier.
24
+ # @return [String]
25
+ attr_accessor :external_supplier
26
+
27
+ # Statement descriptors to explain the charges or payments on bank
28
+ # statements.
29
+ # @return [String]
30
+ attr_accessor :statement_descriptor
31
+
32
+ # Merchant configured for authorization group to be processed with.
33
+ # > NOTE: By default if not passed, this will be the main merchant.
34
+ # # !!!! This is future documentation, for once we have multi-merchant
35
+ # payments. !!!!
36
+ # #
37
+ # # Passing different merchants in authorization groups will cause
38
+ # multi-merchant payments,
39
+ # # where money will be processed into different merchant accounts (MIDs).
40
+ # #
41
+ # # These sub-merchant must be configured on the main account in order to
42
+ # process with them.
43
+ # @return [String]
44
+ attr_accessor :merchant
45
+
46
+ # Type of transaction that can be performed.
47
+ # <table>
48
+ # <tbody>
49
+ # <tr> <td>PAYMENT</td>
50
+ # <td>
51
+ # A standard payment transaction processed by CellPoint.
52
+ # <br/><br/>
53
+ # This is the default type and represents a typical payment flow.
54
+ # </td>
55
+ # </tr>
56
+ # <tr> <td>EXTERNAL</td>
57
+ # <td>
58
+ # An external transaction is one that is not processed by CellPoint,
59
+ # but by an external third-party.
60
+ # <br/><br/>
61
+ # CellPoint takes no part in this transaction and is not responsible for
62
+ # the state.
63
+ # <br/><br/>
64
+ # This type of transaction will purely be created as an indicator to our
65
+ # system and in our
66
+ # reporting applications, that a transaction has happened externally.
67
+ # <br/><br/>
68
+ # For the purposes of checking if an order is fully paid for, we will
69
+ # count external
70
+ # transactions towards the completion.
71
+ # </td>
72
+ # </tr>
73
+ # </tbody>
74
+ # </table>
75
+ # > NOTE: By default, this will be a standard Payment.
76
+ # @return [Type1]
77
+ attr_accessor :type
78
+
79
+ # List of payment transactions created against this authorization group.
80
+ # Multiple transactions may exist in the case of split payment.
81
+ # @return [Array[String]]
82
+ attr_accessor :transactions
83
+
84
+ # Stock Keeping Unit (SKU) is a product and service identification code for
85
+ # a specific product.
86
+ # @return [Array[String]]
87
+ attr_accessor :skus
88
+
89
+ # A mapping from model property names to API property names.
90
+ def self.names
91
+ @_hash = {} if @_hash.nil?
92
+ @_hash['id'] = 'id'
93
+ @_hash['total_amount'] = 'totalAmount'
94
+ @_hash['external_supplier'] = 'externalSupplier'
95
+ @_hash['statement_descriptor'] = 'statementDescriptor'
96
+ @_hash['merchant'] = 'merchant'
97
+ @_hash['type'] = 'type'
98
+ @_hash['transactions'] = 'transactions'
99
+ @_hash['skus'] = 'skus'
100
+ @_hash
101
+ end
102
+
103
+ # An array for optional fields
104
+ def self.optionals
105
+ %w[
106
+ external_supplier
107
+ statement_descriptor
108
+ merchant
109
+ type
110
+ transactions
111
+ skus
112
+ ]
113
+ end
114
+
115
+ # An array for nullable fields
116
+ def self.nullables
117
+ []
118
+ end
119
+
120
+ def initialize(id:, total_amount:, external_supplier: SKIP,
121
+ statement_descriptor: SKIP, merchant: SKIP,
122
+ type: Type1::PAYMENT, transactions: SKIP, skus: SKIP,
123
+ additional_properties: nil)
124
+ # Add additional model properties to the instance
125
+ additional_properties = {} if additional_properties.nil?
126
+
127
+ @id = id
128
+ @total_amount = total_amount
129
+ @external_supplier = external_supplier unless external_supplier == SKIP
130
+ @statement_descriptor = statement_descriptor unless statement_descriptor == SKIP
131
+ @merchant = merchant unless merchant == SKIP
132
+ @type = type unless type == SKIP
133
+ @transactions = transactions unless transactions == SKIP
134
+ @skus = skus unless skus == SKIP
135
+ @additional_properties = additional_properties
136
+ end
137
+
138
+ # Creates an instance of the object from a hash.
139
+ def self.from_hash(hash)
140
+ return nil unless hash
141
+
142
+ # Extract variables from the hash.
143
+ id = hash.key?('id') ? hash['id'] : nil
144
+ total_amount = NonNegativeAmount.from_hash(hash['totalAmount']) if hash['totalAmount']
145
+ external_supplier =
146
+ hash.key?('externalSupplier') ? hash['externalSupplier'] : SKIP
147
+ statement_descriptor =
148
+ hash.key?('statementDescriptor') ? hash['statementDescriptor'] : SKIP
149
+ merchant = hash.key?('merchant') ? hash['merchant'] : SKIP
150
+ type = hash['type'] ||= Type1::PAYMENT
151
+ transactions = hash.key?('transactions') ? hash['transactions'] : SKIP
152
+ skus = hash.key?('skus') ? hash['skus'] : SKIP
153
+
154
+ # Create a new hash for additional properties, removing known properties.
155
+ new_hash = hash.reject { |k, _| names.value?(k) }
156
+
157
+ additional_properties = APIHelper.get_additional_properties(
158
+ new_hash, proc { |value| value }
159
+ )
160
+
161
+ # Create object from extracted values.
162
+ AuthorizationGroup1.new(id: id,
163
+ total_amount: total_amount,
164
+ external_supplier: external_supplier,
165
+ statement_descriptor: statement_descriptor,
166
+ merchant: merchant,
167
+ type: type,
168
+ transactions: transactions,
169
+ skus: skus,
170
+ additional_properties: additional_properties)
171
+ end
172
+
173
+ # Validates an instance of the object from a given value.
174
+ # @param [AuthorizationGroup1 | Hash] The value against the validation is performed.
175
+ def self.validate(value)
176
+ if value.instance_of? self
177
+ return (
178
+ APIHelper.valid_type?(value.id,
179
+ ->(val) { val.instance_of? String }) and
180
+ APIHelper.valid_type?(value.total_amount,
181
+ ->(val) { NonNegativeAmount.validate(val) },
182
+ is_model_hash: true)
183
+ )
184
+ end
185
+
186
+ return false unless value.instance_of? Hash
187
+
188
+ (
189
+ APIHelper.valid_type?(value['id'],
190
+ ->(val) { val.instance_of? String }) and
191
+ APIHelper.valid_type?(value['totalAmount'],
192
+ ->(val) { NonNegativeAmount.validate(val) },
193
+ is_model_hash: true)
194
+ )
195
+ end
196
+
197
+ # Provides a human-readable string representation of the object.
198
+ def to_s
199
+ class_name = self.class.name.split('::').last
200
+ "<#{class_name} id: #{@id}, total_amount: #{@total_amount}, external_supplier:"\
201
+ " #{@external_supplier}, statement_descriptor: #{@statement_descriptor}, merchant:"\
202
+ " #{@merchant}, type: #{@type}, transactions: #{@transactions}, skus: #{@skus},"\
203
+ " additional_properties: #{@additional_properties}>"
204
+ end
205
+
206
+ # Provides a debugging-friendly string with detailed object information.
207
+ def inspect
208
+ class_name = self.class.name.split('::').last
209
+ "<#{class_name} id: #{@id.inspect}, total_amount: #{@total_amount.inspect},"\
210
+ " external_supplier: #{@external_supplier.inspect}, statement_descriptor:"\
211
+ " #{@statement_descriptor.inspect}, merchant: #{@merchant.inspect}, type: #{@type.inspect},"\
212
+ " transactions: #{@transactions.inspect}, skus: #{@skus.inspect}, additional_properties:"\
213
+ " #{@additional_properties}>"
214
+ end
215
+ end
216
+ end