subfi_pay 0.1.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 (261) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +11 -0
  3. data/Gemfile.lock +101 -0
  4. data/README.md +188 -0
  5. data/Rakefile +10 -0
  6. data/bin/console +11 -0
  7. data/docs/AccessKey.md +32 -0
  8. data/docs/AccessKeysApi.md +228 -0
  9. data/docs/AccountAttributes.md +20 -0
  10. data/docs/AccountAttributesAccount.md +20 -0
  11. data/docs/AccountCreateRequest.md +18 -0
  12. data/docs/AccountResponse.md +26 -0
  13. data/docs/AccountsApi.md +227 -0
  14. data/docs/BalanceTransactionAttributes.md +30 -0
  15. data/docs/BalanceTransactionResponse.md +38 -0
  16. data/docs/BalanceTransactionsApi.md +87 -0
  17. data/docs/BankAccountProfile.md +28 -0
  18. data/docs/BillingAddress.md +36 -0
  19. data/docs/CardProfile.md +42 -0
  20. data/docs/ChargeAttributes.md +26 -0
  21. data/docs/ChargeResponse.md +42 -0
  22. data/docs/ChargesApi.md +167 -0
  23. data/docs/ConnectedAccountAttributes.md +20 -0
  24. data/docs/ConnectedAccountResponse.md +26 -0
  25. data/docs/CreateAccountRequest.md +18 -0
  26. data/docs/CreateAccountRequestAccount.md +20 -0
  27. data/docs/CreateCustomerRequest.md +24 -0
  28. data/docs/CreateWebhookEndpointRequest.md +18 -0
  29. data/docs/CreateWebhookEndpointRequestWebhookEndpoint.md +28 -0
  30. data/docs/Customer.md +26 -0
  31. data/docs/CustomerAttributes.md +24 -0
  32. data/docs/CustomerAttributesCustomer.md +24 -0
  33. data/docs/CustomerCreateRequest.md +18 -0
  34. data/docs/CustomerUpdateAttributes.md +20 -0
  35. data/docs/CustomerUpdateAttributesCustomer.md +20 -0
  36. data/docs/CustomerUpdateRequest.md +18 -0
  37. data/docs/CustomersApi.md +307 -0
  38. data/docs/Event.md +30 -0
  39. data/docs/EventsApi.md +159 -0
  40. data/docs/ListAccessKeysResponse.md +20 -0
  41. data/docs/ListAccountsResponse.md +20 -0
  42. data/docs/ListBalanceTransactionsResponse.md +20 -0
  43. data/docs/ListChargesResponse.md +20 -0
  44. data/docs/ListCustomersResponse.md +20 -0
  45. data/docs/ListEventsResponse.md +20 -0
  46. data/docs/ListPaymentIntentsResponse.md +20 -0
  47. data/docs/ListPaymentMethodsResponse.md +20 -0
  48. data/docs/ListRefundsResponse.md +20 -0
  49. data/docs/ListWebhookEndpointsResponse.md +20 -0
  50. data/docs/ListWebhookRequestsResponse.md +20 -0
  51. data/docs/Meta.md +28 -0
  52. data/docs/PaymentIntentAttributes.md +26 -0
  53. data/docs/PaymentIntentAttributesPaymentIntent.md +26 -0
  54. data/docs/PaymentIntentCreateRequest.md +18 -0
  55. data/docs/PaymentIntentResponse.md +30 -0
  56. data/docs/PaymentIntentUpdateAttributes.md +18 -0
  57. data/docs/PaymentIntentUpdateAttributesPaymentIntent.md +18 -0
  58. data/docs/PaymentIntentsApi.md +533 -0
  59. data/docs/PaymentMethodAttributes.md +24 -0
  60. data/docs/PaymentMethodResponse.md +36 -0
  61. data/docs/PaymentMethodsApi.md +239 -0
  62. data/docs/RefundAttributes.md +20 -0
  63. data/docs/RefundResponse.md +30 -0
  64. data/docs/RefundsApi.md +311 -0
  65. data/docs/RollAccessKeyAttributes.md +18 -0
  66. data/docs/RollAccessKeyAttributesAccessKey.md +18 -0
  67. data/docs/RollAccessKeyRequest.md +18 -0
  68. data/docs/RollAccessKeyRequestAccessKey.md +18 -0
  69. data/docs/SubscriptionAttributes.md +30 -0
  70. data/docs/SubscriptionAttributesSubscription.md +30 -0
  71. data/docs/SubscriptionCreateRequest.md +18 -0
  72. data/docs/SubscriptionCreateRequestSubscription.md +30 -0
  73. data/docs/SubscriptionResponse.md +36 -0
  74. data/docs/SubscriptionsApi.md +155 -0
  75. data/docs/WebhookEndpoint.md +34 -0
  76. data/docs/WebhookEndpointsApi.md +380 -0
  77. data/docs/WebhookRequest.md +38 -0
  78. data/docs/WebhookRequestsApi.md +85 -0
  79. data/git_push.sh +57 -0
  80. data/lib/subfi_pay/api/access_keys_api.rb +235 -0
  81. data/lib/subfi_pay/api/accounts_api.rb +231 -0
  82. data/lib/subfi_pay/api/balance_transactions_api.rb +100 -0
  83. data/lib/subfi_pay/api/charges_api.rb +181 -0
  84. data/lib/subfi_pay/api/customers_api.rb +331 -0
  85. data/lib/subfi_pay/api/events_api.rb +172 -0
  86. data/lib/subfi_pay/api/payment_intents_api.rb +566 -0
  87. data/lib/subfi_pay/api/payment_methods_api.rb +262 -0
  88. data/lib/subfi_pay/api/refunds_api.rb +334 -0
  89. data/lib/subfi_pay/api/subscriptions_api.rb +177 -0
  90. data/lib/subfi_pay/api/webhook_endpoints_api.rb +404 -0
  91. data/lib/subfi_pay/api/webhook_requests_api.rb +97 -0
  92. data/lib/subfi_pay/api_client.rb +394 -0
  93. data/lib/subfi_pay/api_error.rb +58 -0
  94. data/lib/subfi_pay/configuration.rb +305 -0
  95. data/lib/subfi_pay/models/access_key.rb +275 -0
  96. data/lib/subfi_pay/models/account_attributes.rb +221 -0
  97. data/lib/subfi_pay/models/account_attributes_account.rb +221 -0
  98. data/lib/subfi_pay/models/account_create_request.rb +212 -0
  99. data/lib/subfi_pay/models/account_response.rb +248 -0
  100. data/lib/subfi_pay/models/balance_transaction_attributes.rb +266 -0
  101. data/lib/subfi_pay/models/balance_transaction_response.rb +303 -0
  102. data/lib/subfi_pay/models/bank_account_profile.rb +257 -0
  103. data/lib/subfi_pay/models/billing_address.rb +294 -0
  104. data/lib/subfi_pay/models/card_profile.rb +324 -0
  105. data/lib/subfi_pay/models/charge_attributes.rb +265 -0
  106. data/lib/subfi_pay/models/charge_response.rb +326 -0
  107. data/lib/subfi_pay/models/connected_account_attributes.rb +235 -0
  108. data/lib/subfi_pay/models/connected_account_response.rb +248 -0
  109. data/lib/subfi_pay/models/create_account_request.rb +219 -0
  110. data/lib/subfi_pay/models/create_account_request_account.rb +221 -0
  111. data/lib/subfi_pay/models/create_customer_request.rb +239 -0
  112. data/lib/subfi_pay/models/create_webhook_endpoint_request.rb +212 -0
  113. data/lib/subfi_pay/models/create_webhook_endpoint_request_webhook_endpoint.rb +257 -0
  114. data/lib/subfi_pay/models/customer.rb +248 -0
  115. data/lib/subfi_pay/models/customer_attributes.rb +239 -0
  116. data/lib/subfi_pay/models/customer_attributes_customer.rb +239 -0
  117. data/lib/subfi_pay/models/customer_create_request.rb +212 -0
  118. data/lib/subfi_pay/models/customer_update_attributes.rb +221 -0
  119. data/lib/subfi_pay/models/customer_update_attributes_customer.rb +221 -0
  120. data/lib/subfi_pay/models/customer_update_request.rb +212 -0
  121. data/lib/subfi_pay/models/event.rb +266 -0
  122. data/lib/subfi_pay/models/list_access_keys_response.rb +223 -0
  123. data/lib/subfi_pay/models/list_accounts_response.rb +223 -0
  124. data/lib/subfi_pay/models/list_balance_transactions_response.rb +223 -0
  125. data/lib/subfi_pay/models/list_charges_response.rb +223 -0
  126. data/lib/subfi_pay/models/list_customers_response.rb +223 -0
  127. data/lib/subfi_pay/models/list_events_response.rb +223 -0
  128. data/lib/subfi_pay/models/list_payment_intents_response.rb +223 -0
  129. data/lib/subfi_pay/models/list_payment_methods_response.rb +223 -0
  130. data/lib/subfi_pay/models/list_refunds_response.rb +223 -0
  131. data/lib/subfi_pay/models/list_webhook_endpoints_response.rb +223 -0
  132. data/lib/subfi_pay/models/list_webhook_requests_response.rb +223 -0
  133. data/lib/subfi_pay/models/meta.rb +259 -0
  134. data/lib/subfi_pay/models/payment_intent_attributes.rb +257 -0
  135. data/lib/subfi_pay/models/payment_intent_attributes_payment_intent.rb +257 -0
  136. data/lib/subfi_pay/models/payment_intent_create_request.rb +212 -0
  137. data/lib/subfi_pay/models/payment_intent_response.rb +268 -0
  138. data/lib/subfi_pay/models/payment_intent_update_attributes.rb +212 -0
  139. data/lib/subfi_pay/models/payment_intent_update_attributes_payment_intent.rb +214 -0
  140. data/lib/subfi_pay/models/payment_method_attributes.rb +246 -0
  141. data/lib/subfi_pay/models/payment_method_response.rb +296 -0
  142. data/lib/subfi_pay/models/refund_attributes.rb +228 -0
  143. data/lib/subfi_pay/models/refund_response.rb +268 -0
  144. data/lib/subfi_pay/models/roll_access_key_attributes.rb +212 -0
  145. data/lib/subfi_pay/models/roll_access_key_attributes_access_key.rb +219 -0
  146. data/lib/subfi_pay/models/roll_access_key_request.rb +212 -0
  147. data/lib/subfi_pay/models/roll_access_key_request_access_key.rb +219 -0
  148. data/lib/subfi_pay/models/subscription_attributes.rb +266 -0
  149. data/lib/subfi_pay/models/subscription_attributes_subscription.rb +266 -0
  150. data/lib/subfi_pay/models/subscription_create_request.rb +212 -0
  151. data/lib/subfi_pay/models/subscription_create_request_subscription.rb +266 -0
  152. data/lib/subfi_pay/models/subscription_response.rb +293 -0
  153. data/lib/subfi_pay/models/webhook_endpoint.rb +284 -0
  154. data/lib/subfi_pay/models/webhook_request.rb +302 -0
  155. data/lib/subfi_pay/version.rb +15 -0
  156. data/lib/subfi_pay.rb +99 -0
  157. data/run_fix_gemfile.sh +11 -0
  158. data/spec/api/access_keys_api_spec.rb +138 -0
  159. data/spec/api/accounts_api_spec.rb +145 -0
  160. data/spec/api/balance_transactions_api_spec.rb +86 -0
  161. data/spec/api/charges_api_spec.rb +121 -0
  162. data/spec/api/customers_api_spec.rb +134 -0
  163. data/spec/api/events_api_spec.rb +105 -0
  164. data/spec/api/payment_intents_api_spec.rb +250 -0
  165. data/spec/api/payment_methods_api_spec.rb +226 -0
  166. data/spec/api/refunds_api_spec.rb +158 -0
  167. data/spec/api/subscriptions_api_spec.rb +113 -0
  168. data/spec/api/webhook_endpoints_api_spec.rb +198 -0
  169. data/spec/api/webhook_requests_api_spec.rb +79 -0
  170. data/spec/configuration_spec.rb +23 -0
  171. data/spec/fixtures/access_keys/list_200.json +1 -0
  172. data/spec/fixtures/access_keys/roll_200.json +1 -0
  173. data/spec/fixtures/accounts/create_201.json +1 -0
  174. data/spec/fixtures/accounts/list_200.json +1 -0
  175. data/spec/fixtures/accounts/show_200.json +1 -0
  176. data/spec/fixtures/balance_transactions/list_200.json +69 -0
  177. data/spec/fixtures/charges/create_201.json +39 -0
  178. data/spec/fixtures/charges/list_200.json +1 -0
  179. data/spec/fixtures/charges/retrieve_200.json +1 -0
  180. data/spec/fixtures/customers/create_201.json +1 -0
  181. data/spec/fixtures/customers/list_200.json +1 -0
  182. data/spec/fixtures/customers/show_200.json +1 -0
  183. data/spec/fixtures/events/list_200.json +1 -0
  184. data/spec/fixtures/events/show_200.json +1 -0
  185. data/spec/fixtures/payment_intents/cancel_200.json +1 -0
  186. data/spec/fixtures/payment_intents/capture_200.json +1 -0
  187. data/spec/fixtures/payment_intents/confirm_200.json +1 -0
  188. data/spec/fixtures/payment_intents/create_201.json +1 -0
  189. data/spec/fixtures/payment_intents/fetch_200.json +1 -0
  190. data/spec/fixtures/payment_intents/list_200.json +1 -0
  191. data/spec/fixtures/payment_intents/update_200.json +1 -0
  192. data/spec/fixtures/payment_methods/create_bank_account_201.json +1 -0
  193. data/spec/fixtures/payment_methods/create_card_201.json +1 -0
  194. data/spec/fixtures/payment_methods/get_bank_account_200.json +29 -0
  195. data/spec/fixtures/payment_methods/get_card_200.json +1 -0
  196. data/spec/fixtures/payment_methods/list_200.json +1 -0
  197. data/spec/fixtures/refunds/create_201.json +1 -0
  198. data/spec/fixtures/refunds/list_200.json +1 -0
  199. data/spec/fixtures/refunds/show_200.json +1 -0
  200. data/spec/fixtures/subscriptions/create_201.json +1 -0
  201. data/spec/fixtures/subscriptions/show_200.json +1 -0
  202. data/spec/fixtures/webhook_endpoints/create_201.json +11 -0
  203. data/spec/fixtures/webhook_endpoints/list_200.json +1 -0
  204. data/spec/fixtures/webhook_endpoints/show_200.json +1 -0
  205. data/spec/fixtures/webhook_endpoints/update_200.json +13 -0
  206. data/spec/fixtures/webhook_requests/list_200.json +1 -0
  207. data/spec/models/access_key_spec.rb +39 -0
  208. data/spec/models/account_attributes_spec.rb +40 -0
  209. data/spec/models/account_create_request_spec.rb +38 -0
  210. data/spec/models/account_response_spec.rb +39 -0
  211. data/spec/models/balance_transaction_response_spec.rb +38 -0
  212. data/spec/models/bank_account_profile_spec.rb +38 -0
  213. data/spec/models/billing_address_spec.rb +38 -0
  214. data/spec/models/card_profile_spec.rb +38 -0
  215. data/spec/models/charge_attributes_spec.rb +45 -0
  216. data/spec/models/charge_response_spec.rb +45 -0
  217. data/spec/models/connected_account_attributes_spec.rb +38 -0
  218. data/spec/models/connected_account_response_spec.rb +39 -0
  219. data/spec/models/create_account_request_account_spec.rb +39 -0
  220. data/spec/models/create_account_request_spec.rb +39 -0
  221. data/spec/models/create_webhook_endpoint_request_spec.rb +38 -0
  222. data/spec/models/create_webhook_endpoint_request_webhook_endpoint_spec.rb +38 -0
  223. data/spec/models/customer_attributes_spec.rb +40 -0
  224. data/spec/models/customer_create_request_spec.rb +38 -0
  225. data/spec/models/customer_spec.rb +39 -0
  226. data/spec/models/customer_update_attributes_spec.rb +39 -0
  227. data/spec/models/customer_update_request_spec.rb +39 -0
  228. data/spec/models/event_spec.rb +39 -0
  229. data/spec/models/list_access_keys_response_spec.rb +38 -0
  230. data/spec/models/list_accounts_response_spec.rb +38 -0
  231. data/spec/models/list_balance_transactions_response_spec.rb +38 -0
  232. data/spec/models/list_charges_response_spec.rb +38 -0
  233. data/spec/models/list_customers_response_spec.rb +39 -0
  234. data/spec/models/list_events_response_spec.rb +38 -0
  235. data/spec/models/list_payment_intents_response_spec.rb +45 -0
  236. data/spec/models/list_payment_methods_response_spec.rb +39 -0
  237. data/spec/models/list_refunds_response_spec.rb +38 -0
  238. data/spec/models/list_webhook_endpoints_response_spec.rb +38 -0
  239. data/spec/models/list_webhook_requests_response_spec.rb +39 -0
  240. data/spec/models/meta_spec.rb +38 -0
  241. data/spec/models/payment_intent_attributes_spec.rb +44 -0
  242. data/spec/models/payment_intent_create_request_spec.rb +38 -0
  243. data/spec/models/payment_intent_response_spec.rb +45 -0
  244. data/spec/models/payment_intent_update_attributes_payment_intent_spec.rb +38 -0
  245. data/spec/models/payment_intent_update_attributes_spec.rb +37 -0
  246. data/spec/models/payment_method_attributes_spec.rb +38 -0
  247. data/spec/models/payment_method_response_spec.rb +38 -0
  248. data/spec/models/refund_attributes_spec.rb +39 -0
  249. data/spec/models/refund_response_spec.rb +38 -0
  250. data/spec/models/roll_access_key_attributes_access_key_spec.rb +39 -0
  251. data/spec/models/roll_access_key_attributes_spec.rb +40 -0
  252. data/spec/models/roll_access_key_request_access_key_spec.rb +38 -0
  253. data/spec/models/roll_access_key_request_spec.rb +37 -0
  254. data/spec/models/subscription_attributes_spec.rb +38 -0
  255. data/spec/models/subscription_create_request_spec.rb +40 -0
  256. data/spec/models/subscription_response_spec.rb +38 -0
  257. data/spec/models/webhook_endpoint_spec.rb +40 -0
  258. data/spec/models/webhook_request_spec.rb +40 -0
  259. data/spec/spec_helper.rb +123 -0
  260. data/subfi_pay.gemspec +39 -0
  261. metadata +444 -0
@@ -0,0 +1,100 @@
1
+ =begin
2
+ #SubFi Pay API
3
+
4
+ #API for SubFi Pay services
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.7.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module SubFiPay
16
+ class BalanceTransactionsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # List all balance transactions
23
+ # @param x_api_version [String]
24
+ # @param x_account_id [String]
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [Integer] :page The page of results to retrieve.
27
+ # @option opts [Integer] :per_page Number of results per page.
28
+ # @option opts [String] :connected_account_id Filter results by sub_merchant ID.
29
+ # @return [ListBalanceTransactionsResponse]
30
+ def list_balance_transactions(x_api_version, x_account_id, opts = {})
31
+ data, _status_code, _headers = list_balance_transactions_with_http_info(x_api_version, x_account_id, opts)
32
+ data
33
+ end
34
+
35
+ # List all balance transactions
36
+ # @param x_api_version [String]
37
+ # @param x_account_id [String]
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [Integer] :page The page of results to retrieve.
40
+ # @option opts [Integer] :per_page Number of results per page.
41
+ # @option opts [String] :connected_account_id Filter results by sub_merchant ID.
42
+ # @return [Array<(ListBalanceTransactionsResponse, Integer, Hash)>] ListBalanceTransactionsResponse data, response status code and response headers
43
+ def list_balance_transactions_with_http_info(x_api_version, x_account_id, opts = {})
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug 'Calling API: BalanceTransactionsApi.list_balance_transactions ...'
46
+ end
47
+ # verify the required parameter 'x_api_version' is set
48
+ if @api_client.config.client_side_validation && x_api_version.nil?
49
+ fail ArgumentError, "Missing the required parameter 'x_api_version' when calling BalanceTransactionsApi.list_balance_transactions"
50
+ end
51
+ # verify the required parameter 'x_account_id' is set
52
+ if @api_client.config.client_side_validation && x_account_id.nil?
53
+ fail ArgumentError, "Missing the required parameter 'x_account_id' when calling BalanceTransactionsApi.list_balance_transactions"
54
+ end
55
+ # resource path
56
+ local_var_path = '/balance_transactions'
57
+
58
+ # query parameters
59
+ query_params = opts[:query_params] || {}
60
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
61
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
62
+ query_params[:'connected_account_id'] = opts[:'connected_account_id'] if !opts[:'connected_account_id'].nil?
63
+
64
+ # header parameters
65
+ header_params = opts[:header_params] || {}
66
+ # HTTP header 'Accept' (if needed)
67
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
68
+ header_params[:'X-Api-Version'] = x_api_version
69
+ header_params[:'X-Account-Id'] = x_account_id
70
+
71
+ # form parameters
72
+ form_params = opts[:form_params] || {}
73
+
74
+ # http body (model)
75
+ post_body = opts[:debug_body]
76
+
77
+ # return_type
78
+ return_type = opts[:debug_return_type] || 'ListBalanceTransactionsResponse'
79
+
80
+ # auth_names
81
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
82
+
83
+ new_options = opts.merge(
84
+ :operation => :"BalanceTransactionsApi.list_balance_transactions",
85
+ :header_params => header_params,
86
+ :query_params => query_params,
87
+ :form_params => form_params,
88
+ :body => post_body,
89
+ :auth_names => auth_names,
90
+ :return_type => return_type
91
+ )
92
+
93
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
94
+ if @api_client.config.debugging
95
+ @api_client.config.logger.debug "API called: BalanceTransactionsApi#list_balance_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
96
+ end
97
+ return data, status_code, headers
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,181 @@
1
+ =begin
2
+ #SubFi Pay API
3
+
4
+ #API for SubFi Pay services
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.7.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module SubFiPay
16
+ class ChargesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Retrieve a charge
23
+ # @param x_api_version [String]
24
+ # @param x_account_id [String]
25
+ # @param id [String]
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [String] :connected_account_id Filter results by sub_merchant ID.
28
+ # @return [ChargeResponse]
29
+ def get_charge(x_api_version, x_account_id, id, opts = {})
30
+ data, _status_code, _headers = get_charge_with_http_info(x_api_version, x_account_id, id, opts)
31
+ data
32
+ end
33
+
34
+ # Retrieve a charge
35
+ # @param x_api_version [String]
36
+ # @param x_account_id [String]
37
+ # @param id [String]
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [String] :connected_account_id Filter results by sub_merchant ID.
40
+ # @return [Array<(ChargeResponse, Integer, Hash)>] ChargeResponse data, response status code and response headers
41
+ def get_charge_with_http_info(x_api_version, x_account_id, id, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: ChargesApi.get_charge ...'
44
+ end
45
+ # verify the required parameter 'x_api_version' is set
46
+ if @api_client.config.client_side_validation && x_api_version.nil?
47
+ fail ArgumentError, "Missing the required parameter 'x_api_version' when calling ChargesApi.get_charge"
48
+ end
49
+ # verify the required parameter 'x_account_id' is set
50
+ if @api_client.config.client_side_validation && x_account_id.nil?
51
+ fail ArgumentError, "Missing the required parameter 'x_account_id' when calling ChargesApi.get_charge"
52
+ end
53
+ # verify the required parameter 'id' is set
54
+ if @api_client.config.client_side_validation && id.nil?
55
+ fail ArgumentError, "Missing the required parameter 'id' when calling ChargesApi.get_charge"
56
+ end
57
+ # resource path
58
+ local_var_path = '/charges/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
59
+
60
+ # query parameters
61
+ query_params = opts[:query_params] || {}
62
+ query_params[:'connected_account_id'] = opts[:'connected_account_id'] if !opts[:'connected_account_id'].nil?
63
+
64
+ # header parameters
65
+ header_params = opts[:header_params] || {}
66
+ # HTTP header 'Accept' (if needed)
67
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
68
+ header_params[:'X-Api-Version'] = x_api_version
69
+ header_params[:'X-Account-Id'] = x_account_id
70
+
71
+ # form parameters
72
+ form_params = opts[:form_params] || {}
73
+
74
+ # http body (model)
75
+ post_body = opts[:debug_body]
76
+
77
+ # return_type
78
+ return_type = opts[:debug_return_type] || 'ChargeResponse'
79
+
80
+ # auth_names
81
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
82
+
83
+ new_options = opts.merge(
84
+ :operation => :"ChargesApi.get_charge",
85
+ :header_params => header_params,
86
+ :query_params => query_params,
87
+ :form_params => form_params,
88
+ :body => post_body,
89
+ :auth_names => auth_names,
90
+ :return_type => return_type
91
+ )
92
+
93
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
94
+ if @api_client.config.debugging
95
+ @api_client.config.logger.debug "API called: ChargesApi#get_charge\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
96
+ end
97
+ return data, status_code, headers
98
+ end
99
+
100
+ # List all charges
101
+ # @param x_api_version [String]
102
+ # @param x_account_id [String]
103
+ # @param [Hash] opts the optional parameters
104
+ # @option opts [Integer] :page The page of results to retrieve.
105
+ # @option opts [Integer] :per_page Number of results per page.
106
+ # @option opts [String] :connected_account_id Filter results by sub_merchant ID.
107
+ # @option opts [String] :payment_intent_id Filter results by payment intent ID.
108
+ # @return [ListChargesResponse]
109
+ def list_charges(x_api_version, x_account_id, opts = {})
110
+ data, _status_code, _headers = list_charges_with_http_info(x_api_version, x_account_id, opts)
111
+ data
112
+ end
113
+
114
+ # List all charges
115
+ # @param x_api_version [String]
116
+ # @param x_account_id [String]
117
+ # @param [Hash] opts the optional parameters
118
+ # @option opts [Integer] :page The page of results to retrieve.
119
+ # @option opts [Integer] :per_page Number of results per page.
120
+ # @option opts [String] :connected_account_id Filter results by sub_merchant ID.
121
+ # @option opts [String] :payment_intent_id Filter results by payment intent ID.
122
+ # @return [Array<(ListChargesResponse, Integer, Hash)>] ListChargesResponse data, response status code and response headers
123
+ def list_charges_with_http_info(x_api_version, x_account_id, opts = {})
124
+ if @api_client.config.debugging
125
+ @api_client.config.logger.debug 'Calling API: ChargesApi.list_charges ...'
126
+ end
127
+ # verify the required parameter 'x_api_version' is set
128
+ if @api_client.config.client_side_validation && x_api_version.nil?
129
+ fail ArgumentError, "Missing the required parameter 'x_api_version' when calling ChargesApi.list_charges"
130
+ end
131
+ # verify the required parameter 'x_account_id' is set
132
+ if @api_client.config.client_side_validation && x_account_id.nil?
133
+ fail ArgumentError, "Missing the required parameter 'x_account_id' when calling ChargesApi.list_charges"
134
+ end
135
+ # resource path
136
+ local_var_path = '/charges'
137
+
138
+ # query parameters
139
+ query_params = opts[:query_params] || {}
140
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
141
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
142
+ query_params[:'connected_account_id'] = opts[:'connected_account_id'] if !opts[:'connected_account_id'].nil?
143
+ query_params[:'payment_intent_id'] = opts[:'payment_intent_id'] if !opts[:'payment_intent_id'].nil?
144
+
145
+ # header parameters
146
+ header_params = opts[:header_params] || {}
147
+ # HTTP header 'Accept' (if needed)
148
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
149
+ header_params[:'X-Api-Version'] = x_api_version
150
+ header_params[:'X-Account-Id'] = x_account_id
151
+
152
+ # form parameters
153
+ form_params = opts[:form_params] || {}
154
+
155
+ # http body (model)
156
+ post_body = opts[:debug_body]
157
+
158
+ # return_type
159
+ return_type = opts[:debug_return_type] || 'ListChargesResponse'
160
+
161
+ # auth_names
162
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
163
+
164
+ new_options = opts.merge(
165
+ :operation => :"ChargesApi.list_charges",
166
+ :header_params => header_params,
167
+ :query_params => query_params,
168
+ :form_params => form_params,
169
+ :body => post_body,
170
+ :auth_names => auth_names,
171
+ :return_type => return_type
172
+ )
173
+
174
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
175
+ if @api_client.config.debugging
176
+ @api_client.config.logger.debug "API called: ChargesApi#list_charges\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
177
+ end
178
+ return data, status_code, headers
179
+ end
180
+ end
181
+ end
@@ -0,0 +1,331 @@
1
+ =begin
2
+ #SubFi Pay API
3
+
4
+ #API for SubFi Pay services
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.7.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module SubFiPay
16
+ class CustomersApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create a new customer
23
+ # @param x_api_version [String]
24
+ # @param customer_create_request [CustomerCreateRequest]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [Customer]
27
+ def create_customer(x_api_version, customer_create_request, opts = {})
28
+ data, _status_code, _headers = create_customer_with_http_info(x_api_version, customer_create_request, opts)
29
+ data
30
+ end
31
+
32
+ # Create a new customer
33
+ # @param x_api_version [String]
34
+ # @param customer_create_request [CustomerCreateRequest]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(Customer, Integer, Hash)>] Customer data, response status code and response headers
37
+ def create_customer_with_http_info(x_api_version, customer_create_request, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: CustomersApi.create_customer ...'
40
+ end
41
+ # verify the required parameter 'x_api_version' is set
42
+ if @api_client.config.client_side_validation && x_api_version.nil?
43
+ fail ArgumentError, "Missing the required parameter 'x_api_version' when calling CustomersApi.create_customer"
44
+ end
45
+ # verify the required parameter 'customer_create_request' is set
46
+ if @api_client.config.client_side_validation && customer_create_request.nil?
47
+ fail ArgumentError, "Missing the required parameter 'customer_create_request' when calling CustomersApi.create_customer"
48
+ end
49
+ # resource path
50
+ local_var_path = '/customers'
51
+
52
+ # query parameters
53
+ query_params = opts[:query_params] || {}
54
+
55
+ # header parameters
56
+ header_params = opts[:header_params] || {}
57
+ # HTTP header 'Accept' (if needed)
58
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
59
+ # HTTP header 'Content-Type'
60
+ content_type = @api_client.select_header_content_type(['application/json'])
61
+ if !content_type.nil?
62
+ header_params['Content-Type'] = content_type
63
+ end
64
+ header_params[:'X-Api-Version'] = x_api_version
65
+
66
+ # form parameters
67
+ form_params = opts[:form_params] || {}
68
+
69
+ # http body (model)
70
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(customer_create_request)
71
+
72
+ # return_type
73
+ return_type = opts[:debug_return_type] || 'Customer'
74
+
75
+ # auth_names
76
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
77
+
78
+ new_options = opts.merge(
79
+ :operation => :"CustomersApi.create_customer",
80
+ :header_params => header_params,
81
+ :query_params => query_params,
82
+ :form_params => form_params,
83
+ :body => post_body,
84
+ :auth_names => auth_names,
85
+ :return_type => return_type
86
+ )
87
+
88
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
89
+ if @api_client.config.debugging
90
+ @api_client.config.logger.debug "API called: CustomersApi#create_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
91
+ end
92
+ return data, status_code, headers
93
+ end
94
+
95
+ # Retrieve a customer by ID
96
+ # @param x_api_version [String]
97
+ # @param x_account_id [String]
98
+ # @param id [String]
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [Customer]
101
+ def get_customer(x_api_version, x_account_id, id, opts = {})
102
+ data, _status_code, _headers = get_customer_with_http_info(x_api_version, x_account_id, id, opts)
103
+ data
104
+ end
105
+
106
+ # Retrieve a customer by ID
107
+ # @param x_api_version [String]
108
+ # @param x_account_id [String]
109
+ # @param id [String]
110
+ # @param [Hash] opts the optional parameters
111
+ # @return [Array<(Customer, Integer, Hash)>] Customer data, response status code and response headers
112
+ def get_customer_with_http_info(x_api_version, x_account_id, id, opts = {})
113
+ if @api_client.config.debugging
114
+ @api_client.config.logger.debug 'Calling API: CustomersApi.get_customer ...'
115
+ end
116
+ # verify the required parameter 'x_api_version' is set
117
+ if @api_client.config.client_side_validation && x_api_version.nil?
118
+ fail ArgumentError, "Missing the required parameter 'x_api_version' when calling CustomersApi.get_customer"
119
+ end
120
+ # verify the required parameter 'x_account_id' is set
121
+ if @api_client.config.client_side_validation && x_account_id.nil?
122
+ fail ArgumentError, "Missing the required parameter 'x_account_id' when calling CustomersApi.get_customer"
123
+ end
124
+ # verify the required parameter 'id' is set
125
+ if @api_client.config.client_side_validation && id.nil?
126
+ fail ArgumentError, "Missing the required parameter 'id' when calling CustomersApi.get_customer"
127
+ end
128
+ # resource path
129
+ local_var_path = '/customers/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
130
+
131
+ # query parameters
132
+ query_params = opts[:query_params] || {}
133
+
134
+ # header parameters
135
+ header_params = opts[:header_params] || {}
136
+ # HTTP header 'Accept' (if needed)
137
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
138
+ header_params[:'X-Api-Version'] = x_api_version
139
+ header_params[:'X-Account-Id'] = x_account_id
140
+
141
+ # form parameters
142
+ form_params = opts[:form_params] || {}
143
+
144
+ # http body (model)
145
+ post_body = opts[:debug_body]
146
+
147
+ # return_type
148
+ return_type = opts[:debug_return_type] || 'Customer'
149
+
150
+ # auth_names
151
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
152
+
153
+ new_options = opts.merge(
154
+ :operation => :"CustomersApi.get_customer",
155
+ :header_params => header_params,
156
+ :query_params => query_params,
157
+ :form_params => form_params,
158
+ :body => post_body,
159
+ :auth_names => auth_names,
160
+ :return_type => return_type
161
+ )
162
+
163
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
164
+ if @api_client.config.debugging
165
+ @api_client.config.logger.debug "API called: CustomersApi#get_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
166
+ end
167
+ return data, status_code, headers
168
+ end
169
+
170
+ # List all customers
171
+ # @param x_api_version [String]
172
+ # @param x_account_id [String]
173
+ # @param [Hash] opts the optional parameters
174
+ # @option opts [Integer] :page The page of results to retrieve.
175
+ # @option opts [Integer] :per_page Number of results per page.
176
+ # @return [ListCustomersResponse]
177
+ def list_customers(x_api_version, x_account_id, opts = {})
178
+ data, _status_code, _headers = list_customers_with_http_info(x_api_version, x_account_id, opts)
179
+ data
180
+ end
181
+
182
+ # List all customers
183
+ # @param x_api_version [String]
184
+ # @param x_account_id [String]
185
+ # @param [Hash] opts the optional parameters
186
+ # @option opts [Integer] :page The page of results to retrieve.
187
+ # @option opts [Integer] :per_page Number of results per page.
188
+ # @return [Array<(ListCustomersResponse, Integer, Hash)>] ListCustomersResponse data, response status code and response headers
189
+ def list_customers_with_http_info(x_api_version, x_account_id, opts = {})
190
+ if @api_client.config.debugging
191
+ @api_client.config.logger.debug 'Calling API: CustomersApi.list_customers ...'
192
+ end
193
+ # verify the required parameter 'x_api_version' is set
194
+ if @api_client.config.client_side_validation && x_api_version.nil?
195
+ fail ArgumentError, "Missing the required parameter 'x_api_version' when calling CustomersApi.list_customers"
196
+ end
197
+ # verify the required parameter 'x_account_id' is set
198
+ if @api_client.config.client_side_validation && x_account_id.nil?
199
+ fail ArgumentError, "Missing the required parameter 'x_account_id' when calling CustomersApi.list_customers"
200
+ end
201
+ # resource path
202
+ local_var_path = '/customers'
203
+
204
+ # query parameters
205
+ query_params = opts[:query_params] || {}
206
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
207
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
208
+
209
+ # header parameters
210
+ header_params = opts[:header_params] || {}
211
+ # HTTP header 'Accept' (if needed)
212
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
213
+ header_params[:'X-Api-Version'] = x_api_version
214
+ header_params[:'X-Account-Id'] = x_account_id
215
+
216
+ # form parameters
217
+ form_params = opts[:form_params] || {}
218
+
219
+ # http body (model)
220
+ post_body = opts[:debug_body]
221
+
222
+ # return_type
223
+ return_type = opts[:debug_return_type] || 'ListCustomersResponse'
224
+
225
+ # auth_names
226
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
227
+
228
+ new_options = opts.merge(
229
+ :operation => :"CustomersApi.list_customers",
230
+ :header_params => header_params,
231
+ :query_params => query_params,
232
+ :form_params => form_params,
233
+ :body => post_body,
234
+ :auth_names => auth_names,
235
+ :return_type => return_type
236
+ )
237
+
238
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
239
+ if @api_client.config.debugging
240
+ @api_client.config.logger.debug "API called: CustomersApi#list_customers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
241
+ end
242
+ return data, status_code, headers
243
+ end
244
+
245
+ # Update a customer by ID
246
+ # @param x_api_version [String]
247
+ # @param x_account_id [String]
248
+ # @param id [String]
249
+ # @param customer_update_request [CustomerUpdateRequest]
250
+ # @param [Hash] opts the optional parameters
251
+ # @return [Customer]
252
+ def update_customer(x_api_version, x_account_id, id, customer_update_request, opts = {})
253
+ data, _status_code, _headers = update_customer_with_http_info(x_api_version, x_account_id, id, customer_update_request, opts)
254
+ data
255
+ end
256
+
257
+ # Update a customer by ID
258
+ # @param x_api_version [String]
259
+ # @param x_account_id [String]
260
+ # @param id [String]
261
+ # @param customer_update_request [CustomerUpdateRequest]
262
+ # @param [Hash] opts the optional parameters
263
+ # @return [Array<(Customer, Integer, Hash)>] Customer data, response status code and response headers
264
+ def update_customer_with_http_info(x_api_version, x_account_id, id, customer_update_request, opts = {})
265
+ if @api_client.config.debugging
266
+ @api_client.config.logger.debug 'Calling API: CustomersApi.update_customer ...'
267
+ end
268
+ # verify the required parameter 'x_api_version' is set
269
+ if @api_client.config.client_side_validation && x_api_version.nil?
270
+ fail ArgumentError, "Missing the required parameter 'x_api_version' when calling CustomersApi.update_customer"
271
+ end
272
+ # verify the required parameter 'x_account_id' is set
273
+ if @api_client.config.client_side_validation && x_account_id.nil?
274
+ fail ArgumentError, "Missing the required parameter 'x_account_id' when calling CustomersApi.update_customer"
275
+ end
276
+ # verify the required parameter 'id' is set
277
+ if @api_client.config.client_side_validation && id.nil?
278
+ fail ArgumentError, "Missing the required parameter 'id' when calling CustomersApi.update_customer"
279
+ end
280
+ # verify the required parameter 'customer_update_request' is set
281
+ if @api_client.config.client_side_validation && customer_update_request.nil?
282
+ fail ArgumentError, "Missing the required parameter 'customer_update_request' when calling CustomersApi.update_customer"
283
+ end
284
+ # resource path
285
+ local_var_path = '/customers/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
286
+
287
+ # query parameters
288
+ query_params = opts[:query_params] || {}
289
+
290
+ # header parameters
291
+ header_params = opts[:header_params] || {}
292
+ # HTTP header 'Accept' (if needed)
293
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
294
+ # HTTP header 'Content-Type'
295
+ content_type = @api_client.select_header_content_type(['application/json'])
296
+ if !content_type.nil?
297
+ header_params['Content-Type'] = content_type
298
+ end
299
+ header_params[:'X-Api-Version'] = x_api_version
300
+ header_params[:'X-Account-Id'] = x_account_id
301
+
302
+ # form parameters
303
+ form_params = opts[:form_params] || {}
304
+
305
+ # http body (model)
306
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(customer_update_request)
307
+
308
+ # return_type
309
+ return_type = opts[:debug_return_type] || 'Customer'
310
+
311
+ # auth_names
312
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
313
+
314
+ new_options = opts.merge(
315
+ :operation => :"CustomersApi.update_customer",
316
+ :header_params => header_params,
317
+ :query_params => query_params,
318
+ :form_params => form_params,
319
+ :body => post_body,
320
+ :auth_names => auth_names,
321
+ :return_type => return_type
322
+ )
323
+
324
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
325
+ if @api_client.config.debugging
326
+ @api_client.config.logger.debug "API called: CustomersApi#update_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
327
+ end
328
+ return data, status_code, headers
329
+ end
330
+ end
331
+ end