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
@@ -0,0 +1,214 @@
|
|
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 AttributeApi
|
16
|
+
attr_accessor :api_client
|
17
|
+
|
18
|
+
def initialize(api_client = ApiClient.default)
|
19
|
+
@api_client = api_client
|
20
|
+
end
|
21
|
+
# Get user attributes for destination_token
|
22
|
+
# This **GET** endpoint is used to retrieve user attributes for a specific destination token. <br> You can use this endpoint to retrieve user attributes and provide personalized service to your users based on their preferences, demographic data, or other relevant information. <br> To use this endpoint, you need to provide the `user_token`, `destination_token`, and currency as parameters in the URL Path. <br> The endpoint will then return all the required attributes for the provided user for the specified destination token. If any of the attributes already have a stored value, it will be returned as well.
|
23
|
+
# @param currency [String] The destination currency sending funds to. Using [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format.
|
24
|
+
# @param user_token [String] Token representing the user to retrieve attributes for
|
25
|
+
# @param destination_token [String] Token that represents the payout destination i.e. Omnex->Brazil->Bank Deposit->Itau. To be retrieved from the #pricing callback.
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @option opts [String] :idempotency_key Unique key to prevent duplicate processing
|
28
|
+
# @return [Array<AttrsRequirement>]
|
29
|
+
def get_attrs(currency, user_token, destination_token, opts = {})
|
30
|
+
data, _status_code, _headers = get_attrs_with_http_info(currency, user_token, destination_token, opts)
|
31
|
+
data
|
32
|
+
end
|
33
|
+
|
34
|
+
# Get user attributes for destination_token
|
35
|
+
# This **GET** endpoint is used to retrieve user attributes for a specific destination token. <br> You can use this endpoint to retrieve user attributes and provide personalized service to your users based on their preferences, demographic data, or other relevant information. <br> To use this endpoint, you need to provide the `user_token`, `destination_token`, and currency as parameters in the URL Path. <br> The endpoint will then return all the required attributes for the provided user for the specified destination token. If any of the attributes already have a stored value, it will be returned as well.
|
36
|
+
# @param currency [String] The destination currency sending funds to. Using [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format.
|
37
|
+
# @param user_token [String] Token representing the user to retrieve attributes for
|
38
|
+
# @param destination_token [String] Token that represents the payout destination i.e. Omnex->Brazil->Bank Deposit->Itau. To be retrieved from the #pricing callback.
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @option opts [String] :idempotency_key Unique key to prevent duplicate processing
|
41
|
+
# @return [Array<(Array<AttrsRequirement>, Integer, Hash)>] Array<AttrsRequirement> data, response status code and response headers
|
42
|
+
def get_attrs_with_http_info(currency, user_token, destination_token, opts = {})
|
43
|
+
if @api_client.config.debugging
|
44
|
+
@api_client.config.logger.debug 'Calling API: AttributeApi.get_attrs ...'
|
45
|
+
end
|
46
|
+
# verify the required parameter 'currency' is set
|
47
|
+
if @api_client.config.client_side_validation && currency.nil?
|
48
|
+
fail ArgumentError, "Missing the required parameter 'currency' when calling AttributeApi.get_attrs"
|
49
|
+
end
|
50
|
+
if @api_client.config.client_side_validation && currency.to_s.length > 3
|
51
|
+
fail ArgumentError, 'invalid value for "currency" when calling AttributeApi.get_attrs, the character length must be smaller than or equal to 3.'
|
52
|
+
end
|
53
|
+
|
54
|
+
if @api_client.config.client_side_validation && currency.to_s.length < 3
|
55
|
+
fail ArgumentError, 'invalid value for "currency" when calling AttributeApi.get_attrs, the character length must be great than or equal to 3.'
|
56
|
+
end
|
57
|
+
|
58
|
+
pattern = Regexp.new(/^[A-Z]{3}$/)
|
59
|
+
if @api_client.config.client_side_validation && currency !~ pattern
|
60
|
+
fail ArgumentError, "invalid value for 'currency' when calling AttributeApi.get_attrs, must conform to the pattern #{pattern}."
|
61
|
+
end
|
62
|
+
|
63
|
+
# verify the required parameter 'user_token' is set
|
64
|
+
if @api_client.config.client_side_validation && user_token.nil?
|
65
|
+
fail ArgumentError, "Missing the required parameter 'user_token' when calling AttributeApi.get_attrs"
|
66
|
+
end
|
67
|
+
# verify the required parameter 'destination_token' is set
|
68
|
+
if @api_client.config.client_side_validation && destination_token.nil?
|
69
|
+
fail ArgumentError, "Missing the required parameter 'destination_token' when calling AttributeApi.get_attrs"
|
70
|
+
end
|
71
|
+
# resource path
|
72
|
+
local_var_path = '/attribute/{user_token}/{destination_token}/{currency}'.sub('{' + 'currency' + '}', CGI.escape(currency.to_s)).sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s)).sub('{' + 'destination_token' + '}', CGI.escape(destination_token.to_s))
|
73
|
+
|
74
|
+
# query parameters
|
75
|
+
query_params = opts[:query_params] || {}
|
76
|
+
|
77
|
+
# header parameters
|
78
|
+
header_params = opts[:header_params] || {}
|
79
|
+
# HTTP header 'Accept' (if needed)
|
80
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
81
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
82
|
+
|
83
|
+
# form parameters
|
84
|
+
form_params = opts[:form_params] || {}
|
85
|
+
|
86
|
+
# http body (model)
|
87
|
+
post_body = opts[:debug_body]
|
88
|
+
|
89
|
+
# return_type
|
90
|
+
return_type = opts[:debug_return_type] || 'Array<AttrsRequirement>'
|
91
|
+
|
92
|
+
# auth_names
|
93
|
+
auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
|
94
|
+
|
95
|
+
new_options = opts.merge(
|
96
|
+
:operation => :"AttributeApi.get_attrs",
|
97
|
+
:header_params => header_params,
|
98
|
+
:query_params => query_params,
|
99
|
+
:form_params => form_params,
|
100
|
+
:body => post_body,
|
101
|
+
:auth_names => auth_names,
|
102
|
+
:return_type => return_type
|
103
|
+
)
|
104
|
+
|
105
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
106
|
+
if @api_client.config.debugging
|
107
|
+
@api_client.config.logger.debug "API called: AttributeApi#get_attrs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
108
|
+
end
|
109
|
+
return data, status_code, headers
|
110
|
+
end
|
111
|
+
|
112
|
+
# Store user attributes
|
113
|
+
# This **POST** endpoint is used to store user attributes, allowing you to associate additional data with a user token. <br> To use this endpoint, you need to provide the `user_token`, `destination_token`, and currency as parameters in the URL Path. You also need to provide the attribute values as JSON parameters in the Request body. <br> If existing attributes are already stored for the user, this call will override their values.
|
114
|
+
# @param currency [String] The destination currency sending funds to. Using [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format.
|
115
|
+
# @param user_token [String] Token representing the user to store attributes for
|
116
|
+
# @param destination_token [String] Token that represents the payout destination i.e. Omnex->Brazil->Bank Deposit->Itau. To be retrieved from the #pricing callback.
|
117
|
+
# @param attr_txn [AttrTxn] Attr parameters to store
|
118
|
+
# @param [Hash] opts the optional parameters
|
119
|
+
# @option opts [String] :idempotency_key Unique key to prevent duplicate processing
|
120
|
+
# @return [nil]
|
121
|
+
def store_attrs(currency, user_token, destination_token, attr_txn, opts = {})
|
122
|
+
store_attrs_with_http_info(currency, user_token, destination_token, attr_txn, opts)
|
123
|
+
nil
|
124
|
+
end
|
125
|
+
|
126
|
+
# Store user attributes
|
127
|
+
# This **POST** endpoint is used to store user attributes, allowing you to associate additional data with a user token. <br> To use this endpoint, you need to provide the `user_token`, `destination_token`, and currency as parameters in the URL Path. You also need to provide the attribute values as JSON parameters in the Request body. <br> If existing attributes are already stored for the user, this call will override their values.
|
128
|
+
# @param currency [String] The destination currency sending funds to. Using [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format.
|
129
|
+
# @param user_token [String] Token representing the user to store attributes for
|
130
|
+
# @param destination_token [String] Token that represents the payout destination i.e. Omnex->Brazil->Bank Deposit->Itau. To be retrieved from the #pricing callback.
|
131
|
+
# @param attr_txn [AttrTxn] Attr parameters to store
|
132
|
+
# @param [Hash] opts the optional parameters
|
133
|
+
# @option opts [String] :idempotency_key Unique key to prevent duplicate processing
|
134
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
135
|
+
def store_attrs_with_http_info(currency, user_token, destination_token, attr_txn, opts = {})
|
136
|
+
if @api_client.config.debugging
|
137
|
+
@api_client.config.logger.debug 'Calling API: AttributeApi.store_attrs ...'
|
138
|
+
end
|
139
|
+
# verify the required parameter 'currency' is set
|
140
|
+
if @api_client.config.client_side_validation && currency.nil?
|
141
|
+
fail ArgumentError, "Missing the required parameter 'currency' when calling AttributeApi.store_attrs"
|
142
|
+
end
|
143
|
+
if @api_client.config.client_side_validation && currency.to_s.length > 3
|
144
|
+
fail ArgumentError, 'invalid value for "currency" when calling AttributeApi.store_attrs, the character length must be smaller than or equal to 3.'
|
145
|
+
end
|
146
|
+
|
147
|
+
if @api_client.config.client_side_validation && currency.to_s.length < 3
|
148
|
+
fail ArgumentError, 'invalid value for "currency" when calling AttributeApi.store_attrs, the character length must be great than or equal to 3.'
|
149
|
+
end
|
150
|
+
|
151
|
+
pattern = Regexp.new(/^[A-Z]{3}$/)
|
152
|
+
if @api_client.config.client_side_validation && currency !~ pattern
|
153
|
+
fail ArgumentError, "invalid value for 'currency' when calling AttributeApi.store_attrs, must conform to the pattern #{pattern}."
|
154
|
+
end
|
155
|
+
|
156
|
+
# verify the required parameter 'user_token' is set
|
157
|
+
if @api_client.config.client_side_validation && user_token.nil?
|
158
|
+
fail ArgumentError, "Missing the required parameter 'user_token' when calling AttributeApi.store_attrs"
|
159
|
+
end
|
160
|
+
# verify the required parameter 'destination_token' is set
|
161
|
+
if @api_client.config.client_side_validation && destination_token.nil?
|
162
|
+
fail ArgumentError, "Missing the required parameter 'destination_token' when calling AttributeApi.store_attrs"
|
163
|
+
end
|
164
|
+
# verify the required parameter 'attr_txn' is set
|
165
|
+
if @api_client.config.client_side_validation && attr_txn.nil?
|
166
|
+
fail ArgumentError, "Missing the required parameter 'attr_txn' when calling AttributeApi.store_attrs"
|
167
|
+
end
|
168
|
+
# resource path
|
169
|
+
local_var_path = '/attribute/{user_token}/{destination_token}/{currency}'.sub('{' + 'currency' + '}', CGI.escape(currency.to_s)).sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s)).sub('{' + 'destination_token' + '}', CGI.escape(destination_token.to_s))
|
170
|
+
|
171
|
+
# query parameters
|
172
|
+
query_params = opts[:query_params] || {}
|
173
|
+
|
174
|
+
# header parameters
|
175
|
+
header_params = opts[:header_params] || {}
|
176
|
+
# HTTP header 'Accept' (if needed)
|
177
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
178
|
+
# HTTP header 'Content-Type'
|
179
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
180
|
+
if !content_type.nil?
|
181
|
+
header_params['Content-Type'] = content_type
|
182
|
+
end
|
183
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
184
|
+
|
185
|
+
# form parameters
|
186
|
+
form_params = opts[:form_params] || {}
|
187
|
+
|
188
|
+
# http body (model)
|
189
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(attr_txn)
|
190
|
+
|
191
|
+
# return_type
|
192
|
+
return_type = opts[:debug_return_type]
|
193
|
+
|
194
|
+
# auth_names
|
195
|
+
auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
|
196
|
+
|
197
|
+
new_options = opts.merge(
|
198
|
+
:operation => :"AttributeApi.store_attrs",
|
199
|
+
:header_params => header_params,
|
200
|
+
:query_params => query_params,
|
201
|
+
:form_params => form_params,
|
202
|
+
:body => post_body,
|
203
|
+
:auth_names => auth_names,
|
204
|
+
:return_type => return_type
|
205
|
+
)
|
206
|
+
|
207
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
208
|
+
if @api_client.config.debugging
|
209
|
+
@api_client.config.logger.debug "API called: AttributeApi#store_attrs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
210
|
+
end
|
211
|
+
return data, status_code, headers
|
212
|
+
end
|
213
|
+
end
|
214
|
+
end
|
@@ -0,0 +1,174 @@
|
|
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 CardApi
|
16
|
+
attr_accessor :api_client
|
17
|
+
|
18
|
+
def initialize(api_client = ApiClient.default)
|
19
|
+
@api_client = api_client
|
20
|
+
end
|
21
|
+
# Get MassPay Card Information
|
22
|
+
# 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.
|
23
|
+
# @param user_token [String] Token representing the user who owns the wallet
|
24
|
+
# @param wallet_token [String] Token representing the wallet
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [GetWalletCardInfo200Response]
|
27
|
+
def get_wallet_card_info(user_token, wallet_token, opts = {})
|
28
|
+
data, _status_code, _headers = get_wallet_card_info_with_http_info(user_token, wallet_token, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Get MassPay Card Information
|
33
|
+
# 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.
|
34
|
+
# @param user_token [String] Token representing the user who owns the wallet
|
35
|
+
# @param wallet_token [String] Token representing the wallet
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @return [Array<(GetWalletCardInfo200Response, Integer, Hash)>] GetWalletCardInfo200Response data, response status code and response headers
|
38
|
+
def get_wallet_card_info_with_http_info(user_token, wallet_token, opts = {})
|
39
|
+
if @api_client.config.debugging
|
40
|
+
@api_client.config.logger.debug 'Calling API: CardApi.get_wallet_card_info ...'
|
41
|
+
end
|
42
|
+
# verify the required parameter 'user_token' is set
|
43
|
+
if @api_client.config.client_side_validation && user_token.nil?
|
44
|
+
fail ArgumentError, "Missing the required parameter 'user_token' when calling CardApi.get_wallet_card_info"
|
45
|
+
end
|
46
|
+
# verify the required parameter 'wallet_token' is set
|
47
|
+
if @api_client.config.client_side_validation && wallet_token.nil?
|
48
|
+
fail ArgumentError, "Missing the required parameter 'wallet_token' when calling CardApi.get_wallet_card_info"
|
49
|
+
end
|
50
|
+
# resource path
|
51
|
+
local_var_path = '/wallet/{user_token}/{wallet_token}/card'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s)).sub('{' + 'wallet_token' + '}', CGI.escape(wallet_token.to_s))
|
52
|
+
|
53
|
+
# query parameters
|
54
|
+
query_params = opts[:query_params] || {}
|
55
|
+
|
56
|
+
# header parameters
|
57
|
+
header_params = opts[:header_params] || {}
|
58
|
+
# HTTP header 'Accept' (if needed)
|
59
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
60
|
+
|
61
|
+
# form parameters
|
62
|
+
form_params = opts[:form_params] || {}
|
63
|
+
|
64
|
+
# http body (model)
|
65
|
+
post_body = opts[:debug_body]
|
66
|
+
|
67
|
+
# return_type
|
68
|
+
return_type = opts[:debug_return_type] || 'GetWalletCardInfo200Response'
|
69
|
+
|
70
|
+
# auth_names
|
71
|
+
auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
|
72
|
+
|
73
|
+
new_options = opts.merge(
|
74
|
+
:operation => :"CardApi.get_wallet_card_info",
|
75
|
+
:header_params => header_params,
|
76
|
+
:query_params => query_params,
|
77
|
+
:form_params => form_params,
|
78
|
+
:body => post_body,
|
79
|
+
:auth_names => auth_names,
|
80
|
+
:return_type => return_type
|
81
|
+
)
|
82
|
+
|
83
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
84
|
+
if @api_client.config.debugging
|
85
|
+
@api_client.config.logger.debug "API called: CardApi#get_wallet_card_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
86
|
+
end
|
87
|
+
return data, status_code, headers
|
88
|
+
end
|
89
|
+
|
90
|
+
# Update MassPay Card Information
|
91
|
+
# 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.
|
92
|
+
# @param user_token [String] Token representing the user who owns the wallet
|
93
|
+
# @param wallet_token [String] Token representing the wallet
|
94
|
+
# @param [Hash] opts the optional parameters
|
95
|
+
# @option opts [String] :pin New 4 digit pin number for the card (To be used in ATM machines)
|
96
|
+
# @option opts [String] :status New status for the card
|
97
|
+
# @return [nil]
|
98
|
+
def update_wallet_card_info(user_token, wallet_token, opts = {})
|
99
|
+
update_wallet_card_info_with_http_info(user_token, wallet_token, opts)
|
100
|
+
nil
|
101
|
+
end
|
102
|
+
|
103
|
+
# Update MassPay Card Information
|
104
|
+
# 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.
|
105
|
+
# @param user_token [String] Token representing the user who owns the wallet
|
106
|
+
# @param wallet_token [String] Token representing the wallet
|
107
|
+
# @param [Hash] opts the optional parameters
|
108
|
+
# @option opts [String] :pin New 4 digit pin number for the card (To be used in ATM machines)
|
109
|
+
# @option opts [String] :status New status for the card
|
110
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
111
|
+
def update_wallet_card_info_with_http_info(user_token, wallet_token, opts = {})
|
112
|
+
if @api_client.config.debugging
|
113
|
+
@api_client.config.logger.debug 'Calling API: CardApi.update_wallet_card_info ...'
|
114
|
+
end
|
115
|
+
# verify the required parameter 'user_token' is set
|
116
|
+
if @api_client.config.client_side_validation && user_token.nil?
|
117
|
+
fail ArgumentError, "Missing the required parameter 'user_token' when calling CardApi.update_wallet_card_info"
|
118
|
+
end
|
119
|
+
# verify the required parameter 'wallet_token' is set
|
120
|
+
if @api_client.config.client_side_validation && wallet_token.nil?
|
121
|
+
fail ArgumentError, "Missing the required parameter 'wallet_token' when calling CardApi.update_wallet_card_info"
|
122
|
+
end
|
123
|
+
pattern = Regexp.new(/^[0-9]{4}$/)
|
124
|
+
if @api_client.config.client_side_validation && !opts[:'pin'].nil? && opts[:'pin'] !~ pattern
|
125
|
+
fail ArgumentError, "invalid value for 'opts[:\"pin\"]' when calling CardApi.update_wallet_card_info, must conform to the pattern #{pattern}."
|
126
|
+
end
|
127
|
+
|
128
|
+
allowable_values = ["SUSPEND", "UNSUSPEND", "CLOSE"]
|
129
|
+
if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
|
130
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
|
131
|
+
end
|
132
|
+
# resource path
|
133
|
+
local_var_path = '/wallet/{user_token}/{wallet_token}/card'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s)).sub('{' + 'wallet_token' + '}', CGI.escape(wallet_token.to_s))
|
134
|
+
|
135
|
+
# query parameters
|
136
|
+
query_params = opts[:query_params] || {}
|
137
|
+
query_params[:'pin'] = opts[:'pin'] if !opts[:'pin'].nil?
|
138
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
139
|
+
|
140
|
+
# header parameters
|
141
|
+
header_params = opts[:header_params] || {}
|
142
|
+
# HTTP header 'Accept' (if needed)
|
143
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
144
|
+
|
145
|
+
# form parameters
|
146
|
+
form_params = opts[:form_params] || {}
|
147
|
+
|
148
|
+
# http body (model)
|
149
|
+
post_body = opts[:debug_body]
|
150
|
+
|
151
|
+
# return_type
|
152
|
+
return_type = opts[:debug_return_type]
|
153
|
+
|
154
|
+
# auth_names
|
155
|
+
auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
|
156
|
+
|
157
|
+
new_options = opts.merge(
|
158
|
+
:operation => :"CardApi.update_wallet_card_info",
|
159
|
+
:header_params => header_params,
|
160
|
+
:query_params => query_params,
|
161
|
+
:form_params => form_params,
|
162
|
+
:body => post_body,
|
163
|
+
:auth_names => auth_names,
|
164
|
+
:return_type => return_type
|
165
|
+
)
|
166
|
+
|
167
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
168
|
+
if @api_client.config.debugging
|
169
|
+
@api_client.config.logger.debug "API called: CardApi#update_wallet_card_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
170
|
+
end
|
171
|
+
return data, status_code, headers
|
172
|
+
end
|
173
|
+
end
|
174
|
+
end
|