masspay_ruby_sdk 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/CODE_OF_CONDUCT.md +43 -0
  4. data/CONTRIBUTING.md +48 -9
  5. data/LICENSE.md +21 -0
  6. data/README.md +141 -176
  7. data/assets/logo.webp +0 -0
  8. data/lib/masspay_ruby_sdk/api/account_service.rb +35 -0
  9. data/lib/masspay_ruby_sdk/api/attribute_service.rb +41 -0
  10. data/lib/masspay_ruby_sdk/api/card_service.rb +35 -0
  11. data/lib/masspay_ruby_sdk/api/catalog_service.rb +74 -0
  12. data/lib/masspay_ruby_sdk/api/kyc_service.rb +56 -0
  13. data/lib/masspay_ruby_sdk/api/load_service.rb +62 -0
  14. data/lib/masspay_ruby_sdk/api/payout_service.rb +61 -0
  15. data/lib/masspay_ruby_sdk/api/spend_back_service.rb +35 -0
  16. data/lib/masspay_ruby_sdk/api/subaccount_service.rb +47 -0
  17. data/lib/masspay_ruby_sdk/api/tax_service.rb +38 -0
  18. data/lib/masspay_ruby_sdk/api/user_service.rb +71 -0
  19. data/lib/masspay_ruby_sdk/api/wallet_service.rb +50 -0
  20. data/lib/masspay_ruby_sdk/client.rb +93 -0
  21. data/lib/masspay_ruby_sdk/constants.rb +20 -0
  22. data/lib/masspay_ruby_sdk/version.rb +6 -8
  23. data/lib/masspay_ruby_sdk.rb +23 -75
  24. data/masspay_ruby_sdk.gemspec +9 -13
  25. metadata +24 -120
  26. data/Rakefile +0 -10
  27. data/docs/AccountApi.md +0 -150
  28. data/docs/ApiResponse.md +0 -22
  29. data/docs/AttrTxn.md +0 -20
  30. data/docs/AttrValue.md +0 -20
  31. data/docs/AttrVelocityRequestInner.md +0 -20
  32. data/docs/AttributeApi.md +0 -168
  33. data/docs/AttrsRequirement.md +0 -36
  34. data/docs/AutopayResp.md +0 -22
  35. data/docs/AutopayRule.md +0 -20
  36. data/docs/AvailableBalanceTxnResp.md +0 -22
  37. data/docs/CardApi.md +0 -160
  38. data/docs/CatalogApi.md +0 -469
  39. data/docs/CompaniesResp.md +0 -18
  40. data/docs/Company.md +0 -26
  41. data/docs/Country.md +0 -22
  42. data/docs/Exception.md +0 -20
  43. data/docs/FoundUser.md +0 -24
  44. data/docs/GetAccountStatement200Response.md +0 -18
  45. data/docs/GetTransactionConfirmationDetails200Response.md +0 -18
  46. data/docs/GetUserAgreement200Response.md +0 -26
  47. data/docs/GetUserAgreementsNames200ResponseInner.md +0 -24
  48. data/docs/GetUserUserTokenKycAu10tix200Response.md +0 -18
  49. data/docs/GetUserUserTokenKycVeriff200Response.md +0 -18
  50. data/docs/GetWalletCardInfo200Response.md +0 -30
  51. data/docs/IDUpload.md +0 -20
  52. data/docs/KYCApi.md +0 -305
  53. data/docs/LoadApi.md +0 -621
  54. data/docs/LoadTxn.md +0 -32
  55. data/docs/LoadTxnResp.md +0 -20
  56. data/docs/Loads.md +0 -36
  57. data/docs/PayoutApi.md +0 -403
  58. data/docs/PayoutTxn.md +0 -36
  59. data/docs/PayoutTxnCommitResp.md +0 -24
  60. data/docs/PayoutTxnResp.md +0 -60
  61. data/docs/ResendBalanceNotification200Response.md +0 -18
  62. data/docs/Service.md +0 -22
  63. data/docs/ServicePayersInner.md +0 -38
  64. data/docs/ServicePayersInnerExchangeRateInner.md +0 -20
  65. data/docs/SpendBackApi.md +0 -161
  66. data/docs/SpendBackTxn.md +0 -28
  67. data/docs/SpendBackTxnResp.md +0 -22
  68. data/docs/SpendBacks.md +0 -34
  69. data/docs/StoredUser.md +0 -56
  70. data/docs/TaxApi.md +0 -81
  71. data/docs/TaxYearUserResp.md +0 -48
  72. data/docs/TxnHistoryResp.md +0 -52
  73. data/docs/UpdateUser.md +0 -52
  74. data/docs/User.md +0 -50
  75. data/docs/UserApi.md +0 -403
  76. data/docs/WalletApi.md +0 -463
  77. data/docs/WalletTxnResp.md +0 -34
  78. data/docs/logo.webp +0 -0
  79. data/lib/masspay_ruby_sdk/api/account_api.rb +0 -149
  80. data/lib/masspay_ruby_sdk/api/attribute_api.rb +0 -214
  81. data/lib/masspay_ruby_sdk/api/card_api.rb +0 -174
  82. data/lib/masspay_ruby_sdk/api/catalog_api.rb +0 -443
  83. data/lib/masspay_ruby_sdk/api/kyc_api.rb +0 -290
  84. data/lib/masspay_ruby_sdk/api/load_api.rb +0 -598
  85. data/lib/masspay_ruby_sdk/api/payout_api.rb +0 -397
  86. data/lib/masspay_ruby_sdk/api/spend_back_api.rb +0 -160
  87. data/lib/masspay_ruby_sdk/api/tax_api.rb +0 -82
  88. data/lib/masspay_ruby_sdk/api/user_api.rb +0 -418
  89. data/lib/masspay_ruby_sdk/api/wallet_api.rb +0 -461
  90. data/lib/masspay_ruby_sdk/api_client.rb +0 -391
  91. data/lib/masspay_ruby_sdk/api_error.rb +0 -57
  92. data/lib/masspay_ruby_sdk/configuration.rb +0 -315
  93. data/lib/masspay_ruby_sdk/models/api_response.rb +0 -236
  94. data/lib/masspay_ruby_sdk/models/attr_txn.rb +0 -235
  95. data/lib/masspay_ruby_sdk/models/attr_value.rb +0 -239
  96. data/lib/masspay_ruby_sdk/models/attr_velocity_request_inner.rb +0 -273
  97. data/lib/masspay_ruby_sdk/models/attrs_requirement.rb +0 -372
  98. data/lib/masspay_ruby_sdk/models/autopay_resp.rb +0 -256
  99. data/lib/masspay_ruby_sdk/models/autopay_rule.rb +0 -241
  100. data/lib/masspay_ruby_sdk/models/available_balance_txn_resp.rb +0 -254
  101. data/lib/masspay_ruby_sdk/models/companies_resp.rb +0 -225
  102. data/lib/masspay_ruby_sdk/models/company.rb +0 -285
  103. data/lib/masspay_ruby_sdk/models/country.rb +0 -296
  104. data/lib/masspay_ruby_sdk/models/exception.rb +0 -241
  105. data/lib/masspay_ruby_sdk/models/found_user.rb +0 -270
  106. data/lib/masspay_ruby_sdk/models/get_account_statement200_response.rb +0 -225
  107. data/lib/masspay_ruby_sdk/models/get_transaction_confirmation_details200_response.rb +0 -218
  108. data/lib/masspay_ruby_sdk/models/get_user_agreement200_response.rb +0 -280
  109. data/lib/masspay_ruby_sdk/models/get_user_agreements_names200_response_inner.rb +0 -270
  110. data/lib/masspay_ruby_sdk/models/get_user_user_token_kyc_au10tix200_response.rb +0 -224
  111. data/lib/masspay_ruby_sdk/models/get_user_user_token_kyc_veriff200_response.rb +0 -224
  112. data/lib/masspay_ruby_sdk/models/get_wallet_card_info200_response.rb +0 -460
  113. data/lib/masspay_ruby_sdk/models/id_upload.rb +0 -273
  114. data/lib/masspay_ruby_sdk/models/load_txn.rb +0 -321
  115. data/lib/masspay_ruby_sdk/models/load_txn_resp.rb +0 -273
  116. data/lib/masspay_ruby_sdk/models/loads.rb +0 -388
  117. data/lib/masspay_ruby_sdk/models/payout_txn.rb +0 -328
  118. data/lib/masspay_ruby_sdk/models/payout_txn_commit_resp.rb +0 -293
  119. data/lib/masspay_ruby_sdk/models/payout_txn_resp.rb +0 -613
  120. data/lib/masspay_ruby_sdk/models/resend_balance_notification200_response.rb +0 -225
  121. data/lib/masspay_ruby_sdk/models/service.rb +0 -318
  122. data/lib/masspay_ruby_sdk/models/service_payers_inner.rb +0 -373
  123. data/lib/masspay_ruby_sdk/models/service_payers_inner_exchange_rate_inner.rb +0 -239
  124. data/lib/masspay_ruby_sdk/models/spend_back_txn.rb +0 -325
  125. data/lib/masspay_ruby_sdk/models/spend_back_txn_resp.rb +0 -307
  126. data/lib/masspay_ruby_sdk/models/spend_backs.rb +0 -340
  127. data/lib/masspay_ruby_sdk/models/stored_user.rb +0 -500
  128. data/lib/masspay_ruby_sdk/models/tax_year_user_resp.rb +0 -388
  129. data/lib/masspay_ruby_sdk/models/txn_history_resp.rb +0 -571
  130. data/lib/masspay_ruby_sdk/models/update_user.rb +0 -490
  131. data/lib/masspay_ruby_sdk/models/user.rb +0 -423
  132. data/lib/masspay_ruby_sdk/models/wallet_txn_resp.rb +0 -375
  133. data/spec/api_client_spec.rb +0 -227
  134. data/spec/configuration_spec.rb +0 -41
  135. data/spec/spec_helper.rb +0 -110
@@ -1,397 +0,0 @@
1
- =begin
2
- #MassPay API
3
-
4
- #MassPay API
5
-
6
- The version of the OpenAPI document: 0.1.4
7
- Contact: support@masspay.io
8
- Generated by: MassPay Inc.
9
- OpenAPI Generator version: 6.5.0
10
- =end
11
-
12
- require 'cgi'
13
-
14
- module MassPayRubySdk
15
- class PayoutApi
16
- attr_accessor :api_client
17
-
18
- def initialize(api_client = ApiClient.default)
19
- @api_client = api_client
20
- end
21
- # Commit payout transaction
22
- # This **PUT** endpoint is used to commit a previously created payout transaction. <br> Once a payout transaction is created, you can use this endpoint to commit the transaction and initiate the actual payout. <br> To use this endpoint, you need to provide the `user_token` and `payout_token` of the payout transaction you want to commit in the URL Path. <br> The response will include a JSON object containing details about the committed payout transaction, including the `payout_token`, `payout_status`, `pickup_code` and possible errors.
23
- # @param user_token [String] Token representing the user to pay out
24
- # @param payout_token [String] Token representing the trsanaction. Retrieved from &#x60;/payout/{user_token}&#x60;
25
- # @param [Hash] opts the optional parameters
26
- # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
27
- # @return [PayoutTxnCommitResp]
28
- def commit_payout_txn(user_token, payout_token, opts = {})
29
- data, _status_code, _headers = commit_payout_txn_with_http_info(user_token, payout_token, opts)
30
- data
31
- end
32
-
33
- # Commit payout transaction
34
- # This **PUT** endpoint is used to commit a previously created payout transaction. &lt;br&gt; Once a payout transaction is created, you can use this endpoint to commit the transaction and initiate the actual payout. &lt;br&gt; To use this endpoint, you need to provide the &#x60;user_token&#x60; and &#x60;payout_token&#x60; of the payout transaction you want to commit in the URL Path. &lt;br&gt; The response will include a JSON object containing details about the committed payout transaction, including the &#x60;payout_token&#x60;, &#x60;payout_status&#x60;, &#x60;pickup_code&#x60; and possible errors.
35
- # @param user_token [String] Token representing the user to pay out
36
- # @param payout_token [String] Token representing the trsanaction. Retrieved from &#x60;/payout/{user_token}&#x60;
37
- # @param [Hash] opts the optional parameters
38
- # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
39
- # @return [Array<(PayoutTxnCommitResp, Integer, Hash)>] PayoutTxnCommitResp data, response status code and response headers
40
- def commit_payout_txn_with_http_info(user_token, payout_token, opts = {})
41
- if @api_client.config.debugging
42
- @api_client.config.logger.debug 'Calling API: PayoutApi.commit_payout_txn ...'
43
- end
44
- # verify the required parameter 'user_token' is set
45
- if @api_client.config.client_side_validation && user_token.nil?
46
- fail ArgumentError, "Missing the required parameter 'user_token' when calling PayoutApi.commit_payout_txn"
47
- end
48
- # verify the required parameter 'payout_token' is set
49
- if @api_client.config.client_side_validation && payout_token.nil?
50
- fail ArgumentError, "Missing the required parameter 'payout_token' when calling PayoutApi.commit_payout_txn"
51
- end
52
- # resource path
53
- local_var_path = '/payout/{user_token}/{payout_token}'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s)).sub('{' + 'payout_token' + '}', CGI.escape(payout_token.to_s))
54
-
55
- # query parameters
56
- query_params = opts[:query_params] || {}
57
-
58
- # header parameters
59
- header_params = opts[:header_params] || {}
60
- # HTTP header 'Accept' (if needed)
61
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
62
- header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
63
-
64
- # form parameters
65
- form_params = opts[:form_params] || {}
66
-
67
- # http body (model)
68
- post_body = opts[:debug_body]
69
-
70
- # return_type
71
- return_type = opts[:debug_return_type] || 'PayoutTxnCommitResp'
72
-
73
- # auth_names
74
- auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
75
-
76
- new_options = opts.merge(
77
- :operation => :"PayoutApi.commit_payout_txn",
78
- :header_params => header_params,
79
- :query_params => query_params,
80
- :form_params => form_params,
81
- :body => post_body,
82
- :auth_names => auth_names,
83
- :return_type => return_type
84
- )
85
-
86
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
87
- if @api_client.config.debugging
88
- @api_client.config.logger.debug "API called: PayoutApi#commit_payout_txn\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
- end
90
- return data, status_code, headers
91
- end
92
-
93
- # Get status of a payout by payout token
94
- # This **GET** endpoint is used to retrieve the status of a payout transaction for a user with the specified token and payout token. <br> You can use this endpoint to check the status of a specific payout transaction, including whether the payout has been successfully processed or if there was an error. <br> To use this endpoint, you need to provide the `user_token` and `payout_token` in the URL Path. <br> The response will include a JSON object containing details about the payout transaction.
95
- # @param user_token [String] Token representing the user to pay out
96
- # @param payout_token [String] Token representing the trsanaction. Retrieved from &#x60;/payout/{user_token}&#x60;
97
- # @param [Hash] opts the optional parameters
98
- # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
99
- # @option opts [Boolean] :force_status_update Attempts to get an updated status update from the payout destination (default to false)
100
- # @option opts [Boolean] :include_payer_logo Whether to include the payer logo in base64 format.
101
- # @return [PayoutTxnResp]
102
- def get_payout_status(user_token, payout_token, opts = {})
103
- data, _status_code, _headers = get_payout_status_with_http_info(user_token, payout_token, opts)
104
- data
105
- end
106
-
107
- # Get status of a payout by payout token
108
- # This **GET** endpoint is used to retrieve the status of a payout transaction for a user with the specified token and payout token. &lt;br&gt; You can use this endpoint to check the status of a specific payout transaction, including whether the payout has been successfully processed or if there was an error. &lt;br&gt; To use this endpoint, you need to provide the &#x60;user_token&#x60; and &#x60;payout_token&#x60; in the URL Path. &lt;br&gt; The response will include a JSON object containing details about the payout transaction.
109
- # @param user_token [String] Token representing the user to pay out
110
- # @param payout_token [String] Token representing the trsanaction. Retrieved from &#x60;/payout/{user_token}&#x60;
111
- # @param [Hash] opts the optional parameters
112
- # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
113
- # @option opts [Boolean] :force_status_update Attempts to get an updated status update from the payout destination (default to false)
114
- # @option opts [Boolean] :include_payer_logo Whether to include the payer logo in base64 format.
115
- # @return [Array<(PayoutTxnResp, Integer, Hash)>] PayoutTxnResp data, response status code and response headers
116
- def get_payout_status_with_http_info(user_token, payout_token, opts = {})
117
- if @api_client.config.debugging
118
- @api_client.config.logger.debug 'Calling API: PayoutApi.get_payout_status ...'
119
- end
120
- # verify the required parameter 'user_token' is set
121
- if @api_client.config.client_side_validation && user_token.nil?
122
- fail ArgumentError, "Missing the required parameter 'user_token' when calling PayoutApi.get_payout_status"
123
- end
124
- # verify the required parameter 'payout_token' is set
125
- if @api_client.config.client_side_validation && payout_token.nil?
126
- fail ArgumentError, "Missing the required parameter 'payout_token' when calling PayoutApi.get_payout_status"
127
- end
128
- # resource path
129
- local_var_path = '/payout/{user_token}/{payout_token}'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s)).sub('{' + 'payout_token' + '}', CGI.escape(payout_token.to_s))
130
-
131
- # query parameters
132
- query_params = opts[:query_params] || {}
133
- query_params[:'force_status_update'] = opts[:'force_status_update'] if !opts[:'force_status_update'].nil?
134
- query_params[:'include_payer_logo'] = opts[:'include_payer_logo'] if !opts[:'include_payer_logo'].nil?
135
-
136
- # header parameters
137
- header_params = opts[:header_params] || {}
138
- # HTTP header 'Accept' (if needed)
139
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
140
- header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
141
-
142
- # form parameters
143
- form_params = opts[:form_params] || {}
144
-
145
- # http body (model)
146
- post_body = opts[:debug_body]
147
-
148
- # return_type
149
- return_type = opts[:debug_return_type] || 'PayoutTxnResp'
150
-
151
- # auth_names
152
- auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
153
-
154
- new_options = opts.merge(
155
- :operation => :"PayoutApi.get_payout_status",
156
- :header_params => header_params,
157
- :query_params => query_params,
158
- :form_params => form_params,
159
- :body => post_body,
160
- :auth_names => auth_names,
161
- :return_type => return_type
162
- )
163
-
164
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
165
- if @api_client.config.debugging
166
- @api_client.config.logger.debug "API called: PayoutApi#get_payout_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
167
- end
168
- return data, status_code, headers
169
- end
170
-
171
- # Get transaction confirmation details
172
- # This **PATCH** endpoint is used to obtain a PDF document with all the details of a payout transaction for a user with the specified token and payout token. <br> You can use this endpoint to obtain confirmation details about a specific payout transaction. <br> To use this endpoint, you need to provide the `user_token` and `payout_token` in the URL Path. <br> The response will include a PDF document containing all the details of the payout transaction.
173
- # @param user_token [String] Token representing the user to pay out
174
- # @param payout_token [String] Token representing the trsanaction. Retrieved from &#x60;/payout/{user_token}&#x60;
175
- # @param [Hash] opts the optional parameters
176
- # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
177
- # @return [GetTransactionConfirmationDetails200Response]
178
- def get_transaction_confirmation_details(user_token, payout_token, opts = {})
179
- data, _status_code, _headers = get_transaction_confirmation_details_with_http_info(user_token, payout_token, opts)
180
- data
181
- end
182
-
183
- # Get transaction confirmation details
184
- # This **PATCH** endpoint is used to obtain a PDF document with all the details of a payout transaction for a user with the specified token and payout token. &lt;br&gt; You can use this endpoint to obtain confirmation details about a specific payout transaction. &lt;br&gt; To use this endpoint, you need to provide the &#x60;user_token&#x60; and &#x60;payout_token&#x60; in the URL Path. &lt;br&gt; The response will include a PDF document containing all the details of the payout transaction.
185
- # @param user_token [String] Token representing the user to pay out
186
- # @param payout_token [String] Token representing the trsanaction. Retrieved from &#x60;/payout/{user_token}&#x60;
187
- # @param [Hash] opts the optional parameters
188
- # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
189
- # @return [Array<(GetTransactionConfirmationDetails200Response, Integer, Hash)>] GetTransactionConfirmationDetails200Response data, response status code and response headers
190
- def get_transaction_confirmation_details_with_http_info(user_token, payout_token, opts = {})
191
- if @api_client.config.debugging
192
- @api_client.config.logger.debug 'Calling API: PayoutApi.get_transaction_confirmation_details ...'
193
- end
194
- # verify the required parameter 'user_token' is set
195
- if @api_client.config.client_side_validation && user_token.nil?
196
- fail ArgumentError, "Missing the required parameter 'user_token' when calling PayoutApi.get_transaction_confirmation_details"
197
- end
198
- # verify the required parameter 'payout_token' is set
199
- if @api_client.config.client_side_validation && payout_token.nil?
200
- fail ArgumentError, "Missing the required parameter 'payout_token' when calling PayoutApi.get_transaction_confirmation_details"
201
- end
202
- # resource path
203
- local_var_path = '/payout/{user_token}/{payout_token}'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s)).sub('{' + 'payout_token' + '}', CGI.escape(payout_token.to_s))
204
-
205
- # query parameters
206
- query_params = opts[:query_params] || {}
207
-
208
- # header parameters
209
- header_params = opts[:header_params] || {}
210
- # HTTP header 'Accept' (if needed)
211
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
212
- header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
213
-
214
- # form parameters
215
- form_params = opts[:form_params] || {}
216
-
217
- # http body (model)
218
- post_body = opts[:debug_body]
219
-
220
- # return_type
221
- return_type = opts[:debug_return_type] || 'GetTransactionConfirmationDetails200Response'
222
-
223
- # auth_names
224
- auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
225
-
226
- new_options = opts.merge(
227
- :operation => :"PayoutApi.get_transaction_confirmation_details",
228
- :header_params => header_params,
229
- :query_params => query_params,
230
- :form_params => form_params,
231
- :body => post_body,
232
- :auth_names => auth_names,
233
- :return_type => return_type
234
- )
235
-
236
- data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
237
- if @api_client.config.debugging
238
- @api_client.config.logger.debug "API called: PayoutApi#get_transaction_confirmation_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
239
- end
240
- return data, status_code, headers
241
- end
242
-
243
- # Get history of payouts by user token
244
- # This **GET** endpoint is used to retrieve the payout history for a user with the specified token. <br> You can use this endpoint to view all payouts made to a user, including the `payout_token`, `destinantion_token` and `destination_amount`. <br> To use this endpoint, you need to provide the user token of the recipient in the URL Path. <br> The response will include a JSON object containing an array of payout transactions for the specified user, with each transaction including details such as the transaction ID, payout amount, currency, payout status, and date and time of the payout.
245
- # @param user_token [String] The user token that needs to be fetched.
246
- # @param [Hash] opts the optional parameters
247
- # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
248
- # @option opts [Boolean] :include_payer_logos Whether to include the payers logo in base64 format. (default to false)
249
- # @return [Array<PayoutTxnResp>]
250
- def get_user_payouts_by_token(user_token, opts = {})
251
- data, _status_code, _headers = get_user_payouts_by_token_with_http_info(user_token, opts)
252
- data
253
- end
254
-
255
- # Get history of payouts by user token
256
- # This **GET** endpoint is used to retrieve the payout history for a user with the specified token. &lt;br&gt; You can use this endpoint to view all payouts made to a user, including the &#x60;payout_token&#x60;, &#x60;destinantion_token&#x60; and &#x60;destination_amount&#x60;. &lt;br&gt; To use this endpoint, you need to provide the user token of the recipient in the URL Path. &lt;br&gt; The response will include a JSON object containing an array of payout transactions for the specified user, with each transaction including details such as the transaction ID, payout amount, currency, payout status, and date and time of the payout.
257
- # @param user_token [String] The user token that needs to be fetched.
258
- # @param [Hash] opts the optional parameters
259
- # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
260
- # @option opts [Boolean] :include_payer_logos Whether to include the payers logo in base64 format. (default to false)
261
- # @return [Array<(Array<PayoutTxnResp>, Integer, Hash)>] Array<PayoutTxnResp> data, response status code and response headers
262
- def get_user_payouts_by_token_with_http_info(user_token, opts = {})
263
- if @api_client.config.debugging
264
- @api_client.config.logger.debug 'Calling API: PayoutApi.get_user_payouts_by_token ...'
265
- end
266
- # verify the required parameter 'user_token' is set
267
- if @api_client.config.client_side_validation && user_token.nil?
268
- fail ArgumentError, "Missing the required parameter 'user_token' when calling PayoutApi.get_user_payouts_by_token"
269
- end
270
- # resource path
271
- local_var_path = '/payout/{user_token}'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s))
272
-
273
- # query parameters
274
- query_params = opts[:query_params] || {}
275
- query_params[:'include_payer_logos'] = opts[:'include_payer_logos'] if !opts[:'include_payer_logos'].nil?
276
-
277
- # header parameters
278
- header_params = opts[:header_params] || {}
279
- # HTTP header 'Accept' (if needed)
280
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
281
- header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
282
-
283
- # form parameters
284
- form_params = opts[:form_params] || {}
285
-
286
- # http body (model)
287
- post_body = opts[:debug_body]
288
-
289
- # return_type
290
- return_type = opts[:debug_return_type] || 'Array<PayoutTxnResp>'
291
-
292
- # auth_names
293
- auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
294
-
295
- new_options = opts.merge(
296
- :operation => :"PayoutApi.get_user_payouts_by_token",
297
- :header_params => header_params,
298
- :query_params => query_params,
299
- :form_params => form_params,
300
- :body => post_body,
301
- :auth_names => auth_names,
302
- :return_type => return_type
303
- )
304
-
305
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
306
- if @api_client.config.debugging
307
- @api_client.config.logger.debug "API called: PayoutApi#get_user_payouts_by_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
308
- end
309
- return data, status_code, headers
310
- end
311
-
312
- # Initiate a payout transaction
313
- # This **POST** endpoint is used to initiate a payout transaction from your account to a user with a specified token. <br> You can use this endpoint to pay out funds to your users, such as payments for services rendered or rewards for completing tasks. To use this endpoint, you need to provide the user token of the recipient in the URL Path. <br> The request body should include the funding source (`source_token`), payout destination (`destination_token`) and specify in which currency the payout should be made (`destination_currency_code`). <br> As a response API will return all details about your payout transaction.
314
- # @param user_token [String] Token representing the user to pay out
315
- # @param payout_txn [PayoutTxn] Payout parameters for a quote
316
- # @param [Hash] opts the optional parameters
317
- # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
318
- # @option opts [Float] :limit Limit amount for transaction amount + fee. If fee + amount are higher than the limit, the output will automatically adjust to maximize the possible amount sent
319
- # @return [PayoutTxnResp]
320
- def initiate_payout(user_token, payout_txn, opts = {})
321
- data, _status_code, _headers = initiate_payout_with_http_info(user_token, payout_txn, opts)
322
- data
323
- end
324
-
325
- # Initiate a payout transaction
326
- # This **POST** endpoint is used to initiate a payout transaction from your account to a user with a specified token. &lt;br&gt; You can use this endpoint to pay out funds to your users, such as payments for services rendered or rewards for completing tasks. To use this endpoint, you need to provide the user token of the recipient in the URL Path. &lt;br&gt; The request body should include the funding source (&#x60;source_token&#x60;), payout destination (&#x60;destination_token&#x60;) and specify in which currency the payout should be made (&#x60;destination_currency_code&#x60;). &lt;br&gt; As a response API will return all details about your payout transaction.
327
- # @param user_token [String] Token representing the user to pay out
328
- # @param payout_txn [PayoutTxn] Payout parameters for a quote
329
- # @param [Hash] opts the optional parameters
330
- # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
331
- # @option opts [Float] :limit Limit amount for transaction amount + fee. If fee + amount are higher than the limit, the output will automatically adjust to maximize the possible amount sent
332
- # @return [Array<(PayoutTxnResp, Integer, Hash)>] PayoutTxnResp data, response status code and response headers
333
- def initiate_payout_with_http_info(user_token, payout_txn, opts = {})
334
- if @api_client.config.debugging
335
- @api_client.config.logger.debug 'Calling API: PayoutApi.initiate_payout ...'
336
- end
337
- # verify the required parameter 'user_token' is set
338
- if @api_client.config.client_side_validation && user_token.nil?
339
- fail ArgumentError, "Missing the required parameter 'user_token' when calling PayoutApi.initiate_payout"
340
- end
341
- # verify the required parameter 'payout_txn' is set
342
- if @api_client.config.client_side_validation && payout_txn.nil?
343
- fail ArgumentError, "Missing the required parameter 'payout_txn' when calling PayoutApi.initiate_payout"
344
- end
345
- pattern = Regexp.new(/^[\d.]+$/)
346
- if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] !~ pattern
347
- fail ArgumentError, "invalid value for 'opts[:\"limit\"]' when calling PayoutApi.initiate_payout, must conform to the pattern #{pattern}."
348
- end
349
-
350
- # resource path
351
- local_var_path = '/payout/{user_token}'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s))
352
-
353
- # query parameters
354
- query_params = opts[:query_params] || {}
355
- query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
356
-
357
- # header parameters
358
- header_params = opts[:header_params] || {}
359
- # HTTP header 'Accept' (if needed)
360
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
361
- # HTTP header 'Content-Type'
362
- content_type = @api_client.select_header_content_type(['application/json'])
363
- if !content_type.nil?
364
- header_params['Content-Type'] = content_type
365
- end
366
- header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
367
-
368
- # form parameters
369
- form_params = opts[:form_params] || {}
370
-
371
- # http body (model)
372
- post_body = opts[:debug_body] || @api_client.object_to_http_body(payout_txn)
373
-
374
- # return_type
375
- return_type = opts[:debug_return_type] || 'PayoutTxnResp'
376
-
377
- # auth_names
378
- auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
379
-
380
- new_options = opts.merge(
381
- :operation => :"PayoutApi.initiate_payout",
382
- :header_params => header_params,
383
- :query_params => query_params,
384
- :form_params => form_params,
385
- :body => post_body,
386
- :auth_names => auth_names,
387
- :return_type => return_type
388
- )
389
-
390
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
391
- if @api_client.config.debugging
392
- @api_client.config.logger.debug "API called: PayoutApi#initiate_payout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
393
- end
394
- return data, status_code, headers
395
- end
396
- end
397
- end
@@ -1,160 +0,0 @@
1
- =begin
2
- #MassPay API
3
-
4
- #MassPay API
5
-
6
- The version of the OpenAPI document: 0.1.4
7
- Contact: support@masspay.io
8
- Generated by: MassPay Inc.
9
- OpenAPI Generator version: 6.5.0
10
- =end
11
-
12
- require 'cgi'
13
-
14
- module MassPayRubySdk
15
- class SpendBackApi
16
- attr_accessor :api_client
17
-
18
- def initialize(api_client = ApiClient.default)
19
- @api_client = api_client
20
- end
21
- # Get history of spend backs by user token
22
- # This **GET** endpoint is used to retrieve the history of spendbacks for a specific user token. <br> You can use this endpoint to help manage your payment operations and track the usage of funds by your users. <br> To use this endpoint, you need to provide the `user_token` as a parameter in the URL Path. <br> The endpoint will then return a list of all the historical spendbacks for the provided user token. The response will contain a JSON array with details for each spendback transaction.
23
- # @param user_token [String] Token representing the user to fetch/initiate spend back
24
- # @param [Hash] opts the optional parameters
25
- # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
26
- # @return [Array<SpendBacks>]
27
- def get_user_spendbacks_by_token(user_token, opts = {})
28
- data, _status_code, _headers = get_user_spendbacks_by_token_with_http_info(user_token, opts)
29
- data
30
- end
31
-
32
- # Get history of spend backs by user token
33
- # This **GET** endpoint is used to retrieve the history of spendbacks for a specific user token. &lt;br&gt; You can use this endpoint to help manage your payment operations and track the usage of funds by your users. &lt;br&gt; To use this endpoint, you need to provide the &#x60;user_token&#x60; as a parameter in the URL Path. &lt;br&gt; The endpoint will then return a list of all the historical spendbacks for the provided user token. The response will contain a JSON array with details for each spendback transaction.
34
- # @param user_token [String] Token representing the user to fetch/initiate spend back
35
- # @param [Hash] opts the optional parameters
36
- # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
37
- # @return [Array<(Array<SpendBacks>, Integer, Hash)>] Array<SpendBacks> data, response status code and response headers
38
- def get_user_spendbacks_by_token_with_http_info(user_token, opts = {})
39
- if @api_client.config.debugging
40
- @api_client.config.logger.debug 'Calling API: SpendBackApi.get_user_spendbacks_by_token ...'
41
- end
42
- # verify the required parameter 'user_token' is set
43
- if @api_client.config.client_side_validation && user_token.nil?
44
- fail ArgumentError, "Missing the required parameter 'user_token' when calling SpendBackApi.get_user_spendbacks_by_token"
45
- end
46
- # resource path
47
- local_var_path = '/spendback/{user_token}'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s))
48
-
49
- # query parameters
50
- query_params = opts[:query_params] || {}
51
-
52
- # header parameters
53
- header_params = opts[:header_params] || {}
54
- # HTTP header 'Accept' (if needed)
55
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
56
- header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
57
-
58
- # form parameters
59
- form_params = opts[:form_params] || {}
60
-
61
- # http body (model)
62
- post_body = opts[:debug_body]
63
-
64
- # return_type
65
- return_type = opts[:debug_return_type] || 'Array<SpendBacks>'
66
-
67
- # auth_names
68
- auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
69
-
70
- new_options = opts.merge(
71
- :operation => :"SpendBackApi.get_user_spendbacks_by_token",
72
- :header_params => header_params,
73
- :query_params => query_params,
74
- :form_params => form_params,
75
- :body => post_body,
76
- :auth_names => auth_names,
77
- :return_type => return_type
78
- )
79
-
80
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
81
- if @api_client.config.debugging
82
- @api_client.config.logger.debug "API called: SpendBackApi#get_user_spendbacks_by_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
83
- end
84
- return data, status_code, headers
85
- end
86
-
87
- # Initiate a spend back transaction
88
- # This **POST** endpoint is used to initiate a spendback transaction to a provided user token. <br> You can use this endpoint to enable spendback transactions for your users and help them manage their funds more effectively. <br> To use this endpoint, you need to provide the `user_token` as a parameter in the URL Path, along with the required parameters in the request Body, including `client_spendback_id`, `source_token`, `source_currency_code` and `amount`. <br> The endpoint will then initiate the spendback transaction, transferring funds from the source token to the user token. The response will contain a JSON object indicating the status of the request and any relevant transaction details.
89
- # @param user_token [String] Token representing the user to fetch/initiate spend back
90
- # @param [Hash] opts the optional parameters
91
- # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
92
- # @option opts [SpendBackTxn] :spend_back_txn Spend back information
93
- # @return [SpendBackTxnResp]
94
- def initiate_spendback(user_token, opts = {})
95
- data, _status_code, _headers = initiate_spendback_with_http_info(user_token, opts)
96
- data
97
- end
98
-
99
- # Initiate a spend back transaction
100
- # This **POST** endpoint is used to initiate a spendback transaction to a provided user token. &lt;br&gt; You can use this endpoint to enable spendback transactions for your users and help them manage their funds more effectively. &lt;br&gt; To use this endpoint, you need to provide the &#x60;user_token&#x60; as a parameter in the URL Path, along with the required parameters in the request Body, including &#x60;client_spendback_id&#x60;, &#x60;source_token&#x60;, &#x60;source_currency_code&#x60; and &#x60;amount&#x60;. &lt;br&gt; The endpoint will then initiate the spendback transaction, transferring funds from the source token to the user token. The response will contain a JSON object indicating the status of the request and any relevant transaction details.
101
- # @param user_token [String] Token representing the user to fetch/initiate spend back
102
- # @param [Hash] opts the optional parameters
103
- # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
104
- # @option opts [SpendBackTxn] :spend_back_txn Spend back information
105
- # @return [Array<(SpendBackTxnResp, Integer, Hash)>] SpendBackTxnResp data, response status code and response headers
106
- def initiate_spendback_with_http_info(user_token, opts = {})
107
- if @api_client.config.debugging
108
- @api_client.config.logger.debug 'Calling API: SpendBackApi.initiate_spendback ...'
109
- end
110
- # verify the required parameter 'user_token' is set
111
- if @api_client.config.client_side_validation && user_token.nil?
112
- fail ArgumentError, "Missing the required parameter 'user_token' when calling SpendBackApi.initiate_spendback"
113
- end
114
- # resource path
115
- local_var_path = '/spendback/{user_token}'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s))
116
-
117
- # query parameters
118
- query_params = opts[:query_params] || {}
119
-
120
- # header parameters
121
- header_params = opts[:header_params] || {}
122
- # HTTP header 'Accept' (if needed)
123
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
124
- # HTTP header 'Content-Type'
125
- content_type = @api_client.select_header_content_type(['application/json'])
126
- if !content_type.nil?
127
- header_params['Content-Type'] = content_type
128
- end
129
- header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
130
-
131
- # form parameters
132
- form_params = opts[:form_params] || {}
133
-
134
- # http body (model)
135
- post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'spend_back_txn'])
136
-
137
- # return_type
138
- return_type = opts[:debug_return_type] || 'SpendBackTxnResp'
139
-
140
- # auth_names
141
- auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
142
-
143
- new_options = opts.merge(
144
- :operation => :"SpendBackApi.initiate_spendback",
145
- :header_params => header_params,
146
- :query_params => query_params,
147
- :form_params => form_params,
148
- :body => post_body,
149
- :auth_names => auth_names,
150
- :return_type => return_type
151
- )
152
-
153
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
154
- if @api_client.config.debugging
155
- @api_client.config.logger.debug "API called: SpendBackApi#initiate_spendback\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
156
- end
157
- return data, status_code, headers
158
- end
159
- end
160
- end
@@ -1,82 +0,0 @@
1
- =begin
2
- #MassPay API
3
-
4
- #MassPay API
5
-
6
- The version of the OpenAPI document: 0.1.4
7
- Contact: support@masspay.io
8
- Generated by: MassPay Inc.
9
- OpenAPI Generator version: 6.5.0
10
- =end
11
-
12
- require 'cgi'
13
-
14
- module MassPayRubySdk
15
- class TaxApi
16
- attr_accessor :api_client
17
-
18
- def initialize(api_client = ApiClient.default)
19
- @api_client = api_client
20
- end
21
- # Get List Of Users Annual Balance
22
- # @param [Hash] opts the optional parameters
23
- # @option opts [Float] :amount_threshold If specified, only show users whose total balance exceeds the provided amount
24
- # @option opts [Integer] :tax_year The year for which we would like to obtain tax information for. If none provided, defaults to previous year.
25
- # @return [Array<TaxYearUserResp>]
26
- def get_tax_users(opts = {})
27
- data, _status_code, _headers = get_tax_users_with_http_info(opts)
28
- data
29
- end
30
-
31
- # Get List Of Users Annual Balance
32
- # @param [Hash] opts the optional parameters
33
- # @option opts [Float] :amount_threshold If specified, only show users whose total balance exceeds the provided amount
34
- # @option opts [Integer] :tax_year The year for which we would like to obtain tax information for. If none provided, defaults to previous year.
35
- # @return [Array<(Array<TaxYearUserResp>, Integer, Hash)>] Array<TaxYearUserResp> data, response status code and response headers
36
- def get_tax_users_with_http_info(opts = {})
37
- if @api_client.config.debugging
38
- @api_client.config.logger.debug 'Calling API: TaxApi.get_tax_users ...'
39
- end
40
- # resource path
41
- local_var_path = '/tax'
42
-
43
- # query parameters
44
- query_params = opts[:query_params] || {}
45
- query_params[:'amount_threshold'] = opts[:'amount_threshold'] if !opts[:'amount_threshold'].nil?
46
- query_params[:'tax_year'] = opts[:'tax_year'] if !opts[:'tax_year'].nil?
47
-
48
- # header parameters
49
- header_params = opts[:header_params] || {}
50
- # HTTP header 'Accept' (if needed)
51
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
52
-
53
- # form parameters
54
- form_params = opts[:form_params] || {}
55
-
56
- # http body (model)
57
- post_body = opts[:debug_body]
58
-
59
- # return_type
60
- return_type = opts[:debug_return_type] || 'Array<TaxYearUserResp>'
61
-
62
- # auth_names
63
- auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
64
-
65
- new_options = opts.merge(
66
- :operation => :"TaxApi.get_tax_users",
67
- :header_params => header_params,
68
- :query_params => query_params,
69
- :form_params => form_params,
70
- :body => post_body,
71
- :auth_names => auth_names,
72
- :return_type => return_type
73
- )
74
-
75
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
76
- if @api_client.config.debugging
77
- @api_client.config.logger.debug "API called: TaxApi#get_tax_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
78
- end
79
- return data, status_code, headers
80
- end
81
- end
82
- end