masspay_ruby_sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +8 -0
  3. data/CONTRIBUTING.md +13 -0
  4. data/Gemfile +9 -0
  5. data/README.md +197 -0
  6. data/Rakefile +10 -0
  7. data/docs/AccountApi.md +150 -0
  8. data/docs/ApiResponse.md +22 -0
  9. data/docs/AttrTxn.md +20 -0
  10. data/docs/AttrValue.md +20 -0
  11. data/docs/AttrVelocityRequestInner.md +20 -0
  12. data/docs/AttributeApi.md +168 -0
  13. data/docs/AttrsRequirement.md +36 -0
  14. data/docs/AutopayResp.md +22 -0
  15. data/docs/AutopayRule.md +20 -0
  16. data/docs/AvailableBalanceTxnResp.md +22 -0
  17. data/docs/CardApi.md +160 -0
  18. data/docs/CatalogApi.md +469 -0
  19. data/docs/CompaniesResp.md +18 -0
  20. data/docs/Company.md +26 -0
  21. data/docs/Country.md +22 -0
  22. data/docs/Exception.md +20 -0
  23. data/docs/FoundUser.md +24 -0
  24. data/docs/GetAccountStatement200Response.md +18 -0
  25. data/docs/GetTransactionConfirmationDetails200Response.md +18 -0
  26. data/docs/GetUserAgreement200Response.md +26 -0
  27. data/docs/GetUserAgreementsNames200ResponseInner.md +24 -0
  28. data/docs/GetUserUserTokenKycAu10tix200Response.md +18 -0
  29. data/docs/GetUserUserTokenKycVeriff200Response.md +18 -0
  30. data/docs/GetWalletCardInfo200Response.md +30 -0
  31. data/docs/IDUpload.md +20 -0
  32. data/docs/KYCApi.md +305 -0
  33. data/docs/LoadApi.md +621 -0
  34. data/docs/LoadTxn.md +32 -0
  35. data/docs/LoadTxnResp.md +20 -0
  36. data/docs/Loads.md +36 -0
  37. data/docs/PayoutApi.md +403 -0
  38. data/docs/PayoutTxn.md +36 -0
  39. data/docs/PayoutTxnCommitResp.md +24 -0
  40. data/docs/PayoutTxnResp.md +60 -0
  41. data/docs/ResendBalanceNotification200Response.md +18 -0
  42. data/docs/Service.md +22 -0
  43. data/docs/ServicePayersInner.md +38 -0
  44. data/docs/ServicePayersInnerExchangeRateInner.md +20 -0
  45. data/docs/SpendBackApi.md +161 -0
  46. data/docs/SpendBackTxn.md +28 -0
  47. data/docs/SpendBackTxnResp.md +22 -0
  48. data/docs/SpendBacks.md +34 -0
  49. data/docs/StoredUser.md +56 -0
  50. data/docs/TaxApi.md +81 -0
  51. data/docs/TaxYearUserResp.md +48 -0
  52. data/docs/TxnHistoryResp.md +52 -0
  53. data/docs/UpdateUser.md +52 -0
  54. data/docs/User.md +50 -0
  55. data/docs/UserApi.md +403 -0
  56. data/docs/WalletApi.md +463 -0
  57. data/docs/WalletTxnResp.md +34 -0
  58. data/docs/logo.webp +0 -0
  59. data/lib/masspay_ruby_sdk/api/account_api.rb +149 -0
  60. data/lib/masspay_ruby_sdk/api/attribute_api.rb +214 -0
  61. data/lib/masspay_ruby_sdk/api/card_api.rb +174 -0
  62. data/lib/masspay_ruby_sdk/api/catalog_api.rb +443 -0
  63. data/lib/masspay_ruby_sdk/api/kyc_api.rb +290 -0
  64. data/lib/masspay_ruby_sdk/api/load_api.rb +598 -0
  65. data/lib/masspay_ruby_sdk/api/payout_api.rb +397 -0
  66. data/lib/masspay_ruby_sdk/api/spend_back_api.rb +160 -0
  67. data/lib/masspay_ruby_sdk/api/tax_api.rb +82 -0
  68. data/lib/masspay_ruby_sdk/api/user_api.rb +418 -0
  69. data/lib/masspay_ruby_sdk/api/wallet_api.rb +461 -0
  70. data/lib/masspay_ruby_sdk/api_client.rb +391 -0
  71. data/lib/masspay_ruby_sdk/api_error.rb +57 -0
  72. data/lib/masspay_ruby_sdk/configuration.rb +315 -0
  73. data/lib/masspay_ruby_sdk/models/api_response.rb +236 -0
  74. data/lib/masspay_ruby_sdk/models/attr_txn.rb +235 -0
  75. data/lib/masspay_ruby_sdk/models/attr_value.rb +239 -0
  76. data/lib/masspay_ruby_sdk/models/attr_velocity_request_inner.rb +273 -0
  77. data/lib/masspay_ruby_sdk/models/attrs_requirement.rb +372 -0
  78. data/lib/masspay_ruby_sdk/models/autopay_resp.rb +256 -0
  79. data/lib/masspay_ruby_sdk/models/autopay_rule.rb +241 -0
  80. data/lib/masspay_ruby_sdk/models/available_balance_txn_resp.rb +254 -0
  81. data/lib/masspay_ruby_sdk/models/companies_resp.rb +225 -0
  82. data/lib/masspay_ruby_sdk/models/company.rb +285 -0
  83. data/lib/masspay_ruby_sdk/models/country.rb +296 -0
  84. data/lib/masspay_ruby_sdk/models/exception.rb +241 -0
  85. data/lib/masspay_ruby_sdk/models/found_user.rb +270 -0
  86. data/lib/masspay_ruby_sdk/models/get_account_statement200_response.rb +225 -0
  87. data/lib/masspay_ruby_sdk/models/get_transaction_confirmation_details200_response.rb +218 -0
  88. data/lib/masspay_ruby_sdk/models/get_user_agreement200_response.rb +280 -0
  89. data/lib/masspay_ruby_sdk/models/get_user_agreements_names200_response_inner.rb +270 -0
  90. data/lib/masspay_ruby_sdk/models/get_user_user_token_kyc_au10tix200_response.rb +224 -0
  91. data/lib/masspay_ruby_sdk/models/get_user_user_token_kyc_veriff200_response.rb +224 -0
  92. data/lib/masspay_ruby_sdk/models/get_wallet_card_info200_response.rb +460 -0
  93. data/lib/masspay_ruby_sdk/models/id_upload.rb +273 -0
  94. data/lib/masspay_ruby_sdk/models/load_txn.rb +321 -0
  95. data/lib/masspay_ruby_sdk/models/load_txn_resp.rb +273 -0
  96. data/lib/masspay_ruby_sdk/models/loads.rb +388 -0
  97. data/lib/masspay_ruby_sdk/models/payout_txn.rb +328 -0
  98. data/lib/masspay_ruby_sdk/models/payout_txn_commit_resp.rb +293 -0
  99. data/lib/masspay_ruby_sdk/models/payout_txn_resp.rb +613 -0
  100. data/lib/masspay_ruby_sdk/models/resend_balance_notification200_response.rb +225 -0
  101. data/lib/masspay_ruby_sdk/models/service.rb +318 -0
  102. data/lib/masspay_ruby_sdk/models/service_payers_inner.rb +373 -0
  103. data/lib/masspay_ruby_sdk/models/service_payers_inner_exchange_rate_inner.rb +239 -0
  104. data/lib/masspay_ruby_sdk/models/spend_back_txn.rb +325 -0
  105. data/lib/masspay_ruby_sdk/models/spend_back_txn_resp.rb +307 -0
  106. data/lib/masspay_ruby_sdk/models/spend_backs.rb +340 -0
  107. data/lib/masspay_ruby_sdk/models/stored_user.rb +500 -0
  108. data/lib/masspay_ruby_sdk/models/tax_year_user_resp.rb +388 -0
  109. data/lib/masspay_ruby_sdk/models/txn_history_resp.rb +571 -0
  110. data/lib/masspay_ruby_sdk/models/update_user.rb +490 -0
  111. data/lib/masspay_ruby_sdk/models/user.rb +423 -0
  112. data/lib/masspay_ruby_sdk/models/wallet_txn_resp.rb +375 -0
  113. data/lib/masspay_ruby_sdk/version.rb +14 -0
  114. data/lib/masspay_ruby_sdk.rb +89 -0
  115. data/masspay_ruby_sdk.gemspec +37 -0
  116. data/spec/api_client_spec.rb +227 -0
  117. data/spec/configuration_spec.rb +41 -0
  118. data/spec/spec_helper.rb +110 -0
  119. metadata +203 -0
data/docs/Loads.md ADDED
@@ -0,0 +1,36 @@
1
+ # MassPayRubySdk::Loads
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **load_token** | **String** | Token representing the load token | |
8
+ | **time_of_load** | **String** | The timestamp the load was processed. If not processed yet, a future date will be returned. Using UTC timestamp.[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) | |
9
+ | **client_load_id** | **String** | A client defined load identifier. This is the unique ID assigned to the load on your system. Max 50 characters. | |
10
+ | **source_token** | **String** | Token that represents the funding source i.e. bank account, wallet. 36 characters long | |
11
+ | **wallet_token** | **String** | Token that represents the wallet that received the funds. 36 characters long | |
12
+ | **amount** | **Float** | The amount to credit the user's wallet in source currency | |
13
+ | **source_currency_code** | **String** | The currency originating balance is stored in. Using [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format. In most cases this value will be USD, and therefore the defaut value if none is provided | |
14
+ | **notes** | **String** | A description for the load. Will be visible to the user receiving the load | |
15
+ | **status** | **String** | Status of the load | |
16
+ | **metadata** | **Object** | Optional JSON object with attributes that can later be searched to locate this load. Do not include PII as this object is not encrypted. | [optional] |
17
+
18
+ ## Example
19
+
20
+ ```ruby
21
+ require 'masspay_ruby_sdk'
22
+
23
+ instance = MassPayRubySdk::Loads.new(
24
+ load_token: ld_ba4275f2-bae1-488d-9d6f-20af1cd83574,
25
+ time_of_load: 2019-07-07T23:03:05,
26
+ client_load_id: aEjn345,
27
+ source_token: null,
28
+ wallet_token: null,
29
+ amount: 100.5,
30
+ source_currency_code: USD,
31
+ notes: Commission payment for July,
32
+ status: COMPLETED,
33
+ metadata: {"group_id":541}
34
+ )
35
+ ```
36
+
data/docs/PayoutApi.md ADDED
@@ -0,0 +1,403 @@
1
+ # MassPayRubySdk::PayoutApi
2
+
3
+ All URIs are relative to *https://api.masspay.io/v0.1.4*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**commit_payout_txn**](PayoutApi.md#commit_payout_txn) | **PUT** /payout/{user_token}/{payout_token} | Commit payout transaction |
8
+ | [**get_payout_status**](PayoutApi.md#get_payout_status) | **GET** /payout/{user_token}/{payout_token} | Get status of a payout by payout token |
9
+ | [**get_transaction_confirmation_details**](PayoutApi.md#get_transaction_confirmation_details) | **PATCH** /payout/{user_token}/{payout_token} | Get transaction confirmation details |
10
+ | [**get_user_payouts_by_token**](PayoutApi.md#get_user_payouts_by_token) | **GET** /payout/{user_token} | Get history of payouts by user token |
11
+ | [**initiate_payout**](PayoutApi.md#initiate_payout) | **POST** /payout/{user_token} | Initiate a payout transaction |
12
+
13
+
14
+ ## commit_payout_txn
15
+
16
+ > <PayoutTxnCommitResp> commit_payout_txn(user_token, payout_token, opts)
17
+
18
+ Commit payout transaction
19
+
20
+ 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.
21
+
22
+ ### Examples
23
+
24
+ ```ruby
25
+ require 'time'
26
+ require 'masspay_ruby_sdk'
27
+ # setup authorization
28
+ MassPayRubySdk.configure do |config|
29
+ # Configure API key authorization: AUTHORIZER_NAME
30
+ config.api_key['AUTHORIZER_NAME'] = 'YOUR API KEY'
31
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
32
+ # config.api_key_prefix['AUTHORIZER_NAME'] = 'Bearer'
33
+ end
34
+
35
+ api_instance = MassPayRubySdk::PayoutApi.new
36
+ user_token = 'user_token_example' # String | Token representing the user to pay out
37
+ payout_token = 'payout_token_example' # String | Token representing the trsanaction. Retrieved from `/payout/{user_token}`
38
+ opts = {
39
+ idempotency_key: 'idempotency_key_example' # String | Unique key to prevent duplicate processing
40
+ }
41
+
42
+ begin
43
+ # Commit payout transaction
44
+ result = api_instance.commit_payout_txn(user_token, payout_token, opts)
45
+ p result
46
+ rescue MassPayRubySdk::ApiError => e
47
+ puts "Error when calling PayoutApi->commit_payout_txn: #{e}"
48
+ end
49
+ ```
50
+
51
+ #### Using the commit_payout_txn_with_http_info variant
52
+
53
+ This returns an Array which contains the response data, status code and headers.
54
+
55
+ > <Array(<PayoutTxnCommitResp>, Integer, Hash)> commit_payout_txn_with_http_info(user_token, payout_token, opts)
56
+
57
+ ```ruby
58
+ begin
59
+ # Commit payout transaction
60
+ data, status_code, headers = api_instance.commit_payout_txn_with_http_info(user_token, payout_token, opts)
61
+ p status_code # => 2xx
62
+ p headers # => { ... }
63
+ p data # => <PayoutTxnCommitResp>
64
+ rescue MassPayRubySdk::ApiError => e
65
+ puts "Error when calling PayoutApi->commit_payout_txn_with_http_info: #{e}"
66
+ end
67
+ ```
68
+
69
+ ### Parameters
70
+
71
+ | Name | Type | Description | Notes |
72
+ | ---- | ---- | ----------- | ----- |
73
+ | **user_token** | **String** | Token representing the user to pay out | |
74
+ | **payout_token** | **String** | Token representing the trsanaction. Retrieved from &#x60;/payout/{user_token}&#x60; | |
75
+ | **idempotency_key** | **String** | Unique key to prevent duplicate processing | [optional] |
76
+
77
+ ### Return type
78
+
79
+ [**PayoutTxnCommitResp**](PayoutTxnCommitResp.md)
80
+
81
+ ### Authorization
82
+
83
+ [AUTHORIZER_NAME](../README.md#AUTHORIZER_NAME)
84
+
85
+ ### HTTP request headers
86
+
87
+ - **Content-Type**: Not defined
88
+ - **Accept**: application/json
89
+
90
+
91
+ ## get_payout_status
92
+
93
+ > <PayoutTxnResp> get_payout_status(user_token, payout_token, opts)
94
+
95
+ Get status of a payout by payout token
96
+
97
+ 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.
98
+
99
+ ### Examples
100
+
101
+ ```ruby
102
+ require 'time'
103
+ require 'masspay_ruby_sdk'
104
+ # setup authorization
105
+ MassPayRubySdk.configure do |config|
106
+ # Configure API key authorization: AUTHORIZER_NAME
107
+ config.api_key['AUTHORIZER_NAME'] = 'YOUR API KEY'
108
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
109
+ # config.api_key_prefix['AUTHORIZER_NAME'] = 'Bearer'
110
+ end
111
+
112
+ api_instance = MassPayRubySdk::PayoutApi.new
113
+ user_token = 'user_token_example' # String | Token representing the user to pay out
114
+ payout_token = 'payout_ed75acf2-1c35-4073-9adc-389084d1e96b' # String | Token representing the trsanaction. Retrieved from `/payout/{user_token}`
115
+ opts = {
116
+ idempotency_key: 'idempotency_key_example', # String | Unique key to prevent duplicate processing
117
+ force_status_update: true, # Boolean | Attempts to get an updated status update from the payout destination
118
+ include_payer_logo: true # Boolean | Whether to include the payer logo in base64 format.
119
+ }
120
+
121
+ begin
122
+ # Get status of a payout by payout token
123
+ result = api_instance.get_payout_status(user_token, payout_token, opts)
124
+ p result
125
+ rescue MassPayRubySdk::ApiError => e
126
+ puts "Error when calling PayoutApi->get_payout_status: #{e}"
127
+ end
128
+ ```
129
+
130
+ #### Using the get_payout_status_with_http_info variant
131
+
132
+ This returns an Array which contains the response data, status code and headers.
133
+
134
+ > <Array(<PayoutTxnResp>, Integer, Hash)> get_payout_status_with_http_info(user_token, payout_token, opts)
135
+
136
+ ```ruby
137
+ begin
138
+ # Get status of a payout by payout token
139
+ data, status_code, headers = api_instance.get_payout_status_with_http_info(user_token, payout_token, opts)
140
+ p status_code # => 2xx
141
+ p headers # => { ... }
142
+ p data # => <PayoutTxnResp>
143
+ rescue MassPayRubySdk::ApiError => e
144
+ puts "Error when calling PayoutApi->get_payout_status_with_http_info: #{e}"
145
+ end
146
+ ```
147
+
148
+ ### Parameters
149
+
150
+ | Name | Type | Description | Notes |
151
+ | ---- | ---- | ----------- | ----- |
152
+ | **user_token** | **String** | Token representing the user to pay out | |
153
+ | **payout_token** | **String** | Token representing the trsanaction. Retrieved from &#x60;/payout/{user_token}&#x60; | |
154
+ | **idempotency_key** | **String** | Unique key to prevent duplicate processing | [optional] |
155
+ | **force_status_update** | **Boolean** | Attempts to get an updated status update from the payout destination | [optional][default to false] |
156
+ | **include_payer_logo** | **Boolean** | Whether to include the payer logo in base64 format. | [optional] |
157
+
158
+ ### Return type
159
+
160
+ [**PayoutTxnResp**](PayoutTxnResp.md)
161
+
162
+ ### Authorization
163
+
164
+ [AUTHORIZER_NAME](../README.md#AUTHORIZER_NAME)
165
+
166
+ ### HTTP request headers
167
+
168
+ - **Content-Type**: Not defined
169
+ - **Accept**: application/json
170
+
171
+
172
+ ## get_transaction_confirmation_details
173
+
174
+ > <GetTransactionConfirmationDetails200Response> get_transaction_confirmation_details(user_token, payout_token, opts)
175
+
176
+ Get transaction confirmation details
177
+
178
+ 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.
179
+
180
+ ### Examples
181
+
182
+ ```ruby
183
+ require 'time'
184
+ require 'masspay_ruby_sdk'
185
+ # setup authorization
186
+ MassPayRubySdk.configure do |config|
187
+ # Configure API key authorization: AUTHORIZER_NAME
188
+ config.api_key['AUTHORIZER_NAME'] = 'YOUR API KEY'
189
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
190
+ # config.api_key_prefix['AUTHORIZER_NAME'] = 'Bearer'
191
+ end
192
+
193
+ api_instance = MassPayRubySdk::PayoutApi.new
194
+ user_token = 'user_token_example' # String | Token representing the user to pay out
195
+ payout_token = 'payout_ed75acf2-1c35-4073-9adc-389084d1e96b' # String | Token representing the trsanaction. Retrieved from `/payout/{user_token}`
196
+ opts = {
197
+ idempotency_key: 'idempotency_key_example' # String | Unique key to prevent duplicate processing
198
+ }
199
+
200
+ begin
201
+ # Get transaction confirmation details
202
+ result = api_instance.get_transaction_confirmation_details(user_token, payout_token, opts)
203
+ p result
204
+ rescue MassPayRubySdk::ApiError => e
205
+ puts "Error when calling PayoutApi->get_transaction_confirmation_details: #{e}"
206
+ end
207
+ ```
208
+
209
+ #### Using the get_transaction_confirmation_details_with_http_info variant
210
+
211
+ This returns an Array which contains the response data, status code and headers.
212
+
213
+ > <Array(<GetTransactionConfirmationDetails200Response>, Integer, Hash)> get_transaction_confirmation_details_with_http_info(user_token, payout_token, opts)
214
+
215
+ ```ruby
216
+ begin
217
+ # Get transaction confirmation details
218
+ data, status_code, headers = api_instance.get_transaction_confirmation_details_with_http_info(user_token, payout_token, opts)
219
+ p status_code # => 2xx
220
+ p headers # => { ... }
221
+ p data # => <GetTransactionConfirmationDetails200Response>
222
+ rescue MassPayRubySdk::ApiError => e
223
+ puts "Error when calling PayoutApi->get_transaction_confirmation_details_with_http_info: #{e}"
224
+ end
225
+ ```
226
+
227
+ ### Parameters
228
+
229
+ | Name | Type | Description | Notes |
230
+ | ---- | ---- | ----------- | ----- |
231
+ | **user_token** | **String** | Token representing the user to pay out | |
232
+ | **payout_token** | **String** | Token representing the trsanaction. Retrieved from &#x60;/payout/{user_token}&#x60; | |
233
+ | **idempotency_key** | **String** | Unique key to prevent duplicate processing | [optional] |
234
+
235
+ ### Return type
236
+
237
+ [**GetTransactionConfirmationDetails200Response**](GetTransactionConfirmationDetails200Response.md)
238
+
239
+ ### Authorization
240
+
241
+ [AUTHORIZER_NAME](../README.md#AUTHORIZER_NAME)
242
+
243
+ ### HTTP request headers
244
+
245
+ - **Content-Type**: Not defined
246
+ - **Accept**: application/json
247
+
248
+
249
+ ## get_user_payouts_by_token
250
+
251
+ > <Array<PayoutTxnResp>> get_user_payouts_by_token(user_token, opts)
252
+
253
+ Get history of payouts by user token
254
+
255
+ 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.
256
+
257
+ ### Examples
258
+
259
+ ```ruby
260
+ require 'time'
261
+ require 'masspay_ruby_sdk'
262
+ # setup authorization
263
+ MassPayRubySdk.configure do |config|
264
+ # Configure API key authorization: AUTHORIZER_NAME
265
+ config.api_key['AUTHORIZER_NAME'] = 'YOUR API KEY'
266
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
267
+ # config.api_key_prefix['AUTHORIZER_NAME'] = 'Bearer'
268
+ end
269
+
270
+ api_instance = MassPayRubySdk::PayoutApi.new
271
+ user_token = 'user_token_example' # String | The user token that needs to be fetched.
272
+ opts = {
273
+ idempotency_key: 'idempotency_key_example', # String | Unique key to prevent duplicate processing
274
+ include_payer_logos: true # Boolean | Whether to include the payers logo in base64 format.
275
+ }
276
+
277
+ begin
278
+ # Get history of payouts by user token
279
+ result = api_instance.get_user_payouts_by_token(user_token, opts)
280
+ p result
281
+ rescue MassPayRubySdk::ApiError => e
282
+ puts "Error when calling PayoutApi->get_user_payouts_by_token: #{e}"
283
+ end
284
+ ```
285
+
286
+ #### Using the get_user_payouts_by_token_with_http_info variant
287
+
288
+ This returns an Array which contains the response data, status code and headers.
289
+
290
+ > <Array(<Array<PayoutTxnResp>>, Integer, Hash)> get_user_payouts_by_token_with_http_info(user_token, opts)
291
+
292
+ ```ruby
293
+ begin
294
+ # Get history of payouts by user token
295
+ data, status_code, headers = api_instance.get_user_payouts_by_token_with_http_info(user_token, opts)
296
+ p status_code # => 2xx
297
+ p headers # => { ... }
298
+ p data # => <Array<PayoutTxnResp>>
299
+ rescue MassPayRubySdk::ApiError => e
300
+ puts "Error when calling PayoutApi->get_user_payouts_by_token_with_http_info: #{e}"
301
+ end
302
+ ```
303
+
304
+ ### Parameters
305
+
306
+ | Name | Type | Description | Notes |
307
+ | ---- | ---- | ----------- | ----- |
308
+ | **user_token** | **String** | The user token that needs to be fetched. | |
309
+ | **idempotency_key** | **String** | Unique key to prevent duplicate processing | [optional] |
310
+ | **include_payer_logos** | **Boolean** | Whether to include the payers logo in base64 format. | [optional][default to false] |
311
+
312
+ ### Return type
313
+
314
+ [**Array&lt;PayoutTxnResp&gt;**](PayoutTxnResp.md)
315
+
316
+ ### Authorization
317
+
318
+ [AUTHORIZER_NAME](../README.md#AUTHORIZER_NAME)
319
+
320
+ ### HTTP request headers
321
+
322
+ - **Content-Type**: Not defined
323
+ - **Accept**: application/json
324
+
325
+
326
+ ## initiate_payout
327
+
328
+ > <PayoutTxnResp> initiate_payout(user_token, payout_txn, opts)
329
+
330
+ Initiate a payout transaction
331
+
332
+ 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.
333
+
334
+ ### Examples
335
+
336
+ ```ruby
337
+ require 'time'
338
+ require 'masspay_ruby_sdk'
339
+ # setup authorization
340
+ MassPayRubySdk.configure do |config|
341
+ # Configure API key authorization: AUTHORIZER_NAME
342
+ config.api_key['AUTHORIZER_NAME'] = 'YOUR API KEY'
343
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
344
+ # config.api_key_prefix['AUTHORIZER_NAME'] = 'Bearer'
345
+ end
346
+
347
+ api_instance = MassPayRubySdk::PayoutApi.new
348
+ user_token = 'user_token_example' # String | Token representing the user to pay out
349
+ payout_txn = MassPayRubySdk::PayoutTxn.new({destination_currency_code: 'MXN', source_token: 'source_token_example', destination_token: 'destination_token_example'}) # PayoutTxn | Payout parameters for a quote
350
+ opts = {
351
+ idempotency_key: 'idempotency_key_example', # String | Unique key to prevent duplicate processing
352
+ limit: 8.14 # Float | 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
353
+ }
354
+
355
+ begin
356
+ # Initiate a payout transaction
357
+ result = api_instance.initiate_payout(user_token, payout_txn, opts)
358
+ p result
359
+ rescue MassPayRubySdk::ApiError => e
360
+ puts "Error when calling PayoutApi->initiate_payout: #{e}"
361
+ end
362
+ ```
363
+
364
+ #### Using the initiate_payout_with_http_info variant
365
+
366
+ This returns an Array which contains the response data, status code and headers.
367
+
368
+ > <Array(<PayoutTxnResp>, Integer, Hash)> initiate_payout_with_http_info(user_token, payout_txn, opts)
369
+
370
+ ```ruby
371
+ begin
372
+ # Initiate a payout transaction
373
+ data, status_code, headers = api_instance.initiate_payout_with_http_info(user_token, payout_txn, opts)
374
+ p status_code # => 2xx
375
+ p headers # => { ... }
376
+ p data # => <PayoutTxnResp>
377
+ rescue MassPayRubySdk::ApiError => e
378
+ puts "Error when calling PayoutApi->initiate_payout_with_http_info: #{e}"
379
+ end
380
+ ```
381
+
382
+ ### Parameters
383
+
384
+ | Name | Type | Description | Notes |
385
+ | ---- | ---- | ----------- | ----- |
386
+ | **user_token** | **String** | Token representing the user to pay out | |
387
+ | **payout_txn** | [**PayoutTxn**](PayoutTxn.md) | Payout parameters for a quote | |
388
+ | **idempotency_key** | **String** | Unique key to prevent duplicate processing | [optional] |
389
+ | **limit** | **Float** | 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 | [optional] |
390
+
391
+ ### Return type
392
+
393
+ [**PayoutTxnResp**](PayoutTxnResp.md)
394
+
395
+ ### Authorization
396
+
397
+ [AUTHORIZER_NAME](../README.md#AUTHORIZER_NAME)
398
+
399
+ ### HTTP request headers
400
+
401
+ - **Content-Type**: application/json
402
+ - **Accept**: application/json
403
+
data/docs/PayoutTxn.md ADDED
@@ -0,0 +1,36 @@
1
+ # MassPayRubySdk::PayoutTxn
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **client_transfer_id** | **String** | A client defined transfer identifier. This is the unique ID assigned to the transfer on your system. Max 50 characters. | [optional] |
8
+ | **source_currency_code** | **String** | The currency originating balance is stored in. Using [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format. In most cases this value will be USD, and therefore the defaut value if none is provided | [optional][default to &#39;USD&#39;] |
9
+ | **destination_currency_code** | **String** | The currency the funds will be deposited into. Using [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format | |
10
+ | **source_token** | **String** | Token that represents the funding source i.e. bank account, wallet. 36 characters long | |
11
+ | **destination_token** | **String** | Token that represents the payout destination i.e. Omnex-&gt;Brazil-&gt;Bank Deposit-&gt;Itau. To be retrieved from the #pricing callback. If not provided, the last destination that was used for this user will be used. 36 characters long | |
12
+ | **destination_amount** | **Float** | The amount to be sent for payout in source currency. i.e USD. Must be provided if source_amount is empty | [optional] |
13
+ | **source_amount** | **Float** | The amount to be received by the payout in source currency. i.e USD. Must be provided if destination_amount is empty | [optional] |
14
+ | **attr_set_token** | **String** | Token that represents set of attributes that associated with destination_token. For example, bank account, mobile account, wallet id, etc. If not provided, uses the last one used. 36 characters long | [optional] |
15
+ | **metadata** | **String** | Optional JSON object with attributes that can later be searched to locate this payout. Do not include PII as this object is not encrypted. | [optional] |
16
+ | **notify_user** | **Boolean** | Should we notify the user via email/sms about status updates for this payout? | [optional][default to false] |
17
+
18
+ ## Example
19
+
20
+ ```ruby
21
+ require 'masspay_ruby_sdk'
22
+
23
+ instance = MassPayRubySdk::PayoutTxn.new(
24
+ client_transfer_id: aEjn345,
25
+ source_currency_code: USD,
26
+ destination_currency_code: MXN,
27
+ source_token: null,
28
+ destination_token: null,
29
+ destination_amount: 100.5,
30
+ source_amount: 100.5,
31
+ attr_set_token: null,
32
+ metadata: {&quot;group_id&quot;:541},
33
+ notify_user: null
34
+ )
35
+ ```
36
+
@@ -0,0 +1,24 @@
1
+ # MassPayRubySdk::PayoutTxnCommitResp
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **payout_token** | **String** | Token that represents the transaction that was just created. | |
8
+ | **status** | **String** | Status that indicates whether the transaction was successfully processed. If &#x60;success&#x60;, everything was processed correctly. &#x60;failure&#x60; indicates a generic error. &#x60;addtl_attr_req&#x60; indicates that in order to process this transaction, additional attributes are required to be updated for this customer. &#x60;ex_rate_expired&#x60; indicates that the transaction exchange rate has expired and a new transaction has to be created. | |
9
+ | **pickup_code** | **String** | Code/pin that is required when collecting the money. Should be provided to the recipient to present to payout location. | [optional] |
10
+ | **errors** | **String** | Description of errors preventing transfer from being injected. | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'masspay_ruby_sdk'
16
+
17
+ instance = MassPayRubySdk::PayoutTxnCommitResp.new(
18
+ payout_token: null,
19
+ status: null,
20
+ pickup_code: 54238173,
21
+ errors: Duplicate transfer
22
+ )
23
+ ```
24
+
@@ -0,0 +1,60 @@
1
+ # MassPayRubySdk::PayoutTxnResp
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **payout_token** | **String** | Token that represents the transaction that was just created. Need to be used to commit the transaction in &#x60;/payout/{user_token}/{payout_token}&#x60;. Value would be NSF if there are not enough funds in the &#x60;source_token&#x60;. Value would be &#x60;DUPLICATE&#x60; if there is a duplicate &#x60;client_transfer_id&#x60;. | |
8
+ | **client_transfer_id** | **String** | A client defined transfer identifier. This is the unique ID assigned to the transfer on your system. Max 50 characters. | |
9
+ | **source_currency_code** | **String** | The currency originating balance is stored in. Using [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format. In most cases this value will be USD, and therefore the defaut value if none is provided | |
10
+ | **destination_currency_code** | **String** | The currency the funds will be deposited into. Using [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format | |
11
+ | **source_token** | **String** | Token that represents the funding source i.e. your bank account, user&#39;s wallet. 36 characters long | |
12
+ | **destination_token** | **String** | Token that represents the payout destination i.e. Omnex-&gt;Brazil-&gt;Bank Deposit-&gt;Itau. To be retrieved from the #pricing callback. If not provided, the last destination that was used for this user will be used. 36 characters long | |
13
+ | **destination_amount** | **Float** | The amount to be sent for payout in source currency. i.e USD. Must be provided if source_amount is empty | |
14
+ | **source_amount** | **Float** | The amount to be received by the payout in source currency. i.e USD. Must be provided if destination_amount is empty | |
15
+ | **attr_set_token** | **String** | Token that represents set of attributes that associated with destination_token. For example, bank account, mobile account, wallet id, etc. If not provided, uses the last one used. 36 characters long | |
16
+ | **exchange_rate** | **Float** | The exchange rate to convert source_amount to destination_amount | |
17
+ | **fee** | **Float** | Fee to be charged for the transaction | |
18
+ | **expiration** | **String** | The time and date at which the transaction will expire. The transaction has to be finalized before this time. Transactions are valid for 2 minutes from creation time. If expired, a new transaction has to be created. | |
19
+ | **pickup_code** | **String** | Code/pin that is required when collecting the money. Should be provided to the recipient to present to payout location. | |
20
+ | **status** | **String** | The status of the transaction | |
21
+ | **payer_logo** | **String** | base64 representation of the payer logo | [optional] |
22
+ | **payer_name** | **String** | Name of payer | |
23
+ | **delivery_type** | **String** | The type of delivery | |
24
+ | **country_code** | **String** | Country code [ISO_3166](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) | |
25
+ | **metadata** | **Object** | Optional JSON object with attributes that can later be searched to locate this payout. Do not include PII as this object is not encrypted. | [optional] |
26
+ | **estimated_availability** | **Time** | Estimated availability of funds. When funds would be available to pickup/deposited | |
27
+ | **status_reason** | **String** | Optional. Contains the reason for the status change. Most commonly used for CANCELLED status with the reason for cancellation | [optional] |
28
+ | **attrs** | **Object** | The relevant attributes that were used to fulfill this payout | [optional] |
29
+
30
+ ## Example
31
+
32
+ ```ruby
33
+ require 'masspay_ruby_sdk'
34
+
35
+ instance = MassPayRubySdk::PayoutTxnResp.new(
36
+ payout_token: ba4275f2-bae1-488d-9d6f-20af1cd83574,
37
+ client_transfer_id: aEjn345,
38
+ source_currency_code: USD,
39
+ destination_currency_code: MXN,
40
+ source_token: ba4275f2-bae1-488d-9d6f-20af1cd83574,
41
+ destination_token: d2138fd0-00be-45a8-985f-4f5bde500962,
42
+ destination_amount: 100.5,
43
+ source_amount: 100.5,
44
+ attr_set_token: b1a867c1-6e36-4525-b6d5-a20bac80e3b0,
45
+ exchange_rate: 18.55,
46
+ fee: 2.99,
47
+ expiration: 2019-06-26T22:32:05,
48
+ pickup_code: 54238173,
49
+ status: null,
50
+ payer_logo: [B@3459a3c9,
51
+ payer_name: Elektra,
52
+ delivery_type: null,
53
+ country_code: MEX,
54
+ metadata: {&quot;group_id&quot;:541},
55
+ estimated_availability: 2020-07-21T17:32:28Z,
56
+ status_reason: null,
57
+ attrs: null
58
+ )
59
+ ```
60
+
@@ -0,0 +1,18 @@
1
+ # MassPayRubySdk::ResendBalanceNotification200Response
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **success** | **Boolean** | True if notifcation was sent succesfully. False otherwise | |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'masspay_ruby_sdk'
13
+
14
+ instance = MassPayRubySdk::ResendBalanceNotification200Response.new(
15
+ success: null
16
+ )
17
+ ```
18
+
data/docs/Service.md ADDED
@@ -0,0 +1,22 @@
1
+ # MassPayRubySdk::Service
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **country_code** | **String** | Country code [ISO_3166](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) | |
8
+ | **delivery_type** | **String** | The type of service. I.e. cash pickup, home delivery, etc. | |
9
+ | **payers** | [**Array&lt;ServicePayersInner&gt;**](ServicePayersInner.md) | | |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'masspay_ruby_sdk'
15
+
16
+ instance = MassPayRubySdk::Service.new(
17
+ country_code: MEX,
18
+ delivery_type: null,
19
+ payers: null
20
+ )
21
+ ```
22
+
@@ -0,0 +1,38 @@
1
+ # MassPayRubySdk::ServicePayersInner
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **destination_token** | **String** | Token that represents the payout destination. 36 characters long | |
8
+ | **payer_logo** | **String** | base64 representation of the payer logo | |
9
+ | **payer_name** | **String** | Name of payer | |
10
+ | **exchange_rate** | [**Array&lt;ServicePayersInnerExchangeRateInner&gt;**](ServicePayersInnerExchangeRateInner.md) | Lists all available currencies and their estimated rates | |
11
+ | **fee** | **Float** | Service fee | |
12
+ | **max_limit** | **Float** | The maximum amount (inclusive) the user can send with this service. 0 if no upper limit | |
13
+ | **min_limit** | **Float** | The minimum amount (inclusive) the user can send with this service. 0 if no lower limit | |
14
+ | **source_amount** | **Float** | Optional return field. Will only show if &#x60;limit&#x60; parameter is provided | [optional] |
15
+ | **number_of_locations** | **Integer** | Total number of locations. Mostly relevant for cash pickup services. 0 if unknown or irrelevant | [optional][default to 0] |
16
+ | **estimated_availability** | **Time** | Estimated availability of funds. When funds would be available to pickup/deposited | [optional] |
17
+ | **additional_description** | **String** | When available, additional description that explains the service offered or requirements for funds delivery. | [optional] |
18
+
19
+ ## Example
20
+
21
+ ```ruby
22
+ require 'masspay_ruby_sdk'
23
+
24
+ instance = MassPayRubySdk::ServicePayersInner.new(
25
+ destination_token: null,
26
+ payer_logo: [B@7a1cca39,
27
+ payer_name: Elektra,
28
+ exchange_rate: null,
29
+ fee: 8,
30
+ max_limit: 10000,
31
+ min_limit: 0,
32
+ source_amount: 104.3,
33
+ number_of_locations: 13007,
34
+ estimated_availability: 2020-07-21T17:32:28Z,
35
+ additional_description: Requires drivers license to pickup funds
36
+ )
37
+ ```
38
+
@@ -0,0 +1,20 @@
1
+ # MassPayRubySdk::ServicePayersInnerExchangeRateInner
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **currency_symbol** | **String** | Using [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format. | |
8
+ | **exchange_rate** | **Float** | Estimated rate | |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'masspay_ruby_sdk'
14
+
15
+ instance = MassPayRubySdk::ServicePayersInnerExchangeRateInner.new(
16
+ currency_symbol: MXN,
17
+ exchange_rate: 18.37
18
+ )
19
+ ```
20
+