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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +8 -0
- data/CONTRIBUTING.md +13 -0
- data/Gemfile +9 -0
- data/README.md +197 -0
- data/Rakefile +10 -0
- data/docs/AccountApi.md +150 -0
- data/docs/ApiResponse.md +22 -0
- data/docs/AttrTxn.md +20 -0
- data/docs/AttrValue.md +20 -0
- data/docs/AttrVelocityRequestInner.md +20 -0
- data/docs/AttributeApi.md +168 -0
- data/docs/AttrsRequirement.md +36 -0
- data/docs/AutopayResp.md +22 -0
- data/docs/AutopayRule.md +20 -0
- data/docs/AvailableBalanceTxnResp.md +22 -0
- data/docs/CardApi.md +160 -0
- data/docs/CatalogApi.md +469 -0
- data/docs/CompaniesResp.md +18 -0
- data/docs/Company.md +26 -0
- data/docs/Country.md +22 -0
- data/docs/Exception.md +20 -0
- data/docs/FoundUser.md +24 -0
- data/docs/GetAccountStatement200Response.md +18 -0
- data/docs/GetTransactionConfirmationDetails200Response.md +18 -0
- data/docs/GetUserAgreement200Response.md +26 -0
- data/docs/GetUserAgreementsNames200ResponseInner.md +24 -0
- data/docs/GetUserUserTokenKycAu10tix200Response.md +18 -0
- data/docs/GetUserUserTokenKycVeriff200Response.md +18 -0
- data/docs/GetWalletCardInfo200Response.md +30 -0
- data/docs/IDUpload.md +20 -0
- data/docs/KYCApi.md +305 -0
- data/docs/LoadApi.md +621 -0
- data/docs/LoadTxn.md +32 -0
- data/docs/LoadTxnResp.md +20 -0
- data/docs/Loads.md +36 -0
- data/docs/PayoutApi.md +403 -0
- data/docs/PayoutTxn.md +36 -0
- data/docs/PayoutTxnCommitResp.md +24 -0
- data/docs/PayoutTxnResp.md +60 -0
- data/docs/ResendBalanceNotification200Response.md +18 -0
- data/docs/Service.md +22 -0
- data/docs/ServicePayersInner.md +38 -0
- data/docs/ServicePayersInnerExchangeRateInner.md +20 -0
- data/docs/SpendBackApi.md +161 -0
- data/docs/SpendBackTxn.md +28 -0
- data/docs/SpendBackTxnResp.md +22 -0
- data/docs/SpendBacks.md +34 -0
- data/docs/StoredUser.md +56 -0
- data/docs/TaxApi.md +81 -0
- data/docs/TaxYearUserResp.md +48 -0
- data/docs/TxnHistoryResp.md +52 -0
- data/docs/UpdateUser.md +52 -0
- data/docs/User.md +50 -0
- data/docs/UserApi.md +403 -0
- data/docs/WalletApi.md +463 -0
- data/docs/WalletTxnResp.md +34 -0
- data/docs/logo.webp +0 -0
- data/lib/masspay_ruby_sdk/api/account_api.rb +149 -0
- data/lib/masspay_ruby_sdk/api/attribute_api.rb +214 -0
- data/lib/masspay_ruby_sdk/api/card_api.rb +174 -0
- data/lib/masspay_ruby_sdk/api/catalog_api.rb +443 -0
- data/lib/masspay_ruby_sdk/api/kyc_api.rb +290 -0
- data/lib/masspay_ruby_sdk/api/load_api.rb +598 -0
- data/lib/masspay_ruby_sdk/api/payout_api.rb +397 -0
- data/lib/masspay_ruby_sdk/api/spend_back_api.rb +160 -0
- data/lib/masspay_ruby_sdk/api/tax_api.rb +82 -0
- data/lib/masspay_ruby_sdk/api/user_api.rb +418 -0
- data/lib/masspay_ruby_sdk/api/wallet_api.rb +461 -0
- data/lib/masspay_ruby_sdk/api_client.rb +391 -0
- data/lib/masspay_ruby_sdk/api_error.rb +57 -0
- data/lib/masspay_ruby_sdk/configuration.rb +315 -0
- data/lib/masspay_ruby_sdk/models/api_response.rb +236 -0
- data/lib/masspay_ruby_sdk/models/attr_txn.rb +235 -0
- data/lib/masspay_ruby_sdk/models/attr_value.rb +239 -0
- data/lib/masspay_ruby_sdk/models/attr_velocity_request_inner.rb +273 -0
- data/lib/masspay_ruby_sdk/models/attrs_requirement.rb +372 -0
- data/lib/masspay_ruby_sdk/models/autopay_resp.rb +256 -0
- data/lib/masspay_ruby_sdk/models/autopay_rule.rb +241 -0
- data/lib/masspay_ruby_sdk/models/available_balance_txn_resp.rb +254 -0
- data/lib/masspay_ruby_sdk/models/companies_resp.rb +225 -0
- data/lib/masspay_ruby_sdk/models/company.rb +285 -0
- data/lib/masspay_ruby_sdk/models/country.rb +296 -0
- data/lib/masspay_ruby_sdk/models/exception.rb +241 -0
- data/lib/masspay_ruby_sdk/models/found_user.rb +270 -0
- data/lib/masspay_ruby_sdk/models/get_account_statement200_response.rb +225 -0
- data/lib/masspay_ruby_sdk/models/get_transaction_confirmation_details200_response.rb +218 -0
- data/lib/masspay_ruby_sdk/models/get_user_agreement200_response.rb +280 -0
- data/lib/masspay_ruby_sdk/models/get_user_agreements_names200_response_inner.rb +270 -0
- data/lib/masspay_ruby_sdk/models/get_user_user_token_kyc_au10tix200_response.rb +224 -0
- data/lib/masspay_ruby_sdk/models/get_user_user_token_kyc_veriff200_response.rb +224 -0
- data/lib/masspay_ruby_sdk/models/get_wallet_card_info200_response.rb +460 -0
- data/lib/masspay_ruby_sdk/models/id_upload.rb +273 -0
- data/lib/masspay_ruby_sdk/models/load_txn.rb +321 -0
- data/lib/masspay_ruby_sdk/models/load_txn_resp.rb +273 -0
- data/lib/masspay_ruby_sdk/models/loads.rb +388 -0
- data/lib/masspay_ruby_sdk/models/payout_txn.rb +328 -0
- data/lib/masspay_ruby_sdk/models/payout_txn_commit_resp.rb +293 -0
- data/lib/masspay_ruby_sdk/models/payout_txn_resp.rb +613 -0
- data/lib/masspay_ruby_sdk/models/resend_balance_notification200_response.rb +225 -0
- data/lib/masspay_ruby_sdk/models/service.rb +318 -0
- data/lib/masspay_ruby_sdk/models/service_payers_inner.rb +373 -0
- data/lib/masspay_ruby_sdk/models/service_payers_inner_exchange_rate_inner.rb +239 -0
- data/lib/masspay_ruby_sdk/models/spend_back_txn.rb +325 -0
- data/lib/masspay_ruby_sdk/models/spend_back_txn_resp.rb +307 -0
- data/lib/masspay_ruby_sdk/models/spend_backs.rb +340 -0
- data/lib/masspay_ruby_sdk/models/stored_user.rb +500 -0
- data/lib/masspay_ruby_sdk/models/tax_year_user_resp.rb +388 -0
- data/lib/masspay_ruby_sdk/models/txn_history_resp.rb +571 -0
- data/lib/masspay_ruby_sdk/models/update_user.rb +490 -0
- data/lib/masspay_ruby_sdk/models/user.rb +423 -0
- data/lib/masspay_ruby_sdk/models/wallet_txn_resp.rb +375 -0
- data/lib/masspay_ruby_sdk/version.rb +14 -0
- data/lib/masspay_ruby_sdk.rb +89 -0
- data/masspay_ruby_sdk.gemspec +37 -0
- data/spec/api_client_spec.rb +227 -0
- data/spec/configuration_spec.rb +41 -0
- data/spec/spec_helper.rb +110 -0
- metadata +203 -0
data/docs/WalletApi.md
ADDED
@@ -0,0 +1,463 @@
|
|
1
|
+
# MassPayRubySdk::WalletApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://api.masspay.io/v0.1.4*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**create_autopay_rule**](WalletApi.md#create_autopay_rule) | **POST** /wallet/{user_token}/{wallet_token}/autopay | Add autopay rule |
|
8
|
+
| [**delete_autopay_rule**](WalletApi.md#delete_autopay_rule) | **DELETE** /wallet/{user_token}/{wallet_token}/autopay | Delete autopay rule |
|
9
|
+
| [**get_autopay_rules**](WalletApi.md#get_autopay_rules) | **GET** /wallet/{user_token}/{wallet_token}/autopay | Get all autopay rules |
|
10
|
+
| [**get_wallet**](WalletApi.md#get_wallet) | **GET** /wallet/{user_token} | Retrieve all available wallets for a user |
|
11
|
+
| [**get_wallet_card_info**](WalletApi.md#get_wallet_card_info) | **GET** /wallet/{user_token}/{wallet_token}/card | Get MassPay Card Information |
|
12
|
+
| [**update_wallet_card_info**](WalletApi.md#update_wallet_card_info) | **PUT** /wallet/{user_token}/{wallet_token}/card | Update MassPay Card Information |
|
13
|
+
|
14
|
+
|
15
|
+
## create_autopay_rule
|
16
|
+
|
17
|
+
> <AutopayResp> create_autopay_rule(user_token, wallet_token, opts)
|
18
|
+
|
19
|
+
Add autopay rule
|
20
|
+
|
21
|
+
This **POST** endpoint is used to add an autopay rule that will initiate a payout whenever the provided wallet token is loaded. <br> You can use this endpoint to create an autopay rule that automatically sends a percentage of incoming load to a specific destination. <br> To use this endpoint, you need to provide the `user_token` and `wallet_token` as required parameters in the URL Path, and the `destination_token` and percentage of incoming load that should be autopaid to the `destination_token` in the request Body. <br> The response will include a JSON object containing the details of the created autopay rule, including the token, `destination_token` and percentage.
|
22
|
+
|
23
|
+
### Examples
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
require 'time'
|
27
|
+
require 'masspay_ruby_sdk'
|
28
|
+
# setup authorization
|
29
|
+
MassPayRubySdk.configure do |config|
|
30
|
+
# Configure API key authorization: AUTHORIZER_NAME
|
31
|
+
config.api_key['AUTHORIZER_NAME'] = 'YOUR API KEY'
|
32
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
33
|
+
# config.api_key_prefix['AUTHORIZER_NAME'] = 'Bearer'
|
34
|
+
end
|
35
|
+
|
36
|
+
api_instance = MassPayRubySdk::WalletApi.new
|
37
|
+
user_token = 'user_token_example' # String | Token representing the user who owns the wallet
|
38
|
+
wallet_token = 'wallet_token_example' # String | Token representing the wallet
|
39
|
+
opts = {
|
40
|
+
autopay_rule: MassPayRubySdk::AutopayRule.new({destination_token: 'dest_d2138fd0-00be-45a8-985f-4f5bde500962', percentage: 50}) # AutopayRule | Autopay rule configuration
|
41
|
+
}
|
42
|
+
|
43
|
+
begin
|
44
|
+
# Add autopay rule
|
45
|
+
result = api_instance.create_autopay_rule(user_token, wallet_token, opts)
|
46
|
+
p result
|
47
|
+
rescue MassPayRubySdk::ApiError => e
|
48
|
+
puts "Error when calling WalletApi->create_autopay_rule: #{e}"
|
49
|
+
end
|
50
|
+
```
|
51
|
+
|
52
|
+
#### Using the create_autopay_rule_with_http_info variant
|
53
|
+
|
54
|
+
This returns an Array which contains the response data, status code and headers.
|
55
|
+
|
56
|
+
> <Array(<AutopayResp>, Integer, Hash)> create_autopay_rule_with_http_info(user_token, wallet_token, opts)
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
begin
|
60
|
+
# Add autopay rule
|
61
|
+
data, status_code, headers = api_instance.create_autopay_rule_with_http_info(user_token, wallet_token, opts)
|
62
|
+
p status_code # => 2xx
|
63
|
+
p headers # => { ... }
|
64
|
+
p data # => <AutopayResp>
|
65
|
+
rescue MassPayRubySdk::ApiError => e
|
66
|
+
puts "Error when calling WalletApi->create_autopay_rule_with_http_info: #{e}"
|
67
|
+
end
|
68
|
+
```
|
69
|
+
|
70
|
+
### Parameters
|
71
|
+
|
72
|
+
| Name | Type | Description | Notes |
|
73
|
+
| ---- | ---- | ----------- | ----- |
|
74
|
+
| **user_token** | **String** | Token representing the user who owns the wallet | |
|
75
|
+
| **wallet_token** | **String** | Token representing the wallet | |
|
76
|
+
| **autopay_rule** | [**AutopayRule**](AutopayRule.md) | Autopay rule configuration | [optional] |
|
77
|
+
|
78
|
+
### Return type
|
79
|
+
|
80
|
+
[**AutopayResp**](AutopayResp.md)
|
81
|
+
|
82
|
+
### Authorization
|
83
|
+
|
84
|
+
[AUTHORIZER_NAME](../README.md#AUTHORIZER_NAME)
|
85
|
+
|
86
|
+
### HTTP request headers
|
87
|
+
|
88
|
+
- **Content-Type**: application/json
|
89
|
+
- **Accept**: application/json
|
90
|
+
|
91
|
+
|
92
|
+
## delete_autopay_rule
|
93
|
+
|
94
|
+
> delete_autopay_rule(user_token, wallet_token, token)
|
95
|
+
|
96
|
+
Delete autopay rule
|
97
|
+
|
98
|
+
This **DELETE** endpoint is used to delete an existing autopay rule. <br> You can use this endpoint to remove an autopay rule that is no longer needed. <br> To use this endpoint, you need to provide the `user_token` and `wallet_token` as required parameters in the URL Path, and the token of the autopay rule you wish to delete in the request Body. <br> The response will include a message indicating the success of the deletion.
|
99
|
+
|
100
|
+
### Examples
|
101
|
+
|
102
|
+
```ruby
|
103
|
+
require 'time'
|
104
|
+
require 'masspay_ruby_sdk'
|
105
|
+
# setup authorization
|
106
|
+
MassPayRubySdk.configure do |config|
|
107
|
+
# Configure API key authorization: AUTHORIZER_NAME
|
108
|
+
config.api_key['AUTHORIZER_NAME'] = 'YOUR API KEY'
|
109
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
110
|
+
# config.api_key_prefix['AUTHORIZER_NAME'] = 'Bearer'
|
111
|
+
end
|
112
|
+
|
113
|
+
api_instance = MassPayRubySdk::WalletApi.new
|
114
|
+
user_token = 'user_token_example' # String | Token representing the user who owns the wallet
|
115
|
+
wallet_token = 'wallet_token_example' # String | Token representing the wallet
|
116
|
+
token = 'autopay_3684cc43-fe3b-4994-8ca1-7dc0db94430f' # String | Autopay token to delete
|
117
|
+
|
118
|
+
begin
|
119
|
+
# Delete autopay rule
|
120
|
+
api_instance.delete_autopay_rule(user_token, wallet_token, token)
|
121
|
+
rescue MassPayRubySdk::ApiError => e
|
122
|
+
puts "Error when calling WalletApi->delete_autopay_rule: #{e}"
|
123
|
+
end
|
124
|
+
```
|
125
|
+
|
126
|
+
#### Using the delete_autopay_rule_with_http_info variant
|
127
|
+
|
128
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
129
|
+
|
130
|
+
> <Array(nil, Integer, Hash)> delete_autopay_rule_with_http_info(user_token, wallet_token, token)
|
131
|
+
|
132
|
+
```ruby
|
133
|
+
begin
|
134
|
+
# Delete autopay rule
|
135
|
+
data, status_code, headers = api_instance.delete_autopay_rule_with_http_info(user_token, wallet_token, token)
|
136
|
+
p status_code # => 2xx
|
137
|
+
p headers # => { ... }
|
138
|
+
p data # => nil
|
139
|
+
rescue MassPayRubySdk::ApiError => e
|
140
|
+
puts "Error when calling WalletApi->delete_autopay_rule_with_http_info: #{e}"
|
141
|
+
end
|
142
|
+
```
|
143
|
+
|
144
|
+
### Parameters
|
145
|
+
|
146
|
+
| Name | Type | Description | Notes |
|
147
|
+
| ---- | ---- | ----------- | ----- |
|
148
|
+
| **user_token** | **String** | Token representing the user who owns the wallet | |
|
149
|
+
| **wallet_token** | **String** | Token representing the wallet | |
|
150
|
+
| **token** | **String** | Autopay token to delete | |
|
151
|
+
|
152
|
+
### Return type
|
153
|
+
|
154
|
+
nil (empty response body)
|
155
|
+
|
156
|
+
### Authorization
|
157
|
+
|
158
|
+
[AUTHORIZER_NAME](../README.md#AUTHORIZER_NAME)
|
159
|
+
|
160
|
+
### HTTP request headers
|
161
|
+
|
162
|
+
- **Content-Type**: Not defined
|
163
|
+
- **Accept**: application/json
|
164
|
+
|
165
|
+
|
166
|
+
## get_autopay_rules
|
167
|
+
|
168
|
+
> <Array<AutopayResp>> get_autopay_rules(user_token, wallet_token)
|
169
|
+
|
170
|
+
Get all autopay rules
|
171
|
+
|
172
|
+
This **GET** endpoint is used to retrieve all autopay rules currently applied to the provided wallet token. <br> You can use this endpoint to obtain information about the autopay rules associated with the wallet. <br> To use this endpoint, you need to provide the `user_token` and `wallet_token` as required parameters in the URL Path. <br> The response will include a JSON array containing details for each autopay rule, including the token, `destination_token` and percentage.
|
173
|
+
|
174
|
+
### Examples
|
175
|
+
|
176
|
+
```ruby
|
177
|
+
require 'time'
|
178
|
+
require 'masspay_ruby_sdk'
|
179
|
+
# setup authorization
|
180
|
+
MassPayRubySdk.configure do |config|
|
181
|
+
# Configure API key authorization: AUTHORIZER_NAME
|
182
|
+
config.api_key['AUTHORIZER_NAME'] = 'YOUR API KEY'
|
183
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
184
|
+
# config.api_key_prefix['AUTHORIZER_NAME'] = 'Bearer'
|
185
|
+
end
|
186
|
+
|
187
|
+
api_instance = MassPayRubySdk::WalletApi.new
|
188
|
+
user_token = 'user_token_example' # String | Token representing the user who owns the wallet
|
189
|
+
wallet_token = 'wallet_token_example' # String | Token representing the wallet
|
190
|
+
|
191
|
+
begin
|
192
|
+
# Get all autopay rules
|
193
|
+
result = api_instance.get_autopay_rules(user_token, wallet_token)
|
194
|
+
p result
|
195
|
+
rescue MassPayRubySdk::ApiError => e
|
196
|
+
puts "Error when calling WalletApi->get_autopay_rules: #{e}"
|
197
|
+
end
|
198
|
+
```
|
199
|
+
|
200
|
+
#### Using the get_autopay_rules_with_http_info variant
|
201
|
+
|
202
|
+
This returns an Array which contains the response data, status code and headers.
|
203
|
+
|
204
|
+
> <Array(<Array<AutopayResp>>, Integer, Hash)> get_autopay_rules_with_http_info(user_token, wallet_token)
|
205
|
+
|
206
|
+
```ruby
|
207
|
+
begin
|
208
|
+
# Get all autopay rules
|
209
|
+
data, status_code, headers = api_instance.get_autopay_rules_with_http_info(user_token, wallet_token)
|
210
|
+
p status_code # => 2xx
|
211
|
+
p headers # => { ... }
|
212
|
+
p data # => <Array<AutopayResp>>
|
213
|
+
rescue MassPayRubySdk::ApiError => e
|
214
|
+
puts "Error when calling WalletApi->get_autopay_rules_with_http_info: #{e}"
|
215
|
+
end
|
216
|
+
```
|
217
|
+
|
218
|
+
### Parameters
|
219
|
+
|
220
|
+
| Name | Type | Description | Notes |
|
221
|
+
| ---- | ---- | ----------- | ----- |
|
222
|
+
| **user_token** | **String** | Token representing the user who owns the wallet | |
|
223
|
+
| **wallet_token** | **String** | Token representing the wallet | |
|
224
|
+
|
225
|
+
### Return type
|
226
|
+
|
227
|
+
[**Array<AutopayResp>**](AutopayResp.md)
|
228
|
+
|
229
|
+
### Authorization
|
230
|
+
|
231
|
+
[AUTHORIZER_NAME](../README.md#AUTHORIZER_NAME)
|
232
|
+
|
233
|
+
### HTTP request headers
|
234
|
+
|
235
|
+
- **Content-Type**: Not defined
|
236
|
+
- **Accept**: application/json
|
237
|
+
|
238
|
+
|
239
|
+
## get_wallet
|
240
|
+
|
241
|
+
> <Array<WalletTxnResp>> get_wallet(user_token, opts)
|
242
|
+
|
243
|
+
Retrieve all available wallets for a user
|
244
|
+
|
245
|
+
This **GET** endpoint is used to retrieve all available wallets for a provided user token. <br> You can use this endpoint to obtain information about the wallets associated with the provided user token. <br> To use this endpoint, you need to provide the `user_token` as a required parameter in the URL Path. <br> The response will include a JSON array containing details for each wallet including `user_token`, `balance`, `currency_code`.
|
246
|
+
|
247
|
+
### Examples
|
248
|
+
|
249
|
+
```ruby
|
250
|
+
require 'time'
|
251
|
+
require 'masspay_ruby_sdk'
|
252
|
+
# setup authorization
|
253
|
+
MassPayRubySdk.configure do |config|
|
254
|
+
# Configure API key authorization: AUTHORIZER_NAME
|
255
|
+
config.api_key['AUTHORIZER_NAME'] = 'YOUR API KEY'
|
256
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
257
|
+
# config.api_key_prefix['AUTHORIZER_NAME'] = 'Bearer'
|
258
|
+
end
|
259
|
+
|
260
|
+
api_instance = MassPayRubySdk::WalletApi.new
|
261
|
+
user_token = 'user_token_example' # String | Token representing the user who owns the wallet
|
262
|
+
opts = {
|
263
|
+
idempotency_key: 'idempotency_key_example' # String | Unique key to prevent duplicate processing
|
264
|
+
}
|
265
|
+
|
266
|
+
begin
|
267
|
+
# Retrieve all available wallets for a user
|
268
|
+
result = api_instance.get_wallet(user_token, opts)
|
269
|
+
p result
|
270
|
+
rescue MassPayRubySdk::ApiError => e
|
271
|
+
puts "Error when calling WalletApi->get_wallet: #{e}"
|
272
|
+
end
|
273
|
+
```
|
274
|
+
|
275
|
+
#### Using the get_wallet_with_http_info variant
|
276
|
+
|
277
|
+
This returns an Array which contains the response data, status code and headers.
|
278
|
+
|
279
|
+
> <Array(<Array<WalletTxnResp>>, Integer, Hash)> get_wallet_with_http_info(user_token, opts)
|
280
|
+
|
281
|
+
```ruby
|
282
|
+
begin
|
283
|
+
# Retrieve all available wallets for a user
|
284
|
+
data, status_code, headers = api_instance.get_wallet_with_http_info(user_token, opts)
|
285
|
+
p status_code # => 2xx
|
286
|
+
p headers # => { ... }
|
287
|
+
p data # => <Array<WalletTxnResp>>
|
288
|
+
rescue MassPayRubySdk::ApiError => e
|
289
|
+
puts "Error when calling WalletApi->get_wallet_with_http_info: #{e}"
|
290
|
+
end
|
291
|
+
```
|
292
|
+
|
293
|
+
### Parameters
|
294
|
+
|
295
|
+
| Name | Type | Description | Notes |
|
296
|
+
| ---- | ---- | ----------- | ----- |
|
297
|
+
| **user_token** | **String** | Token representing the user who owns the wallet | |
|
298
|
+
| **idempotency_key** | **String** | Unique key to prevent duplicate processing | [optional] |
|
299
|
+
|
300
|
+
### Return type
|
301
|
+
|
302
|
+
[**Array<WalletTxnResp>**](WalletTxnResp.md)
|
303
|
+
|
304
|
+
### Authorization
|
305
|
+
|
306
|
+
[AUTHORIZER_NAME](../README.md#AUTHORIZER_NAME)
|
307
|
+
|
308
|
+
### HTTP request headers
|
309
|
+
|
310
|
+
- **Content-Type**: Not defined
|
311
|
+
- **Accept**: application/json
|
312
|
+
|
313
|
+
|
314
|
+
## get_wallet_card_info
|
315
|
+
|
316
|
+
> <GetWalletCardInfo200Response> get_wallet_card_info(user_token, wallet_token)
|
317
|
+
|
318
|
+
Get MassPay Card Information
|
319
|
+
|
320
|
+
This **GET** endpoint is used to retrieve MassPay card information associated with the provided wallet token. <br> You can use this endpoint to obtain information about the MassPay card associated with the wallet. <br> To use this endpoint, you need to provide the `user_token` and `wallet_token` as required parameters in the URL Path. <br> The response will include a JSON object containing details for the MassPay card, including the card number, balance, status.
|
321
|
+
|
322
|
+
### Examples
|
323
|
+
|
324
|
+
```ruby
|
325
|
+
require 'time'
|
326
|
+
require 'masspay_ruby_sdk'
|
327
|
+
# setup authorization
|
328
|
+
MassPayRubySdk.configure do |config|
|
329
|
+
# Configure API key authorization: AUTHORIZER_NAME
|
330
|
+
config.api_key['AUTHORIZER_NAME'] = 'YOUR API KEY'
|
331
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
332
|
+
# config.api_key_prefix['AUTHORIZER_NAME'] = 'Bearer'
|
333
|
+
end
|
334
|
+
|
335
|
+
api_instance = MassPayRubySdk::WalletApi.new
|
336
|
+
user_token = 'usr_62727c1f-38a3-4a98-b7c9-e84093a106cd' # String | Token representing the user who owns the wallet
|
337
|
+
wallet_token = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | Token representing the wallet
|
338
|
+
|
339
|
+
begin
|
340
|
+
# Get MassPay Card Information
|
341
|
+
result = api_instance.get_wallet_card_info(user_token, wallet_token)
|
342
|
+
p result
|
343
|
+
rescue MassPayRubySdk::ApiError => e
|
344
|
+
puts "Error when calling WalletApi->get_wallet_card_info: #{e}"
|
345
|
+
end
|
346
|
+
```
|
347
|
+
|
348
|
+
#### Using the get_wallet_card_info_with_http_info variant
|
349
|
+
|
350
|
+
This returns an Array which contains the response data, status code and headers.
|
351
|
+
|
352
|
+
> <Array(<GetWalletCardInfo200Response>, Integer, Hash)> get_wallet_card_info_with_http_info(user_token, wallet_token)
|
353
|
+
|
354
|
+
```ruby
|
355
|
+
begin
|
356
|
+
# Get MassPay Card Information
|
357
|
+
data, status_code, headers = api_instance.get_wallet_card_info_with_http_info(user_token, wallet_token)
|
358
|
+
p status_code # => 2xx
|
359
|
+
p headers # => { ... }
|
360
|
+
p data # => <GetWalletCardInfo200Response>
|
361
|
+
rescue MassPayRubySdk::ApiError => e
|
362
|
+
puts "Error when calling WalletApi->get_wallet_card_info_with_http_info: #{e}"
|
363
|
+
end
|
364
|
+
```
|
365
|
+
|
366
|
+
### Parameters
|
367
|
+
|
368
|
+
| Name | Type | Description | Notes |
|
369
|
+
| ---- | ---- | ----------- | ----- |
|
370
|
+
| **user_token** | **String** | Token representing the user who owns the wallet | |
|
371
|
+
| **wallet_token** | **String** | Token representing the wallet | |
|
372
|
+
|
373
|
+
### Return type
|
374
|
+
|
375
|
+
[**GetWalletCardInfo200Response**](GetWalletCardInfo200Response.md)
|
376
|
+
|
377
|
+
### Authorization
|
378
|
+
|
379
|
+
[AUTHORIZER_NAME](../README.md#AUTHORIZER_NAME)
|
380
|
+
|
381
|
+
### HTTP request headers
|
382
|
+
|
383
|
+
- **Content-Type**: Not defined
|
384
|
+
- **Accept**: application/json
|
385
|
+
|
386
|
+
|
387
|
+
## update_wallet_card_info
|
388
|
+
|
389
|
+
> update_wallet_card_info(user_token, wallet_token, opts)
|
390
|
+
|
391
|
+
Update MassPay Card Information
|
392
|
+
|
393
|
+
This **PUT** endpoint is used to update the MassPay card information for a provided user token and wallet token. <br> You can use this endpoint to help your users manage their MassPay card information, including updating their card PIN number or status. <br> To use this endpoint, you need to provide the `user_token` and `wallet_token` as parameters in the URL Path, along with the parameters in the request Query, including the card pin number or(and) status. <br> The endpoint will then update the card information for the provided user and wallet token.
|
394
|
+
|
395
|
+
### Examples
|
396
|
+
|
397
|
+
```ruby
|
398
|
+
require 'time'
|
399
|
+
require 'masspay_ruby_sdk'
|
400
|
+
# setup authorization
|
401
|
+
MassPayRubySdk.configure do |config|
|
402
|
+
# Configure API key authorization: AUTHORIZER_NAME
|
403
|
+
config.api_key['AUTHORIZER_NAME'] = 'YOUR API KEY'
|
404
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
405
|
+
# config.api_key_prefix['AUTHORIZER_NAME'] = 'Bearer'
|
406
|
+
end
|
407
|
+
|
408
|
+
api_instance = MassPayRubySdk::WalletApi.new
|
409
|
+
user_token = 'usr_62727c1f-38a3-4a98-b7c9-e84093a106cd' # String | Token representing the user who owns the wallet
|
410
|
+
wallet_token = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | Token representing the wallet
|
411
|
+
opts = {
|
412
|
+
pin: '0123', # String | New 4 digit pin number for the card (To be used in ATM machines)
|
413
|
+
status: 'SUSPEND' # String | New status for the card
|
414
|
+
}
|
415
|
+
|
416
|
+
begin
|
417
|
+
# Update MassPay Card Information
|
418
|
+
api_instance.update_wallet_card_info(user_token, wallet_token, opts)
|
419
|
+
rescue MassPayRubySdk::ApiError => e
|
420
|
+
puts "Error when calling WalletApi->update_wallet_card_info: #{e}"
|
421
|
+
end
|
422
|
+
```
|
423
|
+
|
424
|
+
#### Using the update_wallet_card_info_with_http_info variant
|
425
|
+
|
426
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
427
|
+
|
428
|
+
> <Array(nil, Integer, Hash)> update_wallet_card_info_with_http_info(user_token, wallet_token, opts)
|
429
|
+
|
430
|
+
```ruby
|
431
|
+
begin
|
432
|
+
# Update MassPay Card Information
|
433
|
+
data, status_code, headers = api_instance.update_wallet_card_info_with_http_info(user_token, wallet_token, opts)
|
434
|
+
p status_code # => 2xx
|
435
|
+
p headers # => { ... }
|
436
|
+
p data # => nil
|
437
|
+
rescue MassPayRubySdk::ApiError => e
|
438
|
+
puts "Error when calling WalletApi->update_wallet_card_info_with_http_info: #{e}"
|
439
|
+
end
|
440
|
+
```
|
441
|
+
|
442
|
+
### Parameters
|
443
|
+
|
444
|
+
| Name | Type | Description | Notes |
|
445
|
+
| ---- | ---- | ----------- | ----- |
|
446
|
+
| **user_token** | **String** | Token representing the user who owns the wallet | |
|
447
|
+
| **wallet_token** | **String** | Token representing the wallet | |
|
448
|
+
| **pin** | **String** | New 4 digit pin number for the card (To be used in ATM machines) | [optional] |
|
449
|
+
| **status** | **String** | New status for the card | [optional] |
|
450
|
+
|
451
|
+
### Return type
|
452
|
+
|
453
|
+
nil (empty response body)
|
454
|
+
|
455
|
+
### Authorization
|
456
|
+
|
457
|
+
[AUTHORIZER_NAME](../README.md#AUTHORIZER_NAME)
|
458
|
+
|
459
|
+
### HTTP request headers
|
460
|
+
|
461
|
+
- **Content-Type**: Not defined
|
462
|
+
- **Accept**: application/json
|
463
|
+
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# MassPayRubySdk::WalletTxnResp
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **user_token** | **String** | Token representing the user | |
|
8
|
+
| **token** | **String** | Token representing the wallet | |
|
9
|
+
| **balance** | **Float** | The wallet's current balance in USD | |
|
10
|
+
| **currency_code** | **String** | The currency wallet balance is stored in. Using [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format. In most cases this value will be USD | |
|
11
|
+
| **type** | **String** | Type of wallet | |
|
12
|
+
| **card_type** | **String** | In case type of wallet is MASSPAY_CARD, card_type would be provided with the type of card it is | [optional] |
|
13
|
+
| **last_4** | **String** | In case type of wallet is MASSPAY_CARD, last_4 would be provided with the last four digits of the card | [optional] |
|
14
|
+
| **active** | **Boolean** | An indicator whether the wallet is active. If inactive, can still retrieve historical transactions history | |
|
15
|
+
| **client_paying_fees** | **Boolean** | An indicator whether the fees for payouts using this wallet are paid by the client. If false, the user pays the fees | [optional] |
|
16
|
+
|
17
|
+
## Example
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
require 'masspay_ruby_sdk'
|
21
|
+
|
22
|
+
instance = MassPayRubySdk::WalletTxnResp.new(
|
23
|
+
user_token: usr_ba4275f2-bae1-488d-9d6f-20af1cd83574,
|
24
|
+
token: null,
|
25
|
+
balance: 100.5,
|
26
|
+
currency_code: USD,
|
27
|
+
type: USER_FUNDS,
|
28
|
+
card_type: VISA,
|
29
|
+
last_4: 1234,
|
30
|
+
active: null,
|
31
|
+
client_paying_fees: null
|
32
|
+
)
|
33
|
+
```
|
34
|
+
|
data/docs/logo.webp
ADDED
Binary file
|
@@ -0,0 +1,149 @@
|
|
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 AccountApi
|
16
|
+
attr_accessor :api_client
|
17
|
+
|
18
|
+
def initialize(api_client = ApiClient.default)
|
19
|
+
@api_client = api_client
|
20
|
+
end
|
21
|
+
# Get current available balance
|
22
|
+
# This **GET** endpoint is used to retrieve the current available balance for the MassPay account. <br> You can use this endpoint to obtain information about the current balance in your account. <br> There are no required parameters needed to access this endpoint. <br> The response will include a JSON objects containing details for the current available balance, including the token, balance and `currency_code`.
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @return [Array<AvailableBalanceTxnResp>]
|
25
|
+
def get_account_balance(opts = {})
|
26
|
+
data, _status_code, _headers = get_account_balance_with_http_info(opts)
|
27
|
+
data
|
28
|
+
end
|
29
|
+
|
30
|
+
# Get current available balance
|
31
|
+
# This **GET** endpoint is used to retrieve the current available balance for the MassPay account. <br> You can use this endpoint to obtain information about the current balance in your account. <br> There are no required parameters needed to access this endpoint. <br> The response will include a JSON objects containing details for the current available balance, including the token, balance and `currency_code`.
|
32
|
+
# @param [Hash] opts the optional parameters
|
33
|
+
# @return [Array<(Array<AvailableBalanceTxnResp>, Integer, Hash)>] Array<AvailableBalanceTxnResp> data, response status code and response headers
|
34
|
+
def get_account_balance_with_http_info(opts = {})
|
35
|
+
if @api_client.config.debugging
|
36
|
+
@api_client.config.logger.debug 'Calling API: AccountApi.get_account_balance ...'
|
37
|
+
end
|
38
|
+
# resource path
|
39
|
+
local_var_path = '/account/balance'
|
40
|
+
|
41
|
+
# query parameters
|
42
|
+
query_params = opts[:query_params] || {}
|
43
|
+
|
44
|
+
# header parameters
|
45
|
+
header_params = opts[:header_params] || {}
|
46
|
+
# HTTP header 'Accept' (if needed)
|
47
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
48
|
+
|
49
|
+
# form parameters
|
50
|
+
form_params = opts[:form_params] || {}
|
51
|
+
|
52
|
+
# http body (model)
|
53
|
+
post_body = opts[:debug_body]
|
54
|
+
|
55
|
+
# return_type
|
56
|
+
return_type = opts[:debug_return_type] || 'Array<AvailableBalanceTxnResp>'
|
57
|
+
|
58
|
+
# auth_names
|
59
|
+
auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
|
60
|
+
|
61
|
+
new_options = opts.merge(
|
62
|
+
:operation => :"AccountApi.get_account_balance",
|
63
|
+
:header_params => header_params,
|
64
|
+
:query_params => query_params,
|
65
|
+
:form_params => form_params,
|
66
|
+
:body => post_body,
|
67
|
+
:auth_names => auth_names,
|
68
|
+
:return_type => return_type
|
69
|
+
)
|
70
|
+
|
71
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
72
|
+
if @api_client.config.debugging
|
73
|
+
@api_client.config.logger.debug "API called: AccountApi#get_account_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
74
|
+
end
|
75
|
+
return data, status_code, headers
|
76
|
+
end
|
77
|
+
|
78
|
+
# Get certified account statement
|
79
|
+
# This **GET** endpoint is used to retrieve a certified PDF ledger statement for a provided timeframe. <br> You can use this endpoint to obtain a ledger statement for your MassPay account for a specific time period. <br> To use this endpoint, you need to provide the `start_date` and `ending_date` as required parameters in the Query string of the URL. <br> The response will include a certified PDF ledger statement containing transaction details for the specified timeframe.
|
80
|
+
# @param start_date [Date] Starting date of the statement
|
81
|
+
# @param ending_date [Date] Ending date of the statement (not more than 31 days than `start_date`)
|
82
|
+
# @param [Hash] opts the optional parameters
|
83
|
+
# @return [GetAccountStatement200Response]
|
84
|
+
def get_account_statement(start_date, ending_date, opts = {})
|
85
|
+
data, _status_code, _headers = get_account_statement_with_http_info(start_date, ending_date, opts)
|
86
|
+
data
|
87
|
+
end
|
88
|
+
|
89
|
+
# Get certified account statement
|
90
|
+
# This **GET** endpoint is used to retrieve a certified PDF ledger statement for a provided timeframe. <br> You can use this endpoint to obtain a ledger statement for your MassPay account for a specific time period. <br> To use this endpoint, you need to provide the `start_date` and `ending_date` as required parameters in the Query string of the URL. <br> The response will include a certified PDF ledger statement containing transaction details for the specified timeframe.
|
91
|
+
# @param start_date [Date] Starting date of the statement
|
92
|
+
# @param ending_date [Date] Ending date of the statement (not more than 31 days than `start_date`)
|
93
|
+
# @param [Hash] opts the optional parameters
|
94
|
+
# @return [Array<(GetAccountStatement200Response, Integer, Hash)>] GetAccountStatement200Response data, response status code and response headers
|
95
|
+
def get_account_statement_with_http_info(start_date, ending_date, opts = {})
|
96
|
+
if @api_client.config.debugging
|
97
|
+
@api_client.config.logger.debug 'Calling API: AccountApi.get_account_statement ...'
|
98
|
+
end
|
99
|
+
# verify the required parameter 'start_date' is set
|
100
|
+
if @api_client.config.client_side_validation && start_date.nil?
|
101
|
+
fail ArgumentError, "Missing the required parameter 'start_date' when calling AccountApi.get_account_statement"
|
102
|
+
end
|
103
|
+
# verify the required parameter 'ending_date' is set
|
104
|
+
if @api_client.config.client_side_validation && ending_date.nil?
|
105
|
+
fail ArgumentError, "Missing the required parameter 'ending_date' when calling AccountApi.get_account_statement"
|
106
|
+
end
|
107
|
+
# resource path
|
108
|
+
local_var_path = '/account/statement'
|
109
|
+
|
110
|
+
# query parameters
|
111
|
+
query_params = opts[:query_params] || {}
|
112
|
+
query_params[:'start_date'] = start_date
|
113
|
+
query_params[:'ending_date'] = ending_date
|
114
|
+
|
115
|
+
# header parameters
|
116
|
+
header_params = opts[:header_params] || {}
|
117
|
+
# HTTP header 'Accept' (if needed)
|
118
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
119
|
+
|
120
|
+
# form parameters
|
121
|
+
form_params = opts[:form_params] || {}
|
122
|
+
|
123
|
+
# http body (model)
|
124
|
+
post_body = opts[:debug_body]
|
125
|
+
|
126
|
+
# return_type
|
127
|
+
return_type = opts[:debug_return_type] || 'GetAccountStatement200Response'
|
128
|
+
|
129
|
+
# auth_names
|
130
|
+
auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
|
131
|
+
|
132
|
+
new_options = opts.merge(
|
133
|
+
:operation => :"AccountApi.get_account_statement",
|
134
|
+
:header_params => header_params,
|
135
|
+
:query_params => query_params,
|
136
|
+
:form_params => form_params,
|
137
|
+
:body => post_body,
|
138
|
+
:auth_names => auth_names,
|
139
|
+
:return_type => return_type
|
140
|
+
)
|
141
|
+
|
142
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
143
|
+
if @api_client.config.debugging
|
144
|
+
@api_client.config.logger.debug "API called: AccountApi#get_account_statement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
145
|
+
end
|
146
|
+
return data, status_code, headers
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|