masspay_ruby_sdk 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/CODE_OF_CONDUCT.md +43 -0
  4. data/CONTRIBUTING.md +48 -9
  5. data/LICENSE.md +21 -0
  6. data/README.md +141 -176
  7. data/assets/logo.webp +0 -0
  8. data/lib/masspay_ruby_sdk/api/account_service.rb +35 -0
  9. data/lib/masspay_ruby_sdk/api/attribute_service.rb +41 -0
  10. data/lib/masspay_ruby_sdk/api/card_service.rb +35 -0
  11. data/lib/masspay_ruby_sdk/api/catalog_service.rb +74 -0
  12. data/lib/masspay_ruby_sdk/api/kyc_service.rb +56 -0
  13. data/lib/masspay_ruby_sdk/api/load_service.rb +62 -0
  14. data/lib/masspay_ruby_sdk/api/payout_service.rb +61 -0
  15. data/lib/masspay_ruby_sdk/api/spend_back_service.rb +35 -0
  16. data/lib/masspay_ruby_sdk/api/subaccount_service.rb +47 -0
  17. data/lib/masspay_ruby_sdk/api/tax_service.rb +38 -0
  18. data/lib/masspay_ruby_sdk/api/user_service.rb +71 -0
  19. data/lib/masspay_ruby_sdk/api/wallet_service.rb +50 -0
  20. data/lib/masspay_ruby_sdk/client.rb +93 -0
  21. data/lib/masspay_ruby_sdk/constants.rb +20 -0
  22. data/lib/masspay_ruby_sdk/version.rb +6 -8
  23. data/lib/masspay_ruby_sdk.rb +23 -75
  24. data/masspay_ruby_sdk.gemspec +9 -13
  25. metadata +24 -120
  26. data/Rakefile +0 -10
  27. data/docs/AccountApi.md +0 -150
  28. data/docs/ApiResponse.md +0 -22
  29. data/docs/AttrTxn.md +0 -20
  30. data/docs/AttrValue.md +0 -20
  31. data/docs/AttrVelocityRequestInner.md +0 -20
  32. data/docs/AttributeApi.md +0 -168
  33. data/docs/AttrsRequirement.md +0 -36
  34. data/docs/AutopayResp.md +0 -22
  35. data/docs/AutopayRule.md +0 -20
  36. data/docs/AvailableBalanceTxnResp.md +0 -22
  37. data/docs/CardApi.md +0 -160
  38. data/docs/CatalogApi.md +0 -469
  39. data/docs/CompaniesResp.md +0 -18
  40. data/docs/Company.md +0 -26
  41. data/docs/Country.md +0 -22
  42. data/docs/Exception.md +0 -20
  43. data/docs/FoundUser.md +0 -24
  44. data/docs/GetAccountStatement200Response.md +0 -18
  45. data/docs/GetTransactionConfirmationDetails200Response.md +0 -18
  46. data/docs/GetUserAgreement200Response.md +0 -26
  47. data/docs/GetUserAgreementsNames200ResponseInner.md +0 -24
  48. data/docs/GetUserUserTokenKycAu10tix200Response.md +0 -18
  49. data/docs/GetUserUserTokenKycVeriff200Response.md +0 -18
  50. data/docs/GetWalletCardInfo200Response.md +0 -30
  51. data/docs/IDUpload.md +0 -20
  52. data/docs/KYCApi.md +0 -305
  53. data/docs/LoadApi.md +0 -621
  54. data/docs/LoadTxn.md +0 -32
  55. data/docs/LoadTxnResp.md +0 -20
  56. data/docs/Loads.md +0 -36
  57. data/docs/PayoutApi.md +0 -403
  58. data/docs/PayoutTxn.md +0 -36
  59. data/docs/PayoutTxnCommitResp.md +0 -24
  60. data/docs/PayoutTxnResp.md +0 -60
  61. data/docs/ResendBalanceNotification200Response.md +0 -18
  62. data/docs/Service.md +0 -22
  63. data/docs/ServicePayersInner.md +0 -38
  64. data/docs/ServicePayersInnerExchangeRateInner.md +0 -20
  65. data/docs/SpendBackApi.md +0 -161
  66. data/docs/SpendBackTxn.md +0 -28
  67. data/docs/SpendBackTxnResp.md +0 -22
  68. data/docs/SpendBacks.md +0 -34
  69. data/docs/StoredUser.md +0 -56
  70. data/docs/TaxApi.md +0 -81
  71. data/docs/TaxYearUserResp.md +0 -48
  72. data/docs/TxnHistoryResp.md +0 -52
  73. data/docs/UpdateUser.md +0 -52
  74. data/docs/User.md +0 -50
  75. data/docs/UserApi.md +0 -403
  76. data/docs/WalletApi.md +0 -463
  77. data/docs/WalletTxnResp.md +0 -34
  78. data/docs/logo.webp +0 -0
  79. data/lib/masspay_ruby_sdk/api/account_api.rb +0 -149
  80. data/lib/masspay_ruby_sdk/api/attribute_api.rb +0 -214
  81. data/lib/masspay_ruby_sdk/api/card_api.rb +0 -174
  82. data/lib/masspay_ruby_sdk/api/catalog_api.rb +0 -443
  83. data/lib/masspay_ruby_sdk/api/kyc_api.rb +0 -290
  84. data/lib/masspay_ruby_sdk/api/load_api.rb +0 -598
  85. data/lib/masspay_ruby_sdk/api/payout_api.rb +0 -397
  86. data/lib/masspay_ruby_sdk/api/spend_back_api.rb +0 -160
  87. data/lib/masspay_ruby_sdk/api/tax_api.rb +0 -82
  88. data/lib/masspay_ruby_sdk/api/user_api.rb +0 -418
  89. data/lib/masspay_ruby_sdk/api/wallet_api.rb +0 -461
  90. data/lib/masspay_ruby_sdk/api_client.rb +0 -391
  91. data/lib/masspay_ruby_sdk/api_error.rb +0 -57
  92. data/lib/masspay_ruby_sdk/configuration.rb +0 -315
  93. data/lib/masspay_ruby_sdk/models/api_response.rb +0 -236
  94. data/lib/masspay_ruby_sdk/models/attr_txn.rb +0 -235
  95. data/lib/masspay_ruby_sdk/models/attr_value.rb +0 -239
  96. data/lib/masspay_ruby_sdk/models/attr_velocity_request_inner.rb +0 -273
  97. data/lib/masspay_ruby_sdk/models/attrs_requirement.rb +0 -372
  98. data/lib/masspay_ruby_sdk/models/autopay_resp.rb +0 -256
  99. data/lib/masspay_ruby_sdk/models/autopay_rule.rb +0 -241
  100. data/lib/masspay_ruby_sdk/models/available_balance_txn_resp.rb +0 -254
  101. data/lib/masspay_ruby_sdk/models/companies_resp.rb +0 -225
  102. data/lib/masspay_ruby_sdk/models/company.rb +0 -285
  103. data/lib/masspay_ruby_sdk/models/country.rb +0 -296
  104. data/lib/masspay_ruby_sdk/models/exception.rb +0 -241
  105. data/lib/masspay_ruby_sdk/models/found_user.rb +0 -270
  106. data/lib/masspay_ruby_sdk/models/get_account_statement200_response.rb +0 -225
  107. data/lib/masspay_ruby_sdk/models/get_transaction_confirmation_details200_response.rb +0 -218
  108. data/lib/masspay_ruby_sdk/models/get_user_agreement200_response.rb +0 -280
  109. data/lib/masspay_ruby_sdk/models/get_user_agreements_names200_response_inner.rb +0 -270
  110. data/lib/masspay_ruby_sdk/models/get_user_user_token_kyc_au10tix200_response.rb +0 -224
  111. data/lib/masspay_ruby_sdk/models/get_user_user_token_kyc_veriff200_response.rb +0 -224
  112. data/lib/masspay_ruby_sdk/models/get_wallet_card_info200_response.rb +0 -460
  113. data/lib/masspay_ruby_sdk/models/id_upload.rb +0 -273
  114. data/lib/masspay_ruby_sdk/models/load_txn.rb +0 -321
  115. data/lib/masspay_ruby_sdk/models/load_txn_resp.rb +0 -273
  116. data/lib/masspay_ruby_sdk/models/loads.rb +0 -388
  117. data/lib/masspay_ruby_sdk/models/payout_txn.rb +0 -328
  118. data/lib/masspay_ruby_sdk/models/payout_txn_commit_resp.rb +0 -293
  119. data/lib/masspay_ruby_sdk/models/payout_txn_resp.rb +0 -613
  120. data/lib/masspay_ruby_sdk/models/resend_balance_notification200_response.rb +0 -225
  121. data/lib/masspay_ruby_sdk/models/service.rb +0 -318
  122. data/lib/masspay_ruby_sdk/models/service_payers_inner.rb +0 -373
  123. data/lib/masspay_ruby_sdk/models/service_payers_inner_exchange_rate_inner.rb +0 -239
  124. data/lib/masspay_ruby_sdk/models/spend_back_txn.rb +0 -325
  125. data/lib/masspay_ruby_sdk/models/spend_back_txn_resp.rb +0 -307
  126. data/lib/masspay_ruby_sdk/models/spend_backs.rb +0 -340
  127. data/lib/masspay_ruby_sdk/models/stored_user.rb +0 -500
  128. data/lib/masspay_ruby_sdk/models/tax_year_user_resp.rb +0 -388
  129. data/lib/masspay_ruby_sdk/models/txn_history_resp.rb +0 -571
  130. data/lib/masspay_ruby_sdk/models/update_user.rb +0 -490
  131. data/lib/masspay_ruby_sdk/models/user.rb +0 -423
  132. data/lib/masspay_ruby_sdk/models/wallet_txn_resp.rb +0 -375
  133. data/spec/api_client_spec.rb +0 -227
  134. data/spec/configuration_spec.rb +0 -41
  135. data/spec/spec_helper.rb +0 -110
@@ -1,461 +0,0 @@
1
- =begin
2
- #MassPay API
3
-
4
- #MassPay API
5
-
6
- The version of the OpenAPI document: 0.1.4
7
- Contact: support@masspay.io
8
- Generated by: MassPay Inc.
9
- OpenAPI Generator version: 6.5.0
10
- =end
11
-
12
- require 'cgi'
13
-
14
- module MassPayRubySdk
15
- class WalletApi
16
- attr_accessor :api_client
17
-
18
- def initialize(api_client = ApiClient.default)
19
- @api_client = api_client
20
- end
21
- # Add autopay rule
22
- # 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.
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
- # @option opts [AutopayRule] :autopay_rule Autopay rule configuration
27
- # @return [AutopayResp]
28
- def create_autopay_rule(user_token, wallet_token, opts = {})
29
- data, _status_code, _headers = create_autopay_rule_with_http_info(user_token, wallet_token, opts)
30
- data
31
- end
32
-
33
- # Add autopay rule
34
- # This **POST** endpoint is used to add an autopay rule that will initiate a payout whenever the provided wallet token is loaded. &lt;br&gt; You can use this endpoint to create an autopay rule that automatically sends a percentage of incoming load to a specific destination. &lt;br&gt; To use this endpoint, you need to provide the &#x60;user_token&#x60; and &#x60;wallet_token&#x60; as required parameters in the URL Path, and the &#x60;destination_token&#x60; and percentage of incoming load that should be autopaid to the &#x60;destination_token&#x60; in the request Body. &lt;br&gt; The response will include a JSON object containing the details of the created autopay rule, including the token, &#x60;destination_token&#x60; and percentage.
35
- # @param user_token [String] Token representing the user who owns the wallet
36
- # @param wallet_token [String] Token representing the wallet
37
- # @param [Hash] opts the optional parameters
38
- # @option opts [AutopayRule] :autopay_rule Autopay rule configuration
39
- # @return [Array<(AutopayResp, Integer, Hash)>] AutopayResp data, response status code and response headers
40
- def create_autopay_rule_with_http_info(user_token, wallet_token, opts = {})
41
- if @api_client.config.debugging
42
- @api_client.config.logger.debug 'Calling API: WalletApi.create_autopay_rule ...'
43
- end
44
- # verify the required parameter 'user_token' is set
45
- if @api_client.config.client_side_validation && user_token.nil?
46
- fail ArgumentError, "Missing the required parameter 'user_token' when calling WalletApi.create_autopay_rule"
47
- end
48
- # verify the required parameter 'wallet_token' is set
49
- if @api_client.config.client_side_validation && wallet_token.nil?
50
- fail ArgumentError, "Missing the required parameter 'wallet_token' when calling WalletApi.create_autopay_rule"
51
- end
52
- # resource path
53
- local_var_path = '/wallet/{user_token}/{wallet_token}/autopay'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s)).sub('{' + 'wallet_token' + '}', CGI.escape(wallet_token.to_s))
54
-
55
- # query parameters
56
- query_params = opts[:query_params] || {}
57
-
58
- # header parameters
59
- header_params = opts[:header_params] || {}
60
- # HTTP header 'Accept' (if needed)
61
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
62
- # HTTP header 'Content-Type'
63
- content_type = @api_client.select_header_content_type(['application/json'])
64
- if !content_type.nil?
65
- header_params['Content-Type'] = content_type
66
- end
67
-
68
- # form parameters
69
- form_params = opts[:form_params] || {}
70
-
71
- # http body (model)
72
- post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'autopay_rule'])
73
-
74
- # return_type
75
- return_type = opts[:debug_return_type] || 'AutopayResp'
76
-
77
- # auth_names
78
- auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
79
-
80
- new_options = opts.merge(
81
- :operation => :"WalletApi.create_autopay_rule",
82
- :header_params => header_params,
83
- :query_params => query_params,
84
- :form_params => form_params,
85
- :body => post_body,
86
- :auth_names => auth_names,
87
- :return_type => return_type
88
- )
89
-
90
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
91
- if @api_client.config.debugging
92
- @api_client.config.logger.debug "API called: WalletApi#create_autopay_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
93
- end
94
- return data, status_code, headers
95
- end
96
-
97
- # Delete autopay rule
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
- # @param user_token [String] Token representing the user who owns the wallet
100
- # @param wallet_token [String] Token representing the wallet
101
- # @param token [String] Autopay token to delete
102
- # @param [Hash] opts the optional parameters
103
- # @return [nil]
104
- def delete_autopay_rule(user_token, wallet_token, token, opts = {})
105
- delete_autopay_rule_with_http_info(user_token, wallet_token, token, opts)
106
- nil
107
- end
108
-
109
- # Delete autopay rule
110
- # This **DELETE** endpoint is used to delete an existing autopay rule. &lt;br&gt; You can use this endpoint to remove an autopay rule that is no longer needed. &lt;br&gt; To use this endpoint, you need to provide the &#x60;user_token&#x60; and &#x60;wallet_token&#x60; as required parameters in the URL Path, and the token of the autopay rule you wish to delete in the request Body. &lt;br&gt; The response will include a message indicating the success of the deletion.
111
- # @param user_token [String] Token representing the user who owns the wallet
112
- # @param wallet_token [String] Token representing the wallet
113
- # @param token [String] Autopay token to delete
114
- # @param [Hash] opts the optional parameters
115
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
116
- def delete_autopay_rule_with_http_info(user_token, wallet_token, token, opts = {})
117
- if @api_client.config.debugging
118
- @api_client.config.logger.debug 'Calling API: WalletApi.delete_autopay_rule ...'
119
- end
120
- # verify the required parameter 'user_token' is set
121
- if @api_client.config.client_side_validation && user_token.nil?
122
- fail ArgumentError, "Missing the required parameter 'user_token' when calling WalletApi.delete_autopay_rule"
123
- end
124
- # verify the required parameter 'wallet_token' is set
125
- if @api_client.config.client_side_validation && wallet_token.nil?
126
- fail ArgumentError, "Missing the required parameter 'wallet_token' when calling WalletApi.delete_autopay_rule"
127
- end
128
- # verify the required parameter 'token' is set
129
- if @api_client.config.client_side_validation && token.nil?
130
- fail ArgumentError, "Missing the required parameter 'token' when calling WalletApi.delete_autopay_rule"
131
- end
132
- # resource path
133
- local_var_path = '/wallet/{user_token}/{wallet_token}/autopay'.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[:'token'] = token
138
-
139
- # header parameters
140
- header_params = opts[:header_params] || {}
141
- # HTTP header 'Accept' (if needed)
142
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
143
-
144
- # form parameters
145
- form_params = opts[:form_params] || {}
146
-
147
- # http body (model)
148
- post_body = opts[:debug_body]
149
-
150
- # return_type
151
- return_type = opts[:debug_return_type]
152
-
153
- # auth_names
154
- auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
155
-
156
- new_options = opts.merge(
157
- :operation => :"WalletApi.delete_autopay_rule",
158
- :header_params => header_params,
159
- :query_params => query_params,
160
- :form_params => form_params,
161
- :body => post_body,
162
- :auth_names => auth_names,
163
- :return_type => return_type
164
- )
165
-
166
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
167
- if @api_client.config.debugging
168
- @api_client.config.logger.debug "API called: WalletApi#delete_autopay_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
169
- end
170
- return data, status_code, headers
171
- end
172
-
173
- # Get all autopay rules
174
- # 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.
175
- # @param user_token [String] Token representing the user who owns the wallet
176
- # @param wallet_token [String] Token representing the wallet
177
- # @param [Hash] opts the optional parameters
178
- # @return [Array<AutopayResp>]
179
- def get_autopay_rules(user_token, wallet_token, opts = {})
180
- data, _status_code, _headers = get_autopay_rules_with_http_info(user_token, wallet_token, opts)
181
- data
182
- end
183
-
184
- # Get all autopay rules
185
- # This **GET** endpoint is used to retrieve all autopay rules currently applied to the provided wallet token. &lt;br&gt; You can use this endpoint to obtain information about the autopay rules associated with the wallet. &lt;br&gt; To use this endpoint, you need to provide the &#x60;user_token&#x60; and &#x60;wallet_token&#x60; as required parameters in the URL Path. &lt;br&gt; The response will include a JSON array containing details for each autopay rule, including the token, &#x60;destination_token&#x60; and percentage.
186
- # @param user_token [String] Token representing the user who owns the wallet
187
- # @param wallet_token [String] Token representing the wallet
188
- # @param [Hash] opts the optional parameters
189
- # @return [Array<(Array<AutopayResp>, Integer, Hash)>] Array<AutopayResp> data, response status code and response headers
190
- def get_autopay_rules_with_http_info(user_token, wallet_token, opts = {})
191
- if @api_client.config.debugging
192
- @api_client.config.logger.debug 'Calling API: WalletApi.get_autopay_rules ...'
193
- end
194
- # verify the required parameter 'user_token' is set
195
- if @api_client.config.client_side_validation && user_token.nil?
196
- fail ArgumentError, "Missing the required parameter 'user_token' when calling WalletApi.get_autopay_rules"
197
- end
198
- # verify the required parameter 'wallet_token' is set
199
- if @api_client.config.client_side_validation && wallet_token.nil?
200
- fail ArgumentError, "Missing the required parameter 'wallet_token' when calling WalletApi.get_autopay_rules"
201
- end
202
- # resource path
203
- local_var_path = '/wallet/{user_token}/{wallet_token}/autopay'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s)).sub('{' + 'wallet_token' + '}', CGI.escape(wallet_token.to_s))
204
-
205
- # query parameters
206
- query_params = opts[:query_params] || {}
207
-
208
- # header parameters
209
- header_params = opts[:header_params] || {}
210
- # HTTP header 'Accept' (if needed)
211
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
212
-
213
- # form parameters
214
- form_params = opts[:form_params] || {}
215
-
216
- # http body (model)
217
- post_body = opts[:debug_body]
218
-
219
- # return_type
220
- return_type = opts[:debug_return_type] || 'Array<AutopayResp>'
221
-
222
- # auth_names
223
- auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
224
-
225
- new_options = opts.merge(
226
- :operation => :"WalletApi.get_autopay_rules",
227
- :header_params => header_params,
228
- :query_params => query_params,
229
- :form_params => form_params,
230
- :body => post_body,
231
- :auth_names => auth_names,
232
- :return_type => return_type
233
- )
234
-
235
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
236
- if @api_client.config.debugging
237
- @api_client.config.logger.debug "API called: WalletApi#get_autopay_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
238
- end
239
- return data, status_code, headers
240
- end
241
-
242
- # Retrieve all available wallets for a user
243
- # 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`.
244
- # @param user_token [String] Token representing the user who owns the wallet
245
- # @param [Hash] opts the optional parameters
246
- # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
247
- # @return [Array<WalletTxnResp>]
248
- def get_wallet(user_token, opts = {})
249
- data, _status_code, _headers = get_wallet_with_http_info(user_token, opts)
250
- data
251
- end
252
-
253
- # Retrieve all available wallets for a user
254
- # This **GET** endpoint is used to retrieve all available wallets for a provided user token. &lt;br&gt; You can use this endpoint to obtain information about the wallets associated with the provided user token. &lt;br&gt; To use this endpoint, you need to provide the &#x60;user_token&#x60; as a required parameter in the URL Path. &lt;br&gt; The response will include a JSON array containing details for each wallet including &#x60;user_token&#x60;, &#x60;balance&#x60;, &#x60;currency_code&#x60;.
255
- # @param user_token [String] Token representing the user who owns the wallet
256
- # @param [Hash] opts the optional parameters
257
- # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
258
- # @return [Array<(Array<WalletTxnResp>, Integer, Hash)>] Array<WalletTxnResp> data, response status code and response headers
259
- def get_wallet_with_http_info(user_token, opts = {})
260
- if @api_client.config.debugging
261
- @api_client.config.logger.debug 'Calling API: WalletApi.get_wallet ...'
262
- end
263
- # verify the required parameter 'user_token' is set
264
- if @api_client.config.client_side_validation && user_token.nil?
265
- fail ArgumentError, "Missing the required parameter 'user_token' when calling WalletApi.get_wallet"
266
- end
267
- # resource path
268
- local_var_path = '/wallet/{user_token}'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s))
269
-
270
- # query parameters
271
- query_params = opts[:query_params] || {}
272
-
273
- # header parameters
274
- header_params = opts[:header_params] || {}
275
- # HTTP header 'Accept' (if needed)
276
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
277
- header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
278
-
279
- # form parameters
280
- form_params = opts[:form_params] || {}
281
-
282
- # http body (model)
283
- post_body = opts[:debug_body]
284
-
285
- # return_type
286
- return_type = opts[:debug_return_type] || 'Array<WalletTxnResp>'
287
-
288
- # auth_names
289
- auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
290
-
291
- new_options = opts.merge(
292
- :operation => :"WalletApi.get_wallet",
293
- :header_params => header_params,
294
- :query_params => query_params,
295
- :form_params => form_params,
296
- :body => post_body,
297
- :auth_names => auth_names,
298
- :return_type => return_type
299
- )
300
-
301
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
302
- if @api_client.config.debugging
303
- @api_client.config.logger.debug "API called: WalletApi#get_wallet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
304
- end
305
- return data, status_code, headers
306
- end
307
-
308
- # Get MassPay Card Information
309
- # 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.
310
- # @param user_token [String] Token representing the user who owns the wallet
311
- # @param wallet_token [String] Token representing the wallet
312
- # @param [Hash] opts the optional parameters
313
- # @return [GetWalletCardInfo200Response]
314
- def get_wallet_card_info(user_token, wallet_token, opts = {})
315
- data, _status_code, _headers = get_wallet_card_info_with_http_info(user_token, wallet_token, opts)
316
- data
317
- end
318
-
319
- # Get MassPay Card Information
320
- # This **GET** endpoint is used to retrieve MassPay card information associated with the provided wallet token. &lt;br&gt; You can use this endpoint to obtain information about the MassPay card associated with the wallet. &lt;br&gt; To use this endpoint, you need to provide the &#x60;user_token&#x60; and &#x60;wallet_token&#x60; as required parameters in the URL Path. &lt;br&gt; The response will include a JSON object containing details for the MassPay card, including the card number, balance, status.
321
- # @param user_token [String] Token representing the user who owns the wallet
322
- # @param wallet_token [String] Token representing the wallet
323
- # @param [Hash] opts the optional parameters
324
- # @return [Array<(GetWalletCardInfo200Response, Integer, Hash)>] GetWalletCardInfo200Response data, response status code and response headers
325
- def get_wallet_card_info_with_http_info(user_token, wallet_token, opts = {})
326
- if @api_client.config.debugging
327
- @api_client.config.logger.debug 'Calling API: WalletApi.get_wallet_card_info ...'
328
- end
329
- # verify the required parameter 'user_token' is set
330
- if @api_client.config.client_side_validation && user_token.nil?
331
- fail ArgumentError, "Missing the required parameter 'user_token' when calling WalletApi.get_wallet_card_info"
332
- end
333
- # verify the required parameter 'wallet_token' is set
334
- if @api_client.config.client_side_validation && wallet_token.nil?
335
- fail ArgumentError, "Missing the required parameter 'wallet_token' when calling WalletApi.get_wallet_card_info"
336
- end
337
- # resource path
338
- 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))
339
-
340
- # query parameters
341
- query_params = opts[:query_params] || {}
342
-
343
- # header parameters
344
- header_params = opts[:header_params] || {}
345
- # HTTP header 'Accept' (if needed)
346
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
347
-
348
- # form parameters
349
- form_params = opts[:form_params] || {}
350
-
351
- # http body (model)
352
- post_body = opts[:debug_body]
353
-
354
- # return_type
355
- return_type = opts[:debug_return_type] || 'GetWalletCardInfo200Response'
356
-
357
- # auth_names
358
- auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
359
-
360
- new_options = opts.merge(
361
- :operation => :"WalletApi.get_wallet_card_info",
362
- :header_params => header_params,
363
- :query_params => query_params,
364
- :form_params => form_params,
365
- :body => post_body,
366
- :auth_names => auth_names,
367
- :return_type => return_type
368
- )
369
-
370
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
371
- if @api_client.config.debugging
372
- @api_client.config.logger.debug "API called: WalletApi#get_wallet_card_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
373
- end
374
- return data, status_code, headers
375
- end
376
-
377
- # Update MassPay Card Information
378
- # 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.
379
- # @param user_token [String] Token representing the user who owns the wallet
380
- # @param wallet_token [String] Token representing the wallet
381
- # @param [Hash] opts the optional parameters
382
- # @option opts [String] :pin New 4 digit pin number for the card (To be used in ATM machines)
383
- # @option opts [String] :status New status for the card
384
- # @return [nil]
385
- def update_wallet_card_info(user_token, wallet_token, opts = {})
386
- update_wallet_card_info_with_http_info(user_token, wallet_token, opts)
387
- nil
388
- end
389
-
390
- # Update MassPay Card Information
391
- # This **PUT** endpoint is used to update the MassPay card information for a provided user token and wallet token. &lt;br&gt; You can use this endpoint to help your users manage their MassPay card information, including updating their card PIN number or status. &lt;br&gt; To use this endpoint, you need to provide the &#x60;user_token&#x60; and &#x60;wallet_token&#x60; as parameters in the URL Path, along with the parameters in the request Query, including the card pin number or(and) status. &lt;br&gt; The endpoint will then update the card information for the provided user and wallet token.
392
- # @param user_token [String] Token representing the user who owns the wallet
393
- # @param wallet_token [String] Token representing the wallet
394
- # @param [Hash] opts the optional parameters
395
- # @option opts [String] :pin New 4 digit pin number for the card (To be used in ATM machines)
396
- # @option opts [String] :status New status for the card
397
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
398
- def update_wallet_card_info_with_http_info(user_token, wallet_token, opts = {})
399
- if @api_client.config.debugging
400
- @api_client.config.logger.debug 'Calling API: WalletApi.update_wallet_card_info ...'
401
- end
402
- # verify the required parameter 'user_token' is set
403
- if @api_client.config.client_side_validation && user_token.nil?
404
- fail ArgumentError, "Missing the required parameter 'user_token' when calling WalletApi.update_wallet_card_info"
405
- end
406
- # verify the required parameter 'wallet_token' is set
407
- if @api_client.config.client_side_validation && wallet_token.nil?
408
- fail ArgumentError, "Missing the required parameter 'wallet_token' when calling WalletApi.update_wallet_card_info"
409
- end
410
- pattern = Regexp.new(/^[0-9]{4}$/)
411
- if @api_client.config.client_side_validation && !opts[:'pin'].nil? && opts[:'pin'] !~ pattern
412
- fail ArgumentError, "invalid value for 'opts[:\"pin\"]' when calling WalletApi.update_wallet_card_info, must conform to the pattern #{pattern}."
413
- end
414
-
415
- allowable_values = ["SUSPEND", "UNSUSPEND", "CLOSE"]
416
- if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
417
- fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
418
- end
419
- # resource path
420
- 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))
421
-
422
- # query parameters
423
- query_params = opts[:query_params] || {}
424
- query_params[:'pin'] = opts[:'pin'] if !opts[:'pin'].nil?
425
- query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
426
-
427
- # header parameters
428
- header_params = opts[:header_params] || {}
429
- # HTTP header 'Accept' (if needed)
430
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
431
-
432
- # form parameters
433
- form_params = opts[:form_params] || {}
434
-
435
- # http body (model)
436
- post_body = opts[:debug_body]
437
-
438
- # return_type
439
- return_type = opts[:debug_return_type]
440
-
441
- # auth_names
442
- auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
443
-
444
- new_options = opts.merge(
445
- :operation => :"WalletApi.update_wallet_card_info",
446
- :header_params => header_params,
447
- :query_params => query_params,
448
- :form_params => form_params,
449
- :body => post_body,
450
- :auth_names => auth_names,
451
- :return_type => return_type
452
- )
453
-
454
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
455
- if @api_client.config.debugging
456
- @api_client.config.logger.debug "API called: WalletApi#update_wallet_card_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
457
- end
458
- return data, status_code, headers
459
- end
460
- end
461
- end