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/UserApi.md
ADDED
@@ -0,0 +1,403 @@
|
|
1
|
+
# MassPayRubySdk::UserApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://api.masspay.io/v0.1.4*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**create_user**](UserApi.md#create_user) | **POST** /user | Create a user |
|
8
|
+
| [**get_user_by_token**](UserApi.md#get_user_by_token) | **GET** /user/{user_token} | Get user by user token |
|
9
|
+
| [**get_user_history**](UserApi.md#get_user_history) | **GET** /user/{user_token}/history | Transactions history |
|
10
|
+
| [**update_user**](UserApi.md#update_user) | **PUT** /user/{user_token} | Updated user |
|
11
|
+
| [**user_lookup**](UserApi.md#user_lookup) | **GET** /user/lookup | Lookup an existing user |
|
12
|
+
|
13
|
+
|
14
|
+
## create_user
|
15
|
+
|
16
|
+
> <StoredUser> create_user(user)
|
17
|
+
|
18
|
+
Create a user
|
19
|
+
|
20
|
+
This **POST** endpoint is used to create a new user in MassPay. <br> You can use this endpoint to create a new user with the specified user details in JSON format in the request Body. <br> To use this endpoint, you need to provide the `internal_user_id`, `country`, `first_name`, `last_name`, and `email` as required parameters in the Request Body. <br> The response will include details about the newly created user.
|
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::UserApi.new
|
36
|
+
user = MassPayRubySdk::User.new({internal_user_id: '4324-rOzk', country: 'USA', first_name: 'John', last_name: 'Doe', email: 'jdoe@gmail.com'}) # User | Created user object
|
37
|
+
|
38
|
+
begin
|
39
|
+
# Create a user
|
40
|
+
result = api_instance.create_user(user)
|
41
|
+
p result
|
42
|
+
rescue MassPayRubySdk::ApiError => e
|
43
|
+
puts "Error when calling UserApi->create_user: #{e}"
|
44
|
+
end
|
45
|
+
```
|
46
|
+
|
47
|
+
#### Using the create_user_with_http_info variant
|
48
|
+
|
49
|
+
This returns an Array which contains the response data, status code and headers.
|
50
|
+
|
51
|
+
> <Array(<StoredUser>, Integer, Hash)> create_user_with_http_info(user)
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
begin
|
55
|
+
# Create a user
|
56
|
+
data, status_code, headers = api_instance.create_user_with_http_info(user)
|
57
|
+
p status_code # => 2xx
|
58
|
+
p headers # => { ... }
|
59
|
+
p data # => <StoredUser>
|
60
|
+
rescue MassPayRubySdk::ApiError => e
|
61
|
+
puts "Error when calling UserApi->create_user_with_http_info: #{e}"
|
62
|
+
end
|
63
|
+
```
|
64
|
+
|
65
|
+
### Parameters
|
66
|
+
|
67
|
+
| Name | Type | Description | Notes |
|
68
|
+
| ---- | ---- | ----------- | ----- |
|
69
|
+
| **user** | [**User**](User.md) | Created user object | |
|
70
|
+
|
71
|
+
### Return type
|
72
|
+
|
73
|
+
[**StoredUser**](StoredUser.md)
|
74
|
+
|
75
|
+
### Authorization
|
76
|
+
|
77
|
+
[AUTHORIZER_NAME](../README.md#AUTHORIZER_NAME)
|
78
|
+
|
79
|
+
### HTTP request headers
|
80
|
+
|
81
|
+
- **Content-Type**: application/json
|
82
|
+
- **Accept**: application/json
|
83
|
+
|
84
|
+
|
85
|
+
## get_user_by_token
|
86
|
+
|
87
|
+
> <StoredUser> get_user_by_token(user_token, opts)
|
88
|
+
|
89
|
+
Get user by user token
|
90
|
+
|
91
|
+
This **GET** endpoint is used to retrieve a user's profile by their user token in MassPay. <br> You can use this endpoint to obtain a user profile for a specified 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 all available details for the user.
|
92
|
+
|
93
|
+
### Examples
|
94
|
+
|
95
|
+
```ruby
|
96
|
+
require 'time'
|
97
|
+
require 'masspay_ruby_sdk'
|
98
|
+
# setup authorization
|
99
|
+
MassPayRubySdk.configure do |config|
|
100
|
+
# Configure API key authorization: AUTHORIZER_NAME
|
101
|
+
config.api_key['AUTHORIZER_NAME'] = 'YOUR API KEY'
|
102
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
103
|
+
# config.api_key_prefix['AUTHORIZER_NAME'] = 'Bearer'
|
104
|
+
end
|
105
|
+
|
106
|
+
api_instance = MassPayRubySdk::UserApi.new
|
107
|
+
user_token = 'user_token_example' # String | The user token that needs to be fetched.
|
108
|
+
opts = {
|
109
|
+
idempotency_key: 'idempotency_key_example' # String | Unique key to prevent duplicate processing
|
110
|
+
}
|
111
|
+
|
112
|
+
begin
|
113
|
+
# Get user by user token
|
114
|
+
result = api_instance.get_user_by_token(user_token, opts)
|
115
|
+
p result
|
116
|
+
rescue MassPayRubySdk::ApiError => e
|
117
|
+
puts "Error when calling UserApi->get_user_by_token: #{e}"
|
118
|
+
end
|
119
|
+
```
|
120
|
+
|
121
|
+
#### Using the get_user_by_token_with_http_info variant
|
122
|
+
|
123
|
+
This returns an Array which contains the response data, status code and headers.
|
124
|
+
|
125
|
+
> <Array(<StoredUser>, Integer, Hash)> get_user_by_token_with_http_info(user_token, opts)
|
126
|
+
|
127
|
+
```ruby
|
128
|
+
begin
|
129
|
+
# Get user by user token
|
130
|
+
data, status_code, headers = api_instance.get_user_by_token_with_http_info(user_token, opts)
|
131
|
+
p status_code # => 2xx
|
132
|
+
p headers # => { ... }
|
133
|
+
p data # => <StoredUser>
|
134
|
+
rescue MassPayRubySdk::ApiError => e
|
135
|
+
puts "Error when calling UserApi->get_user_by_token_with_http_info: #{e}"
|
136
|
+
end
|
137
|
+
```
|
138
|
+
|
139
|
+
### Parameters
|
140
|
+
|
141
|
+
| Name | Type | Description | Notes |
|
142
|
+
| ---- | ---- | ----------- | ----- |
|
143
|
+
| **user_token** | **String** | The user token that needs to be fetched. | |
|
144
|
+
| **idempotency_key** | **String** | Unique key to prevent duplicate processing | [optional] |
|
145
|
+
|
146
|
+
### Return type
|
147
|
+
|
148
|
+
[**StoredUser**](StoredUser.md)
|
149
|
+
|
150
|
+
### Authorization
|
151
|
+
|
152
|
+
[AUTHORIZER_NAME](../README.md#AUTHORIZER_NAME)
|
153
|
+
|
154
|
+
### HTTP request headers
|
155
|
+
|
156
|
+
- **Content-Type**: Not defined
|
157
|
+
- **Accept**: application/json
|
158
|
+
|
159
|
+
|
160
|
+
## get_user_history
|
161
|
+
|
162
|
+
> <Array<TxnHistoryResp>> get_user_history(user_token, opts)
|
163
|
+
|
164
|
+
Transactions history
|
165
|
+
|
166
|
+
This **GET** endpoint is used to retrieve a list of all transactions, including payouts, loads, and spendbacks, for a provider user with the provided user token. <br> You can use this endpoint to obtain a comprehensive history of transactions for the provider user, allowing you to track and analyze their payment activities over time. <br> To use this endpoint, you need to provide the `user_token` as a parameter in the URL Path. <br> The response will contain a JSON array of transaction objects, each including transactions details.
|
167
|
+
|
168
|
+
### Examples
|
169
|
+
|
170
|
+
```ruby
|
171
|
+
require 'time'
|
172
|
+
require 'masspay_ruby_sdk'
|
173
|
+
# setup authorization
|
174
|
+
MassPayRubySdk.configure do |config|
|
175
|
+
# Configure API key authorization: AUTHORIZER_NAME
|
176
|
+
config.api_key['AUTHORIZER_NAME'] = 'YOUR API KEY'
|
177
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
178
|
+
# config.api_key_prefix['AUTHORIZER_NAME'] = 'Bearer'
|
179
|
+
end
|
180
|
+
|
181
|
+
api_instance = MassPayRubySdk::UserApi.new
|
182
|
+
user_token = 'usr_f4741aa2-9f39-4358-8247-2409e3fc2715' # String | Token representing the user to get transactions history for
|
183
|
+
opts = {
|
184
|
+
idempotency_key: 'idempotency_key_example', # String | Unique key to prevent duplicate processing
|
185
|
+
number_of_records: 8.14, # Float | Number of records to return
|
186
|
+
start_date: Date.parse('Tue Mar 31 02:00:00 CEST 2020'), # Date | Starting date
|
187
|
+
end_date: Date.parse('Tue Mar 31 02:00:00 CEST 2020'), # Date | Ending date
|
188
|
+
page: 56, # Integer | Page number
|
189
|
+
type: 'payout', # String | Filter particular types of transactions. Comma separated to include multiple types
|
190
|
+
wallet_token: '38400000-8cf0-11bd-b23e-10b96e4ef00d', # String | Filter transactions to include only provided wallet token.
|
191
|
+
show_all_clients: true # Boolean | Wether to show transactions from all clients
|
192
|
+
}
|
193
|
+
|
194
|
+
begin
|
195
|
+
# Transactions history
|
196
|
+
result = api_instance.get_user_history(user_token, opts)
|
197
|
+
p result
|
198
|
+
rescue MassPayRubySdk::ApiError => e
|
199
|
+
puts "Error when calling UserApi->get_user_history: #{e}"
|
200
|
+
end
|
201
|
+
```
|
202
|
+
|
203
|
+
#### Using the get_user_history_with_http_info variant
|
204
|
+
|
205
|
+
This returns an Array which contains the response data, status code and headers.
|
206
|
+
|
207
|
+
> <Array(<Array<TxnHistoryResp>>, Integer, Hash)> get_user_history_with_http_info(user_token, opts)
|
208
|
+
|
209
|
+
```ruby
|
210
|
+
begin
|
211
|
+
# Transactions history
|
212
|
+
data, status_code, headers = api_instance.get_user_history_with_http_info(user_token, opts)
|
213
|
+
p status_code # => 2xx
|
214
|
+
p headers # => { ... }
|
215
|
+
p data # => <Array<TxnHistoryResp>>
|
216
|
+
rescue MassPayRubySdk::ApiError => e
|
217
|
+
puts "Error when calling UserApi->get_user_history_with_http_info: #{e}"
|
218
|
+
end
|
219
|
+
```
|
220
|
+
|
221
|
+
### Parameters
|
222
|
+
|
223
|
+
| Name | Type | Description | Notes |
|
224
|
+
| ---- | ---- | ----------- | ----- |
|
225
|
+
| **user_token** | **String** | Token representing the user to get transactions history for | |
|
226
|
+
| **idempotency_key** | **String** | Unique key to prevent duplicate processing | [optional] |
|
227
|
+
| **number_of_records** | **Float** | Number of records to return | [optional][default to 10] |
|
228
|
+
| **start_date** | **Date** | Starting date | [optional] |
|
229
|
+
| **end_date** | **Date** | Ending date | [optional] |
|
230
|
+
| **page** | **Integer** | Page number | [optional][default to 1] |
|
231
|
+
| **type** | **String** | Filter particular types of transactions. Comma separated to include multiple types | [optional] |
|
232
|
+
| **wallet_token** | **String** | Filter transactions to include only provided wallet token. | [optional] |
|
233
|
+
| **show_all_clients** | **Boolean** | Wether to show transactions from all clients | [optional][default to false] |
|
234
|
+
|
235
|
+
### Return type
|
236
|
+
|
237
|
+
[**Array<TxnHistoryResp>**](TxnHistoryResp.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
|
+
## update_user
|
250
|
+
|
251
|
+
> <StoredUser> update_user(user_token, update_user, opts)
|
252
|
+
|
253
|
+
Updated user
|
254
|
+
|
255
|
+
This **PUT** endpoint is used to update the profile information of a user with the provided user token. <br> You need to provide the `user_token` in the URL path to identify the user whose information you want to update. The updated information should be provided in the request Body as a JSON object. This endpoint can be used to update various profile information, such as the user's name, email address, phone number, and more. <br> The response will contain the updated user information in a JSON format.
|
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::UserApi.new
|
271
|
+
user_token = 'user_token_example' # String | user token that need to be updated
|
272
|
+
update_user = MassPayRubySdk::UpdateUser.new({status: 'ACTIVE', internal_user_id: '4324-rOzk', address1: '2000 main st', city: 'Santa Monica', state_province: 'CA', postal_code: '90405', country: 'USA', first_name: 'John', last_name: 'Doe', email: 'jdoe@gmail.com'}) # UpdateUser | Updated user object
|
273
|
+
opts = {
|
274
|
+
idempotency_key: 'idempotency_key_example' # String | Unique key to prevent duplicate processing
|
275
|
+
}
|
276
|
+
|
277
|
+
begin
|
278
|
+
# Updated user
|
279
|
+
result = api_instance.update_user(user_token, update_user, opts)
|
280
|
+
p result
|
281
|
+
rescue MassPayRubySdk::ApiError => e
|
282
|
+
puts "Error when calling UserApi->update_user: #{e}"
|
283
|
+
end
|
284
|
+
```
|
285
|
+
|
286
|
+
#### Using the update_user_with_http_info variant
|
287
|
+
|
288
|
+
This returns an Array which contains the response data, status code and headers.
|
289
|
+
|
290
|
+
> <Array(<StoredUser>, Integer, Hash)> update_user_with_http_info(user_token, update_user, opts)
|
291
|
+
|
292
|
+
```ruby
|
293
|
+
begin
|
294
|
+
# Updated user
|
295
|
+
data, status_code, headers = api_instance.update_user_with_http_info(user_token, update_user, opts)
|
296
|
+
p status_code # => 2xx
|
297
|
+
p headers # => { ... }
|
298
|
+
p data # => <StoredUser>
|
299
|
+
rescue MassPayRubySdk::ApiError => e
|
300
|
+
puts "Error when calling UserApi->update_user_with_http_info: #{e}"
|
301
|
+
end
|
302
|
+
```
|
303
|
+
|
304
|
+
### Parameters
|
305
|
+
|
306
|
+
| Name | Type | Description | Notes |
|
307
|
+
| ---- | ---- | ----------- | ----- |
|
308
|
+
| **user_token** | **String** | user token that need to be updated | |
|
309
|
+
| **update_user** | [**UpdateUser**](UpdateUser.md) | Updated user object | |
|
310
|
+
| **idempotency_key** | **String** | Unique key to prevent duplicate processing | [optional] |
|
311
|
+
|
312
|
+
### Return type
|
313
|
+
|
314
|
+
[**StoredUser**](StoredUser.md)
|
315
|
+
|
316
|
+
### Authorization
|
317
|
+
|
318
|
+
[AUTHORIZER_NAME](../README.md#AUTHORIZER_NAME)
|
319
|
+
|
320
|
+
### HTTP request headers
|
321
|
+
|
322
|
+
- **Content-Type**: application/json
|
323
|
+
- **Accept**: application/json
|
324
|
+
|
325
|
+
|
326
|
+
## user_lookup
|
327
|
+
|
328
|
+
> <FoundUser> user_lookup(email, first_name, internal_user_id, opts)
|
329
|
+
|
330
|
+
Lookup an existing user
|
331
|
+
|
332
|
+
This **GET** endpoint is used to lookup whether a user with the provided email and first name exists in the MassPay system. <br> To use this endpoint, you need to provide the `email`, `first_name`, and `internal_user_id` as Query parameters in the URL. <br> The endpoint will then search for the user based on the provided information and return a JSON response indicating whether the user exists or not. If the user exists, the response will also contain the user's details, `user_token`, `first_name`, `last_name` and `internal_user_id`.
|
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::UserApi.new
|
348
|
+
email = 'email_example' # String | User's email address. Required if First Name is provided
|
349
|
+
first_name = 'first_name_example' # String | User's first name. Required if email is provided
|
350
|
+
internal_user_id = 'internal_user_id_example' # String | A client-defined identifier for the user. This is the unique ID assigned to the user on your system. Max 75 characters. Allows letters, numbers, and + , - . / _ ~ |. Required if email and first name are not provided
|
351
|
+
opts = {
|
352
|
+
idempotency_key: 'idempotency_key_example' # String | Unique key to prevent duplicate processing
|
353
|
+
}
|
354
|
+
|
355
|
+
begin
|
356
|
+
# Lookup an existing user
|
357
|
+
result = api_instance.user_lookup(email, first_name, internal_user_id, opts)
|
358
|
+
p result
|
359
|
+
rescue MassPayRubySdk::ApiError => e
|
360
|
+
puts "Error when calling UserApi->user_lookup: #{e}"
|
361
|
+
end
|
362
|
+
```
|
363
|
+
|
364
|
+
#### Using the user_lookup_with_http_info variant
|
365
|
+
|
366
|
+
This returns an Array which contains the response data, status code and headers.
|
367
|
+
|
368
|
+
> <Array(<FoundUser>, Integer, Hash)> user_lookup_with_http_info(email, first_name, internal_user_id, opts)
|
369
|
+
|
370
|
+
```ruby
|
371
|
+
begin
|
372
|
+
# Lookup an existing user
|
373
|
+
data, status_code, headers = api_instance.user_lookup_with_http_info(email, first_name, internal_user_id, opts)
|
374
|
+
p status_code # => 2xx
|
375
|
+
p headers # => { ... }
|
376
|
+
p data # => <FoundUser>
|
377
|
+
rescue MassPayRubySdk::ApiError => e
|
378
|
+
puts "Error when calling UserApi->user_lookup_with_http_info: #{e}"
|
379
|
+
end
|
380
|
+
```
|
381
|
+
|
382
|
+
### Parameters
|
383
|
+
|
384
|
+
| Name | Type | Description | Notes |
|
385
|
+
| ---- | ---- | ----------- | ----- |
|
386
|
+
| **email** | **String** | User's email address. Required if First Name is provided | |
|
387
|
+
| **first_name** | **String** | User's first name. Required if email is provided | |
|
388
|
+
| **internal_user_id** | **String** | A client-defined identifier for the user. This is the unique ID assigned to the user on your system. Max 75 characters. Allows letters, numbers, and + , - . / _ ~ |. Required if email and first name are not provided | |
|
389
|
+
| **idempotency_key** | **String** | Unique key to prevent duplicate processing | [optional] |
|
390
|
+
|
391
|
+
### Return type
|
392
|
+
|
393
|
+
[**FoundUser**](FoundUser.md)
|
394
|
+
|
395
|
+
### Authorization
|
396
|
+
|
397
|
+
[AUTHORIZER_NAME](../README.md#AUTHORIZER_NAME)
|
398
|
+
|
399
|
+
### HTTP request headers
|
400
|
+
|
401
|
+
- **Content-Type**: Not defined
|
402
|
+
- **Accept**: application/json
|
403
|
+
|