mundi_api 0.9.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/LICENSE +28 -0
- data/README.md +2186 -0
- data/lib/mundi_api.rb +137 -0
- data/lib/mundi_api/api_helper.rb +209 -0
- data/lib/mundi_api/configuration.rb +25 -0
- data/lib/mundi_api/controllers/base_controller.rb +61 -0
- data/lib/mundi_api/controllers/charges_controller.rb +359 -0
- data/lib/mundi_api/controllers/customers_controller.rb +758 -0
- data/lib/mundi_api/controllers/invoices_controller.rb +184 -0
- data/lib/mundi_api/controllers/orders_controller.rb +171 -0
- data/lib/mundi_api/controllers/plans_controller.rb +387 -0
- data/lib/mundi_api/controllers/subscriptions_controller.rb +648 -0
- data/lib/mundi_api/controllers/tokens_controller.rb +87 -0
- data/lib/mundi_api/exceptions/api_exception.rb +18 -0
- data/lib/mundi_api/exceptions/error_exception.rb +37 -0
- data/lib/mundi_api/http/auth/basic_auth.rb +20 -0
- data/lib/mundi_api/http/faraday_client.rb +55 -0
- data/lib/mundi_api/http/http_call_back.rb +22 -0
- data/lib/mundi_api/http/http_client.rb +92 -0
- data/lib/mundi_api/http/http_context.rb +18 -0
- data/lib/mundi_api/http/http_method_enum.rb +11 -0
- data/lib/mundi_api/http/http_request.rb +48 -0
- data/lib/mundi_api/http/http_response.rb +21 -0
- data/lib/mundi_api/models/base_model.rb +34 -0
- data/lib/mundi_api/models/create_access_token_request.rb +35 -0
- data/lib/mundi_api/models/create_address_request.rb +108 -0
- data/lib/mundi_api/models/create_bank_transfer_payment_request.rb +44 -0
- data/lib/mundi_api/models/create_boleto_payment_request.rb +83 -0
- data/lib/mundi_api/models/create_cancel_charge_request.rb +35 -0
- data/lib/mundi_api/models/create_cancel_subscription_request.rb +35 -0
- data/lib/mundi_api/models/create_capture_charge_request.rb +45 -0
- data/lib/mundi_api/models/create_card_options_request.rb +36 -0
- data/lib/mundi_api/models/create_card_request.rb +136 -0
- data/lib/mundi_api/models/create_card_token_request.rb +80 -0
- data/lib/mundi_api/models/create_charge_request.rb +92 -0
- data/lib/mundi_api/models/create_checkout_boleto_payment_request.rb +54 -0
- data/lib/mundi_api/models/create_checkout_card_installment_option_request.rb +44 -0
- data/lib/mundi_api/models/create_checkout_card_payment_request.rb +51 -0
- data/lib/mundi_api/models/create_checkout_payment_request.rb +82 -0
- data/lib/mundi_api/models/create_credit_card_payment_request.rb +108 -0
- data/lib/mundi_api/models/create_customer_request.rb +108 -0
- data/lib/mundi_api/models/create_discount_request.rb +62 -0
- data/lib/mundi_api/models/create_order_item_request.rb +71 -0
- data/lib/mundi_api/models/create_order_request.rb +114 -0
- data/lib/mundi_api/models/create_payment_request.rb +121 -0
- data/lib/mundi_api/models/create_phone_request.rb +53 -0
- data/lib/mundi_api/models/create_phones_request.rb +46 -0
- data/lib/mundi_api/models/create_plan_item_request.rb +81 -0
- data/lib/mundi_api/models/create_plan_request.rb +199 -0
- data/lib/mundi_api/models/create_price_bracket_request.rb +62 -0
- data/lib/mundi_api/models/create_pricing_scheme_request.rb +69 -0
- data/lib/mundi_api/models/create_seller_request.rb +90 -0
- data/lib/mundi_api/models/create_setup_request.rb +55 -0
- data/lib/mundi_api/models/create_shipping_request.rb +81 -0
- data/lib/mundi_api/models/create_subscription_item_request.rb +106 -0
- data/lib/mundi_api/models/create_subscription_request.rb +269 -0
- data/lib/mundi_api/models/create_token_request.rb +44 -0
- data/lib/mundi_api/models/create_usage_request.rb +54 -0
- data/lib/mundi_api/models/create_voucher_payment_request.rb +72 -0
- data/lib/mundi_api/models/get_access_token_response.rb +73 -0
- data/lib/mundi_api/models/get_address_response.rb +163 -0
- data/lib/mundi_api/models/get_bank_transfer_transaction_response.rb +118 -0
- data/lib/mundi_api/models/get_billing_address_response.rb +98 -0
- data/lib/mundi_api/models/get_boleto_transaction_response.rb +137 -0
- data/lib/mundi_api/models/get_card_response.rb +164 -0
- data/lib/mundi_api/models/get_card_token_response.rb +89 -0
- data/lib/mundi_api/models/get_charge_response.rb +184 -0
- data/lib/mundi_api/models/get_checkout_payment_settings_response.rb +99 -0
- data/lib/mundi_api/models/get_credit_card_transaction_response.rb +163 -0
- data/lib/mundi_api/models/get_customer_response.rb +145 -0
- data/lib/mundi_api/models/get_discount_response.rb +100 -0
- data/lib/mundi_api/models/get_invoice_item_response.rb +73 -0
- data/lib/mundi_api/models/get_invoice_response.rb +210 -0
- data/lib/mundi_api/models/get_order_item_response.rb +63 -0
- data/lib/mundi_api/models/get_order_response.rb +167 -0
- data/lib/mundi_api/models/get_period_response.rb +73 -0
- data/lib/mundi_api/models/get_phone_response.rb +53 -0
- data/lib/mundi_api/models/get_phones_response.rb +46 -0
- data/lib/mundi_api/models/get_plan_item_response.rb +127 -0
- data/lib/mundi_api/models/get_plan_response.rb +223 -0
- data/lib/mundi_api/models/get_price_bracket_response.rb +62 -0
- data/lib/mundi_api/models/get_pricing_scheme_response.rb +69 -0
- data/lib/mundi_api/models/get_safety_pay_transaction_response.rb +109 -0
- data/lib/mundi_api/models/get_seller_response.rb +126 -0
- data/lib/mundi_api/models/get_setup_response.rb +62 -0
- data/lib/mundi_api/models/get_shipping_response.rb +72 -0
- data/lib/mundi_api/models/get_subscription_item_response.rb +135 -0
- data/lib/mundi_api/models/get_subscription_response.rb +261 -0
- data/lib/mundi_api/models/get_token_response.rb +72 -0
- data/lib/mundi_api/models/get_transaction_response.rb +136 -0
- data/lib/mundi_api/models/get_usage_response.rb +82 -0
- data/lib/mundi_api/models/get_voucher_transaction_response.rb +163 -0
- data/lib/mundi_api/models/list_access_tokens_response.rb +51 -0
- data/lib/mundi_api/models/list_addresses_response.rb +51 -0
- data/lib/mundi_api/models/list_cards_response.rb +51 -0
- data/lib/mundi_api/models/list_charges_response.rb +51 -0
- data/lib/mundi_api/models/list_customers_response.rb +51 -0
- data/lib/mundi_api/models/list_invoices_response.rb +51 -0
- data/lib/mundi_api/models/list_order_response.rb +51 -0
- data/lib/mundi_api/models/list_plans_response.rb +51 -0
- data/lib/mundi_api/models/list_subscription_items_response.rb +51 -0
- data/lib/mundi_api/models/list_subscriptions_response.rb +51 -0
- data/lib/mundi_api/models/list_transactions_response.rb +51 -0
- data/lib/mundi_api/models/list_usages_response.rb +51 -0
- data/lib/mundi_api/models/paging_response.rb +53 -0
- data/lib/mundi_api/models/update_address_request.rb +53 -0
- data/lib/mundi_api/models/update_card_request.rb +81 -0
- data/lib/mundi_api/models/update_charge_card_request.rb +62 -0
- data/lib/mundi_api/models/update_charge_due_date_request.rb +36 -0
- data/lib/mundi_api/models/update_charge_payment_method_request.rb +74 -0
- data/lib/mundi_api/models/update_customer_request.rb +90 -0
- data/lib/mundi_api/models/update_metadata_request.rb +35 -0
- data/lib/mundi_api/models/update_plan_item_request.rb +81 -0
- data/lib/mundi_api/models/update_plan_request.rb +161 -0
- data/lib/mundi_api/models/update_price_bracket_request.rb +62 -0
- data/lib/mundi_api/models/update_pricing_scheme_request.rb +69 -0
- data/lib/mundi_api/models/update_subscription_billing_date_request.rb +37 -0
- data/lib/mundi_api/models/update_subscription_card_request.rb +44 -0
- data/lib/mundi_api/models/update_subscription_item_request.rb +81 -0
- data/lib/mundi_api/models/update_subscription_payment_method_request.rb +53 -0
- data/lib/mundi_api/mundi_api_client.rb +63 -0
- metadata +246 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ff33465146e329219c49e3ee45859f02665eaf17
|
4
|
+
data.tar.gz: f83735a0a21d8381797b0a98b2e0ac6429722001
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 30b2d00e330b8b52b8fa1458b20dcbf972c88fdefb49b929968c270dfd8f4d1564a483801d3827446c30595e855ec9f2768b693597011be307a789d3b5a8b7c8
|
7
|
+
data.tar.gz: 8e1c62d68134c7b10ae5e0763475b8e55290227ca9305225edee762235e6efd61929f342d75c0d7dfc7424db1b737698f3b9d643a873254b77d4be8e9306f68e
|
data/LICENSE
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
License:
|
2
|
+
========
|
3
|
+
The MIT License (MIT)
|
4
|
+
http://opensource.org/licenses/MIT
|
5
|
+
|
6
|
+
Copyright (c) 2014 - 2016 APIMATIC Limited
|
7
|
+
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
|
+
of this software and associated documentation files (the "Software"), to deal
|
10
|
+
in the Software without restriction, including without limitation the rights
|
11
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
+
copies of the Software, and to permit persons to whom the Software is
|
13
|
+
furnished to do so, subject to the following conditions:
|
14
|
+
|
15
|
+
The above copyright notice and this permission notice shall be included in
|
16
|
+
all copies or substantial portions of the Software.
|
17
|
+
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
|
+
THE SOFTWARE.
|
25
|
+
|
26
|
+
Trade Mark:
|
27
|
+
==========
|
28
|
+
APIMATIC is a trade mark for APIMATIC Limited
|
data/README.md
ADDED
@@ -0,0 +1,2186 @@
|
|
1
|
+
# Getting started
|
2
|
+
|
3
|
+
Mundipagg API
|
4
|
+
|
5
|
+
## How to Build
|
6
|
+
|
7
|
+
This client library is a Ruby gem which can be compiled and used in your Ruby and Ruby on Rails project. This library requires a few gems from the RubyGems repository.
|
8
|
+
|
9
|
+
1. Open the command line interface or the terminal and navigate to the folder containing the source code.
|
10
|
+
2. Run ``` gem build mundi_api.gemspec ``` to build the gem.
|
11
|
+
3. Once built, the gem can be installed on the current work environment using ``` gem install mundi_api-0.9.0.gem ```
|
12
|
+
|
13
|
+

|
14
|
+
|
15
|
+
## How to Use
|
16
|
+
|
17
|
+
The following section explains how to use the MundiApi Ruby Gem in a new Rails project using RubyMine™. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.
|
18
|
+
|
19
|
+
### 1. Starting a new project
|
20
|
+
|
21
|
+
Close any existing projects in RubyMine™ by selecting ``` File -> Close Project ```. Next, click on ``` Create New Project ``` to create a new project from scratch.
|
22
|
+
|
23
|
+

|
24
|
+
|
25
|
+
Next, provide ``` TestApp ``` as the project name, choose ``` Rails Application ``` as the project type, and click ``` OK ```.
|
26
|
+
|
27
|
+

|
28
|
+
|
29
|
+
In the next dialog make sure that correct *Ruby SDK* is being used (minimum 2.0.0) and click ``` OK ```.
|
30
|
+
|
31
|
+

|
32
|
+
|
33
|
+
This will create a new Rails Application project with an existing set of files and folder.
|
34
|
+
|
35
|
+
### 2. Add reference of the gem
|
36
|
+
|
37
|
+
In order to use the MundiApi gem in the new project we must add a gem reference. Locate the ```Gemfile``` in the *Project Explorer* window under the ``` TestApp ``` project node. The file contains references to all gems being used in the project. Here, add the reference to the library gem by adding the following line: ``` gem 'mundi_api', '~> 0.9.0' ```
|
38
|
+
|
39
|
+

|
40
|
+
|
41
|
+
### 3. Adding a new Rails Controller
|
42
|
+
|
43
|
+
Once the ``` TestApp ``` project is created, a folder named ``` controllers ``` will be visible in the *Project Explorer* under the following path: ``` TestApp > app > controllers ```. Right click on this folder and select ``` New -> Run Rails Generator... ```.
|
44
|
+
|
45
|
+

|
46
|
+
|
47
|
+
Selecting the said option will popup a small window where the generator names are displayed. Here, select the ``` controller ``` template.
|
48
|
+
|
49
|
+

|
50
|
+
|
51
|
+
Next, a popup window will ask you for a Controller name and included Actions. For controller name provide ``` Hello ``` and include an action named ``` Index ``` and click ``` OK ```.
|
52
|
+
|
53
|
+

|
54
|
+
|
55
|
+
A new controller class anmed ``` HelloController ``` will be created in a file named ``` hello_controller.rb ``` containing a method named ``` Index ```. In this method, add code for initialization and a sample for its usage.
|
56
|
+
|
57
|
+

|
58
|
+
|
59
|
+
## How to Test
|
60
|
+
|
61
|
+
You can test the generated SDK and the server with automatically generated test
|
62
|
+
cases as follows:
|
63
|
+
|
64
|
+
1. From terminal/cmd navigate to the root directory of the SDK.
|
65
|
+
2. Invoke: `bundle exec rake`
|
66
|
+
|
67
|
+
## Initialization
|
68
|
+
|
69
|
+
### Authentication
|
70
|
+
In order to setup authentication and initialization of the API client, you need the following information.
|
71
|
+
|
72
|
+
| Parameter | Description |
|
73
|
+
|-----------|-------------|
|
74
|
+
| basic_auth_user_name | The username to use with basic authentication |
|
75
|
+
| basic_auth_password | The password to use with basic authentication |
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
API client can be initialized as following.
|
80
|
+
|
81
|
+
```ruby
|
82
|
+
# Configuration parameters and credentials
|
83
|
+
basic_auth_user_name = 'basic_auth_user_name' # The username to use with basic authentication
|
84
|
+
basic_auth_password = 'basic_auth_password' # The password to use with basic authentication
|
85
|
+
|
86
|
+
client = MundiApi::MundiApiClient.new(
|
87
|
+
basic_auth_user_name: basic_auth_user_name,
|
88
|
+
basic_auth_password: basic_auth_password
|
89
|
+
)
|
90
|
+
```
|
91
|
+
|
92
|
+
The added initlization code can be debugged by putting a breakpoint in the ``` Index ``` method and running the project in debug mode by selecting ``` Run -> Debug 'Development: TestApp' ```.
|
93
|
+
|
94
|
+

|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
# Class Reference
|
99
|
+
|
100
|
+
## <a name="list_of_controllers"></a>List of Controllers
|
101
|
+
|
102
|
+
* [ChargesController](#charges_controller)
|
103
|
+
* [CustomersController](#customers_controller)
|
104
|
+
* [InvoicesController](#invoices_controller)
|
105
|
+
* [PlansController](#plans_controller)
|
106
|
+
* [SubscriptionsController](#subscriptions_controller)
|
107
|
+
* [OrdersController](#orders_controller)
|
108
|
+
* [TokensController](#tokens_controller)
|
109
|
+
|
110
|
+
## <a name="charges_controller"></a> ChargesController
|
111
|
+
|
112
|
+
### Get singleton instance
|
113
|
+
|
114
|
+
The singleton instance of the ``` ChargesController ``` class can be accessed from the API Client.
|
115
|
+
|
116
|
+
```ruby
|
117
|
+
charges = client.charges
|
118
|
+
```
|
119
|
+
|
120
|
+
### <a name="get_charge"></a> get_charge
|
121
|
+
|
122
|
+
> Get a charge from its id
|
123
|
+
|
124
|
+
|
125
|
+
```ruby
|
126
|
+
def get_charge(charge_id); end
|
127
|
+
```
|
128
|
+
|
129
|
+
#### Parameters
|
130
|
+
|
131
|
+
| Parameter | Tags | Description |
|
132
|
+
|-----------|------|-------------|
|
133
|
+
| charge_id | ``` Required ``` | Charge id |
|
134
|
+
|
135
|
+
|
136
|
+
#### Example Usage
|
137
|
+
|
138
|
+
```ruby
|
139
|
+
charge_id = 'charge_id'
|
140
|
+
|
141
|
+
result = charges.get_charge(charge_id)
|
142
|
+
|
143
|
+
```
|
144
|
+
|
145
|
+
|
146
|
+
### <a name="retry_charge"></a> retry_charge
|
147
|
+
|
148
|
+
> Retries a charge
|
149
|
+
|
150
|
+
|
151
|
+
```ruby
|
152
|
+
def retry_charge(charge_id); end
|
153
|
+
```
|
154
|
+
|
155
|
+
#### Parameters
|
156
|
+
|
157
|
+
| Parameter | Tags | Description |
|
158
|
+
|-----------|------|-------------|
|
159
|
+
| charge_id | ``` Required ``` | Charge id |
|
160
|
+
|
161
|
+
|
162
|
+
#### Example Usage
|
163
|
+
|
164
|
+
```ruby
|
165
|
+
charge_id = 'charge_id'
|
166
|
+
|
167
|
+
result = charges.retry_charge(charge_id)
|
168
|
+
|
169
|
+
```
|
170
|
+
|
171
|
+
|
172
|
+
### <a name="create_charge"></a> create_charge
|
173
|
+
|
174
|
+
> Creates a new charge
|
175
|
+
|
176
|
+
|
177
|
+
```ruby
|
178
|
+
def create_charge(request); end
|
179
|
+
```
|
180
|
+
|
181
|
+
#### Parameters
|
182
|
+
|
183
|
+
| Parameter | Tags | Description |
|
184
|
+
|-----------|------|-------------|
|
185
|
+
| request | ``` Required ``` | Request for creating a charge |
|
186
|
+
|
187
|
+
|
188
|
+
#### Example Usage
|
189
|
+
|
190
|
+
```ruby
|
191
|
+
request = CreateChargeRequest.new
|
192
|
+
|
193
|
+
result = charges.create_charge(request)
|
194
|
+
|
195
|
+
```
|
196
|
+
|
197
|
+
|
198
|
+
### <a name="update_charge_card"></a> update_charge_card
|
199
|
+
|
200
|
+
> Updates the card from a charge
|
201
|
+
|
202
|
+
|
203
|
+
```ruby
|
204
|
+
def update_charge_card(charge_id,
|
205
|
+
request); end
|
206
|
+
```
|
207
|
+
|
208
|
+
#### Parameters
|
209
|
+
|
210
|
+
| Parameter | Tags | Description |
|
211
|
+
|-----------|------|-------------|
|
212
|
+
| charge_id | ``` Required ``` | Charge id |
|
213
|
+
| request | ``` Required ``` | Request for updating a charge's card |
|
214
|
+
|
215
|
+
|
216
|
+
#### Example Usage
|
217
|
+
|
218
|
+
```ruby
|
219
|
+
charge_id = 'charge_id'
|
220
|
+
request = UpdateChargeCardRequest.new
|
221
|
+
|
222
|
+
result = charges.update_charge_card(charge_id, request)
|
223
|
+
|
224
|
+
```
|
225
|
+
|
226
|
+
|
227
|
+
### <a name="update_charge_payment_method"></a> update_charge_payment_method
|
228
|
+
|
229
|
+
> Updates a charge's payment method
|
230
|
+
|
231
|
+
|
232
|
+
```ruby
|
233
|
+
def update_charge_payment_method(charge_id,
|
234
|
+
request); end
|
235
|
+
```
|
236
|
+
|
237
|
+
#### Parameters
|
238
|
+
|
239
|
+
| Parameter | Tags | Description |
|
240
|
+
|-----------|------|-------------|
|
241
|
+
| charge_id | ``` Required ``` | Charge id |
|
242
|
+
| request | ``` Required ``` | Request for updating the payment method from a charge |
|
243
|
+
|
244
|
+
|
245
|
+
#### Example Usage
|
246
|
+
|
247
|
+
```ruby
|
248
|
+
charge_id = 'charge_id'
|
249
|
+
request = UpdateChargePaymentMethodRequest.new
|
250
|
+
|
251
|
+
result = charges.update_charge_payment_method(charge_id, request)
|
252
|
+
|
253
|
+
```
|
254
|
+
|
255
|
+
|
256
|
+
### <a name="cancel_charge"></a> cancel_charge
|
257
|
+
|
258
|
+
> Cancel a charge
|
259
|
+
|
260
|
+
|
261
|
+
```ruby
|
262
|
+
def cancel_charge(charge_id,
|
263
|
+
request = nil); end
|
264
|
+
```
|
265
|
+
|
266
|
+
#### Parameters
|
267
|
+
|
268
|
+
| Parameter | Tags | Description |
|
269
|
+
|-----------|------|-------------|
|
270
|
+
| charge_id | ``` Required ``` | Charge id |
|
271
|
+
| request | ``` Optional ``` | Request for cancelling a charge |
|
272
|
+
|
273
|
+
|
274
|
+
#### Example Usage
|
275
|
+
|
276
|
+
```ruby
|
277
|
+
charge_id = 'charge_id'
|
278
|
+
request = CreateCancelChargeRequest.new
|
279
|
+
|
280
|
+
result = charges.cancel_charge(charge_id, request)
|
281
|
+
|
282
|
+
```
|
283
|
+
|
284
|
+
|
285
|
+
### <a name="capture_charge"></a> capture_charge
|
286
|
+
|
287
|
+
> Captures a charge
|
288
|
+
|
289
|
+
|
290
|
+
```ruby
|
291
|
+
def capture_charge(charge_id,
|
292
|
+
request = nil); end
|
293
|
+
```
|
294
|
+
|
295
|
+
#### Parameters
|
296
|
+
|
297
|
+
| Parameter | Tags | Description |
|
298
|
+
|-----------|------|-------------|
|
299
|
+
| charge_id | ``` Required ``` | Charge id |
|
300
|
+
| request | ``` Optional ``` | Request for capturing a charge |
|
301
|
+
|
302
|
+
|
303
|
+
#### Example Usage
|
304
|
+
|
305
|
+
```ruby
|
306
|
+
charge_id = 'charge_id'
|
307
|
+
request = CreateCaptureChargeRequest.new
|
308
|
+
|
309
|
+
result = charges.capture_charge(charge_id, request)
|
310
|
+
|
311
|
+
```
|
312
|
+
|
313
|
+
|
314
|
+
### <a name="update_charge_metadata"></a> update_charge_metadata
|
315
|
+
|
316
|
+
> Updates the metadata from a charge
|
317
|
+
|
318
|
+
|
319
|
+
```ruby
|
320
|
+
def update_charge_metadata(charge_id,
|
321
|
+
request); end
|
322
|
+
```
|
323
|
+
|
324
|
+
#### Parameters
|
325
|
+
|
326
|
+
| Parameter | Tags | Description |
|
327
|
+
|-----------|------|-------------|
|
328
|
+
| charge_id | ``` Required ``` | The charge id |
|
329
|
+
| request | ``` Required ``` | Request for updating the charge metadata |
|
330
|
+
|
331
|
+
|
332
|
+
#### Example Usage
|
333
|
+
|
334
|
+
```ruby
|
335
|
+
charge_id = 'charge_id'
|
336
|
+
request = UpdateMetadataRequest.new
|
337
|
+
|
338
|
+
result = charges.update_charge_metadata(charge_id, request)
|
339
|
+
|
340
|
+
```
|
341
|
+
|
342
|
+
|
343
|
+
### <a name="get_charges"></a> get_charges
|
344
|
+
|
345
|
+
> Lists all charges
|
346
|
+
|
347
|
+
|
348
|
+
```ruby
|
349
|
+
def get_charges(page = nil,
|
350
|
+
size = nil,
|
351
|
+
code = nil,
|
352
|
+
status = nil,
|
353
|
+
payment_method = nil,
|
354
|
+
customer_id = nil,
|
355
|
+
order_id = nil,
|
356
|
+
created_since = nil,
|
357
|
+
created_until = nil); end
|
358
|
+
```
|
359
|
+
|
360
|
+
#### Parameters
|
361
|
+
|
362
|
+
| Parameter | Tags | Description |
|
363
|
+
|-----------|------|-------------|
|
364
|
+
| page | ``` Optional ``` | Page number |
|
365
|
+
| size | ``` Optional ``` | Page size |
|
366
|
+
| code | ``` Optional ``` | Filter for charge's code |
|
367
|
+
| status | ``` Optional ``` | Filter for charge's status |
|
368
|
+
| payment_method | ``` Optional ``` | Filter for charge's payment method |
|
369
|
+
| customer_id | ``` Optional ``` | Filter for charge's customer id |
|
370
|
+
| order_id | ``` Optional ``` | Filter for charge's order id |
|
371
|
+
| created_since | ``` Optional ``` | Filter for the beginning of the range for charge's creation |
|
372
|
+
| created_until | ``` Optional ``` | Filter for the end of the range for charge's creation |
|
373
|
+
|
374
|
+
|
375
|
+
#### Example Usage
|
376
|
+
|
377
|
+
```ruby
|
378
|
+
page = 224
|
379
|
+
size = 224
|
380
|
+
code = 'code'
|
381
|
+
status = 'status'
|
382
|
+
payment_method = 'payment_method'
|
383
|
+
customer_id = 'customer_id'
|
384
|
+
order_id = 'order_id'
|
385
|
+
created_since = DateTime.now
|
386
|
+
created_until = DateTime.now
|
387
|
+
|
388
|
+
result = charges.get_charges(page, size, code, status, payment_method, customer_id, order_id, created_since, created_until)
|
389
|
+
|
390
|
+
```
|
391
|
+
|
392
|
+
|
393
|
+
[Back to List of Controllers](#list_of_controllers)
|
394
|
+
|
395
|
+
## <a name="customers_controller"></a> CustomersController
|
396
|
+
|
397
|
+
### Get singleton instance
|
398
|
+
|
399
|
+
The singleton instance of the ``` CustomersController ``` class can be accessed from the API Client.
|
400
|
+
|
401
|
+
```ruby
|
402
|
+
customers = client.customers
|
403
|
+
```
|
404
|
+
|
405
|
+
### <a name="create_customer"></a> create_customer
|
406
|
+
|
407
|
+
> Creates a new customer
|
408
|
+
|
409
|
+
|
410
|
+
```ruby
|
411
|
+
def create_customer(request); end
|
412
|
+
```
|
413
|
+
|
414
|
+
#### Parameters
|
415
|
+
|
416
|
+
| Parameter | Tags | Description |
|
417
|
+
|-----------|------|-------------|
|
418
|
+
| request | ``` Required ``` | Request for creating a customer |
|
419
|
+
|
420
|
+
|
421
|
+
#### Example Usage
|
422
|
+
|
423
|
+
```ruby
|
424
|
+
request = CreateCustomerRequest.new
|
425
|
+
|
426
|
+
result = customers.create_customer(request)
|
427
|
+
|
428
|
+
```
|
429
|
+
|
430
|
+
|
431
|
+
### <a name="get_customer"></a> get_customer
|
432
|
+
|
433
|
+
> Get a customer
|
434
|
+
|
435
|
+
|
436
|
+
```ruby
|
437
|
+
def get_customer(customer_id); end
|
438
|
+
```
|
439
|
+
|
440
|
+
#### Parameters
|
441
|
+
|
442
|
+
| Parameter | Tags | Description |
|
443
|
+
|-----------|------|-------------|
|
444
|
+
| customer_id | ``` Required ``` | Customer Id |
|
445
|
+
|
446
|
+
|
447
|
+
#### Example Usage
|
448
|
+
|
449
|
+
```ruby
|
450
|
+
customer_id = 'customer_id'
|
451
|
+
|
452
|
+
result = customers.get_customer(customer_id)
|
453
|
+
|
454
|
+
```
|
455
|
+
|
456
|
+
|
457
|
+
### <a name="update_card"></a> update_card
|
458
|
+
|
459
|
+
> Updates a card
|
460
|
+
|
461
|
+
|
462
|
+
```ruby
|
463
|
+
def update_card(customer_id,
|
464
|
+
card_id,
|
465
|
+
request); end
|
466
|
+
```
|
467
|
+
|
468
|
+
#### Parameters
|
469
|
+
|
470
|
+
| Parameter | Tags | Description |
|
471
|
+
|-----------|------|-------------|
|
472
|
+
| customer_id | ``` Required ``` | Customer Id |
|
473
|
+
| card_id | ``` Required ``` | Card id |
|
474
|
+
| request | ``` Required ``` | Request for updating a card |
|
475
|
+
|
476
|
+
|
477
|
+
#### Example Usage
|
478
|
+
|
479
|
+
```ruby
|
480
|
+
customer_id = 'customer_id'
|
481
|
+
card_id = 'card_id'
|
482
|
+
request = UpdateCardRequest.new
|
483
|
+
|
484
|
+
result = customers.update_card(customer_id, card_id, request)
|
485
|
+
|
486
|
+
```
|
487
|
+
|
488
|
+
|
489
|
+
### <a name="update_address"></a> update_address
|
490
|
+
|
491
|
+
> Updates an address
|
492
|
+
|
493
|
+
|
494
|
+
```ruby
|
495
|
+
def update_address(customer_id,
|
496
|
+
address_id,
|
497
|
+
request); end
|
498
|
+
```
|
499
|
+
|
500
|
+
#### Parameters
|
501
|
+
|
502
|
+
| Parameter | Tags | Description |
|
503
|
+
|-----------|------|-------------|
|
504
|
+
| customer_id | ``` Required ``` | Customer Id |
|
505
|
+
| address_id | ``` Required ``` | Address Id |
|
506
|
+
| request | ``` Required ``` | Request for updating an address |
|
507
|
+
|
508
|
+
|
509
|
+
#### Example Usage
|
510
|
+
|
511
|
+
```ruby
|
512
|
+
customer_id = 'customer_id'
|
513
|
+
address_id = 'address_id'
|
514
|
+
request = UpdateAddressRequest.new
|
515
|
+
|
516
|
+
result = customers.update_address(customer_id, address_id, request)
|
517
|
+
|
518
|
+
```
|
519
|
+
|
520
|
+
|
521
|
+
### <a name="get_address"></a> get_address
|
522
|
+
|
523
|
+
> Get a customer's address
|
524
|
+
|
525
|
+
|
526
|
+
```ruby
|
527
|
+
def get_address(customer_id,
|
528
|
+
address_id); end
|
529
|
+
```
|
530
|
+
|
531
|
+
#### Parameters
|
532
|
+
|
533
|
+
| Parameter | Tags | Description |
|
534
|
+
|-----------|------|-------------|
|
535
|
+
| customer_id | ``` Required ``` | Customer id |
|
536
|
+
| address_id | ``` Required ``` | Address Id |
|
537
|
+
|
538
|
+
|
539
|
+
#### Example Usage
|
540
|
+
|
541
|
+
```ruby
|
542
|
+
customer_id = 'customer_id'
|
543
|
+
address_id = 'address_id'
|
544
|
+
|
545
|
+
result = customers.get_address(customer_id, address_id)
|
546
|
+
|
547
|
+
```
|
548
|
+
|
549
|
+
|
550
|
+
### <a name="delete_address"></a> delete_address
|
551
|
+
|
552
|
+
> Delete a Customer's address
|
553
|
+
|
554
|
+
|
555
|
+
```ruby
|
556
|
+
def delete_address(customer_id,
|
557
|
+
address_id); end
|
558
|
+
```
|
559
|
+
|
560
|
+
#### Parameters
|
561
|
+
|
562
|
+
| Parameter | Tags | Description |
|
563
|
+
|-----------|------|-------------|
|
564
|
+
| customer_id | ``` Required ``` | Customer Id |
|
565
|
+
| address_id | ``` Required ``` | Address Id |
|
566
|
+
|
567
|
+
|
568
|
+
#### Example Usage
|
569
|
+
|
570
|
+
```ruby
|
571
|
+
customer_id = 'customer_id'
|
572
|
+
address_id = 'address_id'
|
573
|
+
|
574
|
+
result = customers.delete_address(customer_id, address_id)
|
575
|
+
|
576
|
+
```
|
577
|
+
|
578
|
+
|
579
|
+
### <a name="delete_card"></a> delete_card
|
580
|
+
|
581
|
+
> Delete a customer's card
|
582
|
+
|
583
|
+
|
584
|
+
```ruby
|
585
|
+
def delete_card(customer_id,
|
586
|
+
card_id); end
|
587
|
+
```
|
588
|
+
|
589
|
+
#### Parameters
|
590
|
+
|
591
|
+
| Parameter | Tags | Description |
|
592
|
+
|-----------|------|-------------|
|
593
|
+
| customer_id | ``` Required ``` | Customer Id |
|
594
|
+
| card_id | ``` Required ``` | Card Id |
|
595
|
+
|
596
|
+
|
597
|
+
#### Example Usage
|
598
|
+
|
599
|
+
```ruby
|
600
|
+
customer_id = 'customer_id'
|
601
|
+
card_id = 'card_id'
|
602
|
+
|
603
|
+
result = customers.delete_card(customer_id, card_id)
|
604
|
+
|
605
|
+
```
|
606
|
+
|
607
|
+
|
608
|
+
### <a name="create_address"></a> create_address
|
609
|
+
|
610
|
+
> Creates a new address for a customer
|
611
|
+
|
612
|
+
|
613
|
+
```ruby
|
614
|
+
def create_address(customer_id,
|
615
|
+
request); end
|
616
|
+
```
|
617
|
+
|
618
|
+
#### Parameters
|
619
|
+
|
620
|
+
| Parameter | Tags | Description |
|
621
|
+
|-----------|------|-------------|
|
622
|
+
| customer_id | ``` Required ``` | Customer Id |
|
623
|
+
| request | ``` Required ``` | Request for creating an address |
|
624
|
+
|
625
|
+
|
626
|
+
#### Example Usage
|
627
|
+
|
628
|
+
```ruby
|
629
|
+
customer_id = 'customer_id'
|
630
|
+
request = CreateAddressRequest.new
|
631
|
+
|
632
|
+
result = customers.create_address(customer_id, request)
|
633
|
+
|
634
|
+
```
|
635
|
+
|
636
|
+
|
637
|
+
### <a name="get_card"></a> get_card
|
638
|
+
|
639
|
+
> Get a customer's card
|
640
|
+
|
641
|
+
|
642
|
+
```ruby
|
643
|
+
def get_card(customer_id,
|
644
|
+
card_id); end
|
645
|
+
```
|
646
|
+
|
647
|
+
#### Parameters
|
648
|
+
|
649
|
+
| Parameter | Tags | Description |
|
650
|
+
|-----------|------|-------------|
|
651
|
+
| customer_id | ``` Required ``` | Customer id |
|
652
|
+
| card_id | ``` Required ``` | Card id |
|
653
|
+
|
654
|
+
|
655
|
+
#### Example Usage
|
656
|
+
|
657
|
+
```ruby
|
658
|
+
customer_id = 'customer_id'
|
659
|
+
card_id = 'card_id'
|
660
|
+
|
661
|
+
result = customers.get_card(customer_id, card_id)
|
662
|
+
|
663
|
+
```
|
664
|
+
|
665
|
+
|
666
|
+
### <a name="create_card"></a> create_card
|
667
|
+
|
668
|
+
> Creates a new card for a customer
|
669
|
+
|
670
|
+
|
671
|
+
```ruby
|
672
|
+
def create_card(customer_id,
|
673
|
+
request); end
|
674
|
+
```
|
675
|
+
|
676
|
+
#### Parameters
|
677
|
+
|
678
|
+
| Parameter | Tags | Description |
|
679
|
+
|-----------|------|-------------|
|
680
|
+
| customer_id | ``` Required ``` | Customer id |
|
681
|
+
| request | ``` Required ``` | Request for creating a card |
|
682
|
+
|
683
|
+
|
684
|
+
#### Example Usage
|
685
|
+
|
686
|
+
```ruby
|
687
|
+
customer_id = 'customer_id'
|
688
|
+
request = CreateCardRequest.new
|
689
|
+
|
690
|
+
result = customers.create_card(customer_id, request)
|
691
|
+
|
692
|
+
```
|
693
|
+
|
694
|
+
|
695
|
+
### <a name="update_customer"></a> update_customer
|
696
|
+
|
697
|
+
> Updates a customer
|
698
|
+
|
699
|
+
|
700
|
+
```ruby
|
701
|
+
def update_customer(customer_id,
|
702
|
+
request); end
|
703
|
+
```
|
704
|
+
|
705
|
+
#### Parameters
|
706
|
+
|
707
|
+
| Parameter | Tags | Description |
|
708
|
+
|-----------|------|-------------|
|
709
|
+
| customer_id | ``` Required ``` | Customer id |
|
710
|
+
| request | ``` Required ``` | Request for updating a customer |
|
711
|
+
|
712
|
+
|
713
|
+
#### Example Usage
|
714
|
+
|
715
|
+
```ruby
|
716
|
+
customer_id = 'customer_id'
|
717
|
+
request = UpdateCustomerRequest.new
|
718
|
+
|
719
|
+
result = customers.update_customer(customer_id, request)
|
720
|
+
|
721
|
+
```
|
722
|
+
|
723
|
+
|
724
|
+
### <a name="delete_access_tokens"></a> delete_access_tokens
|
725
|
+
|
726
|
+
> Delete a Customer's access tokens
|
727
|
+
|
728
|
+
|
729
|
+
```ruby
|
730
|
+
def delete_access_tokens(customer_id); end
|
731
|
+
```
|
732
|
+
|
733
|
+
#### Parameters
|
734
|
+
|
735
|
+
| Parameter | Tags | Description |
|
736
|
+
|-----------|------|-------------|
|
737
|
+
| customer_id | ``` Required ``` | Customer Id |
|
738
|
+
|
739
|
+
|
740
|
+
#### Example Usage
|
741
|
+
|
742
|
+
```ruby
|
743
|
+
customer_id = 'customer_id'
|
744
|
+
|
745
|
+
result = customers.delete_access_tokens(customer_id)
|
746
|
+
|
747
|
+
```
|
748
|
+
|
749
|
+
|
750
|
+
### <a name="get_customers"></a> get_customers
|
751
|
+
|
752
|
+
> Get all Customers
|
753
|
+
|
754
|
+
|
755
|
+
```ruby
|
756
|
+
def get_customers(name = nil,
|
757
|
+
document = nil,
|
758
|
+
page = 1,
|
759
|
+
size = 10,
|
760
|
+
email = nil); end
|
761
|
+
```
|
762
|
+
|
763
|
+
#### Parameters
|
764
|
+
|
765
|
+
| Parameter | Tags | Description |
|
766
|
+
|-----------|------|-------------|
|
767
|
+
| name | ``` Optional ``` | Name of the Customer |
|
768
|
+
| document | ``` Optional ``` | Document of the Customer |
|
769
|
+
| page | ``` Optional ``` ``` DefaultValue ``` | Current page the the search |
|
770
|
+
| size | ``` Optional ``` ``` DefaultValue ``` | Quantity pages of the search |
|
771
|
+
| email | ``` Optional ``` | Customer's email |
|
772
|
+
|
773
|
+
|
774
|
+
#### Example Usage
|
775
|
+
|
776
|
+
```ruby
|
777
|
+
name = 'name'
|
778
|
+
document = 'document'
|
779
|
+
page = 1
|
780
|
+
size = 10
|
781
|
+
email = 'email'
|
782
|
+
|
783
|
+
result = customers.get_customers(name, document, page, size, email)
|
784
|
+
|
785
|
+
```
|
786
|
+
|
787
|
+
|
788
|
+
### <a name="get_access_token"></a> get_access_token
|
789
|
+
|
790
|
+
> Get a Customer's access token
|
791
|
+
|
792
|
+
|
793
|
+
```ruby
|
794
|
+
def get_access_token(customer_id,
|
795
|
+
token_id); end
|
796
|
+
```
|
797
|
+
|
798
|
+
#### Parameters
|
799
|
+
|
800
|
+
| Parameter | Tags | Description |
|
801
|
+
|-----------|------|-------------|
|
802
|
+
| customer_id | ``` Required ``` | Customer Id |
|
803
|
+
| token_id | ``` Required ``` | Token Id |
|
804
|
+
|
805
|
+
|
806
|
+
#### Example Usage
|
807
|
+
|
808
|
+
```ruby
|
809
|
+
customer_id = 'customer_id'
|
810
|
+
token_id = 'token_id'
|
811
|
+
|
812
|
+
result = customers.get_access_token(customer_id, token_id)
|
813
|
+
|
814
|
+
```
|
815
|
+
|
816
|
+
|
817
|
+
### <a name="create_access_token"></a> create_access_token
|
818
|
+
|
819
|
+
> Creates a access token for a customer
|
820
|
+
|
821
|
+
|
822
|
+
```ruby
|
823
|
+
def create_access_token(customer_id,
|
824
|
+
request); end
|
825
|
+
```
|
826
|
+
|
827
|
+
#### Parameters
|
828
|
+
|
829
|
+
| Parameter | Tags | Description |
|
830
|
+
|-----------|------|-------------|
|
831
|
+
| customer_id | ``` Required ``` | Customer Id |
|
832
|
+
| request | ``` Required ``` | Request for creating a access token |
|
833
|
+
|
834
|
+
|
835
|
+
#### Example Usage
|
836
|
+
|
837
|
+
```ruby
|
838
|
+
customer_id = 'customer_id'
|
839
|
+
request = CreateAccessTokenRequest.new
|
840
|
+
|
841
|
+
result = customers.create_access_token(customer_id, request)
|
842
|
+
|
843
|
+
```
|
844
|
+
|
845
|
+
|
846
|
+
### <a name="delete_access_token"></a> delete_access_token
|
847
|
+
|
848
|
+
> Delete a customer's access token
|
849
|
+
|
850
|
+
|
851
|
+
```ruby
|
852
|
+
def delete_access_token(customer_id,
|
853
|
+
token_id); end
|
854
|
+
```
|
855
|
+
|
856
|
+
#### Parameters
|
857
|
+
|
858
|
+
| Parameter | Tags | Description |
|
859
|
+
|-----------|------|-------------|
|
860
|
+
| customer_id | ``` Required ``` | Customer Id |
|
861
|
+
| token_id | ``` Required ``` | Token Id |
|
862
|
+
|
863
|
+
|
864
|
+
#### Example Usage
|
865
|
+
|
866
|
+
```ruby
|
867
|
+
customer_id = 'customer_id'
|
868
|
+
token_id = 'token_id'
|
869
|
+
|
870
|
+
result = customers.delete_access_token(customer_id, token_id)
|
871
|
+
|
872
|
+
```
|
873
|
+
|
874
|
+
|
875
|
+
### <a name="update_customer_metadata"></a> update_customer_metadata
|
876
|
+
|
877
|
+
> Updates the metadata a customer
|
878
|
+
|
879
|
+
|
880
|
+
```ruby
|
881
|
+
def update_customer_metadata(customer_id,
|
882
|
+
request); end
|
883
|
+
```
|
884
|
+
|
885
|
+
#### Parameters
|
886
|
+
|
887
|
+
| Parameter | Tags | Description |
|
888
|
+
|-----------|------|-------------|
|
889
|
+
| customer_id | ``` Required ``` | The customer id |
|
890
|
+
| request | ``` Required ``` | Request for updating the customer metadata |
|
891
|
+
|
892
|
+
|
893
|
+
#### Example Usage
|
894
|
+
|
895
|
+
```ruby
|
896
|
+
customer_id = 'customer_id'
|
897
|
+
request = UpdateMetadataRequest.new
|
898
|
+
|
899
|
+
result = customers.update_customer_metadata(customer_id, request)
|
900
|
+
|
901
|
+
```
|
902
|
+
|
903
|
+
|
904
|
+
### <a name="get_access_tokens"></a> get_access_tokens
|
905
|
+
|
906
|
+
> Get all access tokens from a customer
|
907
|
+
|
908
|
+
|
909
|
+
```ruby
|
910
|
+
def get_access_tokens(customer_id,
|
911
|
+
page = nil,
|
912
|
+
size = nil); end
|
913
|
+
```
|
914
|
+
|
915
|
+
#### Parameters
|
916
|
+
|
917
|
+
| Parameter | Tags | Description |
|
918
|
+
|-----------|------|-------------|
|
919
|
+
| customer_id | ``` Required ``` | Customer Id |
|
920
|
+
| page | ``` Optional ``` | Page number |
|
921
|
+
| size | ``` Optional ``` | Page size |
|
922
|
+
|
923
|
+
|
924
|
+
#### Example Usage
|
925
|
+
|
926
|
+
```ruby
|
927
|
+
customer_id = 'customer_id'
|
928
|
+
page = 60
|
929
|
+
size = 60
|
930
|
+
|
931
|
+
result = customers.get_access_tokens(customer_id, page, size)
|
932
|
+
|
933
|
+
```
|
934
|
+
|
935
|
+
|
936
|
+
### <a name="get_addresses"></a> get_addresses
|
937
|
+
|
938
|
+
> Gets all adressess from a customer
|
939
|
+
|
940
|
+
|
941
|
+
```ruby
|
942
|
+
def get_addresses(customer_id,
|
943
|
+
page = nil,
|
944
|
+
size = nil); end
|
945
|
+
```
|
946
|
+
|
947
|
+
#### Parameters
|
948
|
+
|
949
|
+
| Parameter | Tags | Description |
|
950
|
+
|-----------|------|-------------|
|
951
|
+
| customer_id | ``` Required ``` | Customer id |
|
952
|
+
| page | ``` Optional ``` | Page number |
|
953
|
+
| size | ``` Optional ``` | Page size |
|
954
|
+
|
955
|
+
|
956
|
+
#### Example Usage
|
957
|
+
|
958
|
+
```ruby
|
959
|
+
customer_id = 'customer_id'
|
960
|
+
page = 60
|
961
|
+
size = 60
|
962
|
+
|
963
|
+
result = customers.get_addresses(customer_id, page, size)
|
964
|
+
|
965
|
+
```
|
966
|
+
|
967
|
+
|
968
|
+
### <a name="get_cards"></a> get_cards
|
969
|
+
|
970
|
+
> Get all cards from a customer
|
971
|
+
|
972
|
+
|
973
|
+
```ruby
|
974
|
+
def get_cards(customer_id,
|
975
|
+
page = nil,
|
976
|
+
size = nil); end
|
977
|
+
```
|
978
|
+
|
979
|
+
#### Parameters
|
980
|
+
|
981
|
+
| Parameter | Tags | Description |
|
982
|
+
|-----------|------|-------------|
|
983
|
+
| customer_id | ``` Required ``` | Customer Id |
|
984
|
+
| page | ``` Optional ``` | Page number |
|
985
|
+
| size | ``` Optional ``` | Page size |
|
986
|
+
|
987
|
+
|
988
|
+
#### Example Usage
|
989
|
+
|
990
|
+
```ruby
|
991
|
+
customer_id = 'customer_id'
|
992
|
+
page = 19
|
993
|
+
size = 19
|
994
|
+
|
995
|
+
result = customers.get_cards(customer_id, page, size)
|
996
|
+
|
997
|
+
```
|
998
|
+
|
999
|
+
|
1000
|
+
[Back to List of Controllers](#list_of_controllers)
|
1001
|
+
|
1002
|
+
## <a name="invoices_controller"></a> InvoicesController
|
1003
|
+
|
1004
|
+
### Get singleton instance
|
1005
|
+
|
1006
|
+
The singleton instance of the ``` InvoicesController ``` class can be accessed from the API Client.
|
1007
|
+
|
1008
|
+
```ruby
|
1009
|
+
invoices = client.invoices
|
1010
|
+
```
|
1011
|
+
|
1012
|
+
### <a name="get_invoice"></a> get_invoice
|
1013
|
+
|
1014
|
+
> Gets an invoice
|
1015
|
+
|
1016
|
+
|
1017
|
+
```ruby
|
1018
|
+
def get_invoice(invoice_id); end
|
1019
|
+
```
|
1020
|
+
|
1021
|
+
#### Parameters
|
1022
|
+
|
1023
|
+
| Parameter | Tags | Description |
|
1024
|
+
|-----------|------|-------------|
|
1025
|
+
| invoice_id | ``` Required ``` | Invoice Id |
|
1026
|
+
|
1027
|
+
|
1028
|
+
#### Example Usage
|
1029
|
+
|
1030
|
+
```ruby
|
1031
|
+
invoice_id = 'invoice_id'
|
1032
|
+
|
1033
|
+
result = invoices.get_invoice(invoice_id)
|
1034
|
+
|
1035
|
+
```
|
1036
|
+
|
1037
|
+
|
1038
|
+
### <a name="cancel_invoice"></a> cancel_invoice
|
1039
|
+
|
1040
|
+
> Cancels an invoice
|
1041
|
+
|
1042
|
+
|
1043
|
+
```ruby
|
1044
|
+
def cancel_invoice(invoice_id); end
|
1045
|
+
```
|
1046
|
+
|
1047
|
+
#### Parameters
|
1048
|
+
|
1049
|
+
| Parameter | Tags | Description |
|
1050
|
+
|-----------|------|-------------|
|
1051
|
+
| invoice_id | ``` Required ``` | Invoice id |
|
1052
|
+
|
1053
|
+
|
1054
|
+
#### Example Usage
|
1055
|
+
|
1056
|
+
```ruby
|
1057
|
+
invoice_id = 'invoice_id'
|
1058
|
+
|
1059
|
+
result = invoices.cancel_invoice(invoice_id)
|
1060
|
+
|
1061
|
+
```
|
1062
|
+
|
1063
|
+
|
1064
|
+
### <a name="update_invoice_metadata"></a> update_invoice_metadata
|
1065
|
+
|
1066
|
+
> Updates the metadata from an invoice
|
1067
|
+
|
1068
|
+
|
1069
|
+
```ruby
|
1070
|
+
def update_invoice_metadata(invoice_id,
|
1071
|
+
request); end
|
1072
|
+
```
|
1073
|
+
|
1074
|
+
#### Parameters
|
1075
|
+
|
1076
|
+
| Parameter | Tags | Description |
|
1077
|
+
|-----------|------|-------------|
|
1078
|
+
| invoice_id | ``` Required ``` | The invoice id |
|
1079
|
+
| request | ``` Required ``` | Request for updating the invoice metadata |
|
1080
|
+
|
1081
|
+
|
1082
|
+
#### Example Usage
|
1083
|
+
|
1084
|
+
```ruby
|
1085
|
+
invoice_id = 'invoice_id'
|
1086
|
+
request = UpdateMetadataRequest.new
|
1087
|
+
|
1088
|
+
result = invoices.update_invoice_metadata(invoice_id, request)
|
1089
|
+
|
1090
|
+
```
|
1091
|
+
|
1092
|
+
|
1093
|
+
### <a name="get_invoices"></a> get_invoices
|
1094
|
+
|
1095
|
+
> Gets all invoices
|
1096
|
+
|
1097
|
+
|
1098
|
+
```ruby
|
1099
|
+
def get_invoices(page = nil,
|
1100
|
+
size = nil,
|
1101
|
+
code = nil,
|
1102
|
+
customer_id = nil,
|
1103
|
+
subscription_id = nil,
|
1104
|
+
created_since = nil,
|
1105
|
+
created_until = nil,
|
1106
|
+
status = nil,
|
1107
|
+
due_since = nil,
|
1108
|
+
due_until = nil); end
|
1109
|
+
```
|
1110
|
+
|
1111
|
+
#### Parameters
|
1112
|
+
|
1113
|
+
| Parameter | Tags | Description |
|
1114
|
+
|-----------|------|-------------|
|
1115
|
+
| page | ``` Optional ``` | Page number |
|
1116
|
+
| size | ``` Optional ``` | Page size |
|
1117
|
+
| code | ``` Optional ``` | Filter for Invoice's code |
|
1118
|
+
| customer_id | ``` Optional ``` | Filter for Invoice's customer id |
|
1119
|
+
| subscription_id | ``` Optional ``` | Filter for Invoice's subscription id |
|
1120
|
+
| created_since | ``` Optional ``` | Filter for Invoice's creation date start range |
|
1121
|
+
| created_until | ``` Optional ``` | Filter for Invoices creation date end range |
|
1122
|
+
| status | ``` Optional ``` | Filter for Invoice's status |
|
1123
|
+
| due_since | ``` Optional ``` | Filter for Invoice's due date start range |
|
1124
|
+
| due_until | ``` Optional ``` | Filter for Invoice's due date end range |
|
1125
|
+
|
1126
|
+
|
1127
|
+
#### Example Usage
|
1128
|
+
|
1129
|
+
```ruby
|
1130
|
+
page = 19
|
1131
|
+
size = 19
|
1132
|
+
code = 'code'
|
1133
|
+
customer_id = 'customer_id'
|
1134
|
+
subscription_id = 'subscription_id'
|
1135
|
+
created_since = DateTime.now
|
1136
|
+
created_until = DateTime.now
|
1137
|
+
status = 'status'
|
1138
|
+
due_since = DateTime.now
|
1139
|
+
due_until = DateTime.now
|
1140
|
+
|
1141
|
+
result = invoices.get_invoices(page, size, code, customer_id, subscription_id, created_since, created_until, status, due_since, due_until)
|
1142
|
+
|
1143
|
+
```
|
1144
|
+
|
1145
|
+
|
1146
|
+
[Back to List of Controllers](#list_of_controllers)
|
1147
|
+
|
1148
|
+
## <a name="plans_controller"></a> PlansController
|
1149
|
+
|
1150
|
+
### Get singleton instance
|
1151
|
+
|
1152
|
+
The singleton instance of the ``` PlansController ``` class can be accessed from the API Client.
|
1153
|
+
|
1154
|
+
```ruby
|
1155
|
+
plans = client.plans
|
1156
|
+
```
|
1157
|
+
|
1158
|
+
### <a name="update_plan_item"></a> update_plan_item
|
1159
|
+
|
1160
|
+
> Updates a plan item
|
1161
|
+
|
1162
|
+
|
1163
|
+
```ruby
|
1164
|
+
def update_plan_item(plan_id,
|
1165
|
+
plan_item_id,
|
1166
|
+
body); end
|
1167
|
+
```
|
1168
|
+
|
1169
|
+
#### Parameters
|
1170
|
+
|
1171
|
+
| Parameter | Tags | Description |
|
1172
|
+
|-----------|------|-------------|
|
1173
|
+
| plan_id | ``` Required ``` | Plan id |
|
1174
|
+
| plan_item_id | ``` Required ``` | Plan item id |
|
1175
|
+
| body | ``` Required ``` | Request for updating the plan item |
|
1176
|
+
|
1177
|
+
|
1178
|
+
#### Example Usage
|
1179
|
+
|
1180
|
+
```ruby
|
1181
|
+
plan_id = 'plan_id'
|
1182
|
+
plan_item_id = 'plan_item_id'
|
1183
|
+
body = UpdatePlanItemRequest.new
|
1184
|
+
|
1185
|
+
result = plans.update_plan_item(plan_id, plan_item_id, body)
|
1186
|
+
|
1187
|
+
```
|
1188
|
+
|
1189
|
+
|
1190
|
+
### <a name="get_plan"></a> get_plan
|
1191
|
+
|
1192
|
+
> Gets a plan
|
1193
|
+
|
1194
|
+
|
1195
|
+
```ruby
|
1196
|
+
def get_plan(plan_id); end
|
1197
|
+
```
|
1198
|
+
|
1199
|
+
#### Parameters
|
1200
|
+
|
1201
|
+
| Parameter | Tags | Description |
|
1202
|
+
|-----------|------|-------------|
|
1203
|
+
| plan_id | ``` Required ``` | Plan id |
|
1204
|
+
|
1205
|
+
|
1206
|
+
#### Example Usage
|
1207
|
+
|
1208
|
+
```ruby
|
1209
|
+
plan_id = 'plan_id'
|
1210
|
+
|
1211
|
+
result = plans.get_plan(plan_id)
|
1212
|
+
|
1213
|
+
```
|
1214
|
+
|
1215
|
+
|
1216
|
+
### <a name="create_plan_item"></a> create_plan_item
|
1217
|
+
|
1218
|
+
> Adds a new item to a plan
|
1219
|
+
|
1220
|
+
|
1221
|
+
```ruby
|
1222
|
+
def create_plan_item(plan_id,
|
1223
|
+
request); end
|
1224
|
+
```
|
1225
|
+
|
1226
|
+
#### Parameters
|
1227
|
+
|
1228
|
+
| Parameter | Tags | Description |
|
1229
|
+
|-----------|------|-------------|
|
1230
|
+
| plan_id | ``` Required ``` | Plan id |
|
1231
|
+
| request | ``` Required ``` | Request for creating a plan item |
|
1232
|
+
|
1233
|
+
|
1234
|
+
#### Example Usage
|
1235
|
+
|
1236
|
+
```ruby
|
1237
|
+
plan_id = 'plan_id'
|
1238
|
+
request = CreatePlanItemRequest.new
|
1239
|
+
|
1240
|
+
result = plans.create_plan_item(plan_id, request)
|
1241
|
+
|
1242
|
+
```
|
1243
|
+
|
1244
|
+
|
1245
|
+
### <a name="update_plan"></a> update_plan
|
1246
|
+
|
1247
|
+
> Updates a plan
|
1248
|
+
|
1249
|
+
|
1250
|
+
```ruby
|
1251
|
+
def update_plan(plan_id,
|
1252
|
+
request); end
|
1253
|
+
```
|
1254
|
+
|
1255
|
+
#### Parameters
|
1256
|
+
|
1257
|
+
| Parameter | Tags | Description |
|
1258
|
+
|-----------|------|-------------|
|
1259
|
+
| plan_id | ``` Required ``` | Plan id |
|
1260
|
+
| request | ``` Required ``` | Request for updating a plan |
|
1261
|
+
|
1262
|
+
|
1263
|
+
#### Example Usage
|
1264
|
+
|
1265
|
+
```ruby
|
1266
|
+
plan_id = 'plan_id'
|
1267
|
+
request = UpdatePlanRequest.new
|
1268
|
+
|
1269
|
+
result = plans.update_plan(plan_id, request)
|
1270
|
+
|
1271
|
+
```
|
1272
|
+
|
1273
|
+
|
1274
|
+
### <a name="create_plan"></a> create_plan
|
1275
|
+
|
1276
|
+
> Creates a new plan
|
1277
|
+
|
1278
|
+
|
1279
|
+
```ruby
|
1280
|
+
def create_plan(body); end
|
1281
|
+
```
|
1282
|
+
|
1283
|
+
#### Parameters
|
1284
|
+
|
1285
|
+
| Parameter | Tags | Description |
|
1286
|
+
|-----------|------|-------------|
|
1287
|
+
| body | ``` Required ``` | Request for creating a plan |
|
1288
|
+
|
1289
|
+
|
1290
|
+
#### Example Usage
|
1291
|
+
|
1292
|
+
```ruby
|
1293
|
+
body = CreatePlanRequest.new
|
1294
|
+
|
1295
|
+
result = plans.create_plan(body)
|
1296
|
+
|
1297
|
+
```
|
1298
|
+
|
1299
|
+
|
1300
|
+
### <a name="delete_plan"></a> delete_plan
|
1301
|
+
|
1302
|
+
> Deletes a plan
|
1303
|
+
|
1304
|
+
|
1305
|
+
```ruby
|
1306
|
+
def delete_plan(plan_id); end
|
1307
|
+
```
|
1308
|
+
|
1309
|
+
#### Parameters
|
1310
|
+
|
1311
|
+
| Parameter | Tags | Description |
|
1312
|
+
|-----------|------|-------------|
|
1313
|
+
| plan_id | ``` Required ``` | Plan id |
|
1314
|
+
|
1315
|
+
|
1316
|
+
#### Example Usage
|
1317
|
+
|
1318
|
+
```ruby
|
1319
|
+
plan_id = 'plan_id'
|
1320
|
+
|
1321
|
+
result = plans.delete_plan(plan_id)
|
1322
|
+
|
1323
|
+
```
|
1324
|
+
|
1325
|
+
|
1326
|
+
### <a name="get_plan_item"></a> get_plan_item
|
1327
|
+
|
1328
|
+
> Gets a plan item
|
1329
|
+
|
1330
|
+
|
1331
|
+
```ruby
|
1332
|
+
def get_plan_item(plan_id,
|
1333
|
+
plan_item_id); end
|
1334
|
+
```
|
1335
|
+
|
1336
|
+
#### Parameters
|
1337
|
+
|
1338
|
+
| Parameter | Tags | Description |
|
1339
|
+
|-----------|------|-------------|
|
1340
|
+
| plan_id | ``` Required ``` | Plan id |
|
1341
|
+
| plan_item_id | ``` Required ``` | Plan item id |
|
1342
|
+
|
1343
|
+
|
1344
|
+
#### Example Usage
|
1345
|
+
|
1346
|
+
```ruby
|
1347
|
+
plan_id = 'plan_id'
|
1348
|
+
plan_item_id = 'plan_item_id'
|
1349
|
+
|
1350
|
+
result = plans.get_plan_item(plan_id, plan_item_id)
|
1351
|
+
|
1352
|
+
```
|
1353
|
+
|
1354
|
+
|
1355
|
+
### <a name="delete_plan_item"></a> delete_plan_item
|
1356
|
+
|
1357
|
+
> Removes an item from a plan
|
1358
|
+
|
1359
|
+
|
1360
|
+
```ruby
|
1361
|
+
def delete_plan_item(plan_id,
|
1362
|
+
plan_item_id); end
|
1363
|
+
```
|
1364
|
+
|
1365
|
+
#### Parameters
|
1366
|
+
|
1367
|
+
| Parameter | Tags | Description |
|
1368
|
+
|-----------|------|-------------|
|
1369
|
+
| plan_id | ``` Required ``` | Plan id |
|
1370
|
+
| plan_item_id | ``` Required ``` | Plan item id |
|
1371
|
+
|
1372
|
+
|
1373
|
+
#### Example Usage
|
1374
|
+
|
1375
|
+
```ruby
|
1376
|
+
plan_id = 'plan_id'
|
1377
|
+
plan_item_id = 'plan_item_id'
|
1378
|
+
|
1379
|
+
result = plans.delete_plan_item(plan_id, plan_item_id)
|
1380
|
+
|
1381
|
+
```
|
1382
|
+
|
1383
|
+
|
1384
|
+
### <a name="update_plan_metadata"></a> update_plan_metadata
|
1385
|
+
|
1386
|
+
> Updates the metadata from a plan
|
1387
|
+
|
1388
|
+
|
1389
|
+
```ruby
|
1390
|
+
def update_plan_metadata(plan_id,
|
1391
|
+
request); end
|
1392
|
+
```
|
1393
|
+
|
1394
|
+
#### Parameters
|
1395
|
+
|
1396
|
+
| Parameter | Tags | Description |
|
1397
|
+
|-----------|------|-------------|
|
1398
|
+
| plan_id | ``` Required ``` | The plan id |
|
1399
|
+
| request | ``` Required ``` | Request for updating the plan metadata |
|
1400
|
+
|
1401
|
+
|
1402
|
+
#### Example Usage
|
1403
|
+
|
1404
|
+
```ruby
|
1405
|
+
plan_id = 'plan_id'
|
1406
|
+
request = UpdateMetadataRequest.new
|
1407
|
+
|
1408
|
+
result = plans.update_plan_metadata(plan_id, request)
|
1409
|
+
|
1410
|
+
```
|
1411
|
+
|
1412
|
+
|
1413
|
+
### <a name="get_plans"></a> get_plans
|
1414
|
+
|
1415
|
+
> Gets all plans
|
1416
|
+
|
1417
|
+
|
1418
|
+
```ruby
|
1419
|
+
def get_plans(page = nil,
|
1420
|
+
size = nil,
|
1421
|
+
name = nil,
|
1422
|
+
status = nil,
|
1423
|
+
billing_type = nil,
|
1424
|
+
created_since = nil,
|
1425
|
+
created_until = nil); end
|
1426
|
+
```
|
1427
|
+
|
1428
|
+
#### Parameters
|
1429
|
+
|
1430
|
+
| Parameter | Tags | Description |
|
1431
|
+
|-----------|------|-------------|
|
1432
|
+
| page | ``` Optional ``` | Page number |
|
1433
|
+
| size | ``` Optional ``` | Page size |
|
1434
|
+
| name | ``` Optional ``` | Filter for Plan's name |
|
1435
|
+
| status | ``` Optional ``` | Filter for Plan's status |
|
1436
|
+
| billing_type | ``` Optional ``` | Filter for plan's billing type |
|
1437
|
+
| created_since | ``` Optional ``` | Filter for plan's creation date start range |
|
1438
|
+
| created_until | ``` Optional ``` | Filter for plan's creation date end range |
|
1439
|
+
|
1440
|
+
|
1441
|
+
#### Example Usage
|
1442
|
+
|
1443
|
+
```ruby
|
1444
|
+
page = 19
|
1445
|
+
size = 19
|
1446
|
+
name = 'name'
|
1447
|
+
status = 'status'
|
1448
|
+
billing_type = 'billing_type'
|
1449
|
+
created_since = DateTime.now
|
1450
|
+
created_until = DateTime.now
|
1451
|
+
|
1452
|
+
result = plans.get_plans(page, size, name, status, billing_type, created_since, created_until)
|
1453
|
+
|
1454
|
+
```
|
1455
|
+
|
1456
|
+
|
1457
|
+
[Back to List of Controllers](#list_of_controllers)
|
1458
|
+
|
1459
|
+
## <a name="subscriptions_controller"></a> SubscriptionsController
|
1460
|
+
|
1461
|
+
### Get singleton instance
|
1462
|
+
|
1463
|
+
The singleton instance of the ``` SubscriptionsController ``` class can be accessed from the API Client.
|
1464
|
+
|
1465
|
+
```ruby
|
1466
|
+
subscriptions = client.subscriptions
|
1467
|
+
```
|
1468
|
+
|
1469
|
+
### <a name="update_subscription_item"></a> update_subscription_item
|
1470
|
+
|
1471
|
+
> Updates a subscription item
|
1472
|
+
|
1473
|
+
|
1474
|
+
```ruby
|
1475
|
+
def update_subscription_item(subscription_id,
|
1476
|
+
item_id,
|
1477
|
+
body); end
|
1478
|
+
```
|
1479
|
+
|
1480
|
+
#### Parameters
|
1481
|
+
|
1482
|
+
| Parameter | Tags | Description |
|
1483
|
+
|-----------|------|-------------|
|
1484
|
+
| subscription_id | ``` Required ``` | Subscription Id |
|
1485
|
+
| item_id | ``` Required ``` | Item id |
|
1486
|
+
| body | ``` Required ``` | Request for updating a subscription item |
|
1487
|
+
|
1488
|
+
|
1489
|
+
#### Example Usage
|
1490
|
+
|
1491
|
+
```ruby
|
1492
|
+
subscription_id = 'subscription_id'
|
1493
|
+
item_id = 'item_id'
|
1494
|
+
body = UpdateSubscriptionItemRequest.new
|
1495
|
+
|
1496
|
+
result = subscriptions.update_subscription_item(subscription_id, item_id, body)
|
1497
|
+
|
1498
|
+
```
|
1499
|
+
|
1500
|
+
|
1501
|
+
### <a name="create_usage"></a> create_usage
|
1502
|
+
|
1503
|
+
> Creates a usage
|
1504
|
+
|
1505
|
+
|
1506
|
+
```ruby
|
1507
|
+
def create_usage(subscription_id,
|
1508
|
+
item_id,
|
1509
|
+
body); end
|
1510
|
+
```
|
1511
|
+
|
1512
|
+
#### Parameters
|
1513
|
+
|
1514
|
+
| Parameter | Tags | Description |
|
1515
|
+
|-----------|------|-------------|
|
1516
|
+
| subscription_id | ``` Required ``` | Subscription Id |
|
1517
|
+
| item_id | ``` Required ``` | Item id |
|
1518
|
+
| body | ``` Required ``` | Request for creating a usage |
|
1519
|
+
|
1520
|
+
|
1521
|
+
#### Example Usage
|
1522
|
+
|
1523
|
+
```ruby
|
1524
|
+
subscription_id = 'subscription_id'
|
1525
|
+
item_id = 'item_id'
|
1526
|
+
body = CreateUsageRequest.new
|
1527
|
+
|
1528
|
+
result = subscriptions.create_usage(subscription_id, item_id, body)
|
1529
|
+
|
1530
|
+
```
|
1531
|
+
|
1532
|
+
|
1533
|
+
### <a name="update_subscription_billing_date"></a> update_subscription_billing_date
|
1534
|
+
|
1535
|
+
> Updates the billing date from a subscription
|
1536
|
+
|
1537
|
+
|
1538
|
+
```ruby
|
1539
|
+
def update_subscription_billing_date(subscription_id,
|
1540
|
+
request); end
|
1541
|
+
```
|
1542
|
+
|
1543
|
+
#### Parameters
|
1544
|
+
|
1545
|
+
| Parameter | Tags | Description |
|
1546
|
+
|-----------|------|-------------|
|
1547
|
+
| subscription_id | ``` Required ``` | The subscription id |
|
1548
|
+
| request | ``` Required ``` | Request for updating the subscription billing date |
|
1549
|
+
|
1550
|
+
|
1551
|
+
#### Example Usage
|
1552
|
+
|
1553
|
+
```ruby
|
1554
|
+
subscription_id = 'subscription_id'
|
1555
|
+
request = UpdateSubscriptionBillingDateRequest.new
|
1556
|
+
|
1557
|
+
result = subscriptions.update_subscription_billing_date(subscription_id, request)
|
1558
|
+
|
1559
|
+
```
|
1560
|
+
|
1561
|
+
|
1562
|
+
### <a name="update_subscription_card"></a> update_subscription_card
|
1563
|
+
|
1564
|
+
> Updates the credit card from a subscription
|
1565
|
+
|
1566
|
+
|
1567
|
+
```ruby
|
1568
|
+
def update_subscription_card(subscription_id,
|
1569
|
+
request); end
|
1570
|
+
```
|
1571
|
+
|
1572
|
+
#### Parameters
|
1573
|
+
|
1574
|
+
| Parameter | Tags | Description |
|
1575
|
+
|-----------|------|-------------|
|
1576
|
+
| subscription_id | ``` Required ``` | Subscription id |
|
1577
|
+
| request | ``` Required ``` | Request for updating a card |
|
1578
|
+
|
1579
|
+
|
1580
|
+
#### Example Usage
|
1581
|
+
|
1582
|
+
```ruby
|
1583
|
+
subscription_id = 'subscription_id'
|
1584
|
+
request = UpdateSubscriptionCardRequest.new
|
1585
|
+
|
1586
|
+
result = subscriptions.update_subscription_card(subscription_id, request)
|
1587
|
+
|
1588
|
+
```
|
1589
|
+
|
1590
|
+
|
1591
|
+
### <a name="create_subscription"></a> create_subscription
|
1592
|
+
|
1593
|
+
> Creates a new subscription
|
1594
|
+
|
1595
|
+
|
1596
|
+
```ruby
|
1597
|
+
def create_subscription(body); end
|
1598
|
+
```
|
1599
|
+
|
1600
|
+
#### Parameters
|
1601
|
+
|
1602
|
+
| Parameter | Tags | Description |
|
1603
|
+
|-----------|------|-------------|
|
1604
|
+
| body | ``` Required ``` | Request for creating a subscription |
|
1605
|
+
|
1606
|
+
|
1607
|
+
#### Example Usage
|
1608
|
+
|
1609
|
+
```ruby
|
1610
|
+
body = CreateSubscriptionRequest.new
|
1611
|
+
|
1612
|
+
result = subscriptions.create_subscription(body)
|
1613
|
+
|
1614
|
+
```
|
1615
|
+
|
1616
|
+
|
1617
|
+
### <a name="create_subscription_item"></a> create_subscription_item
|
1618
|
+
|
1619
|
+
> Creates a new Subscription item
|
1620
|
+
|
1621
|
+
|
1622
|
+
```ruby
|
1623
|
+
def create_subscription_item(subscription_id,
|
1624
|
+
request); end
|
1625
|
+
```
|
1626
|
+
|
1627
|
+
#### Parameters
|
1628
|
+
|
1629
|
+
| Parameter | Tags | Description |
|
1630
|
+
|-----------|------|-------------|
|
1631
|
+
| subscription_id | ``` Required ``` | Subscription id |
|
1632
|
+
| request | ``` Required ``` | Request for creating a subscription item |
|
1633
|
+
|
1634
|
+
|
1635
|
+
#### Example Usage
|
1636
|
+
|
1637
|
+
```ruby
|
1638
|
+
subscription_id = 'subscription_id'
|
1639
|
+
request = CreateSubscriptionItemRequest.new
|
1640
|
+
|
1641
|
+
result = subscriptions.create_subscription_item(subscription_id, request)
|
1642
|
+
|
1643
|
+
```
|
1644
|
+
|
1645
|
+
|
1646
|
+
### <a name="create_discount"></a> create_discount
|
1647
|
+
|
1648
|
+
> Creates a discount
|
1649
|
+
|
1650
|
+
|
1651
|
+
```ruby
|
1652
|
+
def create_discount(subscription_id,
|
1653
|
+
request); end
|
1654
|
+
```
|
1655
|
+
|
1656
|
+
#### Parameters
|
1657
|
+
|
1658
|
+
| Parameter | Tags | Description |
|
1659
|
+
|-----------|------|-------------|
|
1660
|
+
| subscription_id | ``` Required ``` | Subscription id |
|
1661
|
+
| request | ``` Required ``` | Request for creating a discount |
|
1662
|
+
|
1663
|
+
|
1664
|
+
#### Example Usage
|
1665
|
+
|
1666
|
+
```ruby
|
1667
|
+
subscription_id = 'subscription_id'
|
1668
|
+
request = CreateDiscountRequest.new
|
1669
|
+
|
1670
|
+
result = subscriptions.create_discount(subscription_id, request)
|
1671
|
+
|
1672
|
+
```
|
1673
|
+
|
1674
|
+
|
1675
|
+
### <a name="get_subscription"></a> get_subscription
|
1676
|
+
|
1677
|
+
> Gets a subscription
|
1678
|
+
|
1679
|
+
|
1680
|
+
```ruby
|
1681
|
+
def get_subscription(subscription_id); end
|
1682
|
+
```
|
1683
|
+
|
1684
|
+
#### Parameters
|
1685
|
+
|
1686
|
+
| Parameter | Tags | Description |
|
1687
|
+
|-----------|------|-------------|
|
1688
|
+
| subscription_id | ``` Required ``` | Subscription id |
|
1689
|
+
|
1690
|
+
|
1691
|
+
#### Example Usage
|
1692
|
+
|
1693
|
+
```ruby
|
1694
|
+
subscription_id = 'subscription_id'
|
1695
|
+
|
1696
|
+
result = subscriptions.get_subscription(subscription_id)
|
1697
|
+
|
1698
|
+
```
|
1699
|
+
|
1700
|
+
|
1701
|
+
### <a name="update_subscription_payment_method"></a> update_subscription_payment_method
|
1702
|
+
|
1703
|
+
> Updates the payment method from a subscription
|
1704
|
+
|
1705
|
+
|
1706
|
+
```ruby
|
1707
|
+
def update_subscription_payment_method(subscription_id,
|
1708
|
+
request); end
|
1709
|
+
```
|
1710
|
+
|
1711
|
+
#### Parameters
|
1712
|
+
|
1713
|
+
| Parameter | Tags | Description |
|
1714
|
+
|-----------|------|-------------|
|
1715
|
+
| subscription_id | ``` Required ``` | Subscription id |
|
1716
|
+
| request | ``` Required ``` | Request for updating the paymentmethod from a subscription |
|
1717
|
+
|
1718
|
+
|
1719
|
+
#### Example Usage
|
1720
|
+
|
1721
|
+
```ruby
|
1722
|
+
subscription_id = 'subscription_id'
|
1723
|
+
request = UpdateSubscriptionPaymentMethodRequest.new
|
1724
|
+
|
1725
|
+
result = subscriptions.update_subscription_payment_method(subscription_id, request)
|
1726
|
+
|
1727
|
+
```
|
1728
|
+
|
1729
|
+
|
1730
|
+
### <a name="delete_discount"></a> delete_discount
|
1731
|
+
|
1732
|
+
> Deletes a discount
|
1733
|
+
|
1734
|
+
|
1735
|
+
```ruby
|
1736
|
+
def delete_discount(subscription_id,
|
1737
|
+
discount_id); end
|
1738
|
+
```
|
1739
|
+
|
1740
|
+
#### Parameters
|
1741
|
+
|
1742
|
+
| Parameter | Tags | Description |
|
1743
|
+
|-----------|------|-------------|
|
1744
|
+
| subscription_id | ``` Required ``` | Subscription id |
|
1745
|
+
| discount_id | ``` Required ``` | Discount Id |
|
1746
|
+
|
1747
|
+
|
1748
|
+
#### Example Usage
|
1749
|
+
|
1750
|
+
```ruby
|
1751
|
+
subscription_id = 'subscription_id'
|
1752
|
+
discount_id = 'discount_id'
|
1753
|
+
|
1754
|
+
result = subscriptions.delete_discount(subscription_id, discount_id)
|
1755
|
+
|
1756
|
+
```
|
1757
|
+
|
1758
|
+
|
1759
|
+
### <a name="cancel_subscription"></a> cancel_subscription
|
1760
|
+
|
1761
|
+
> Cancels a subscription
|
1762
|
+
|
1763
|
+
|
1764
|
+
```ruby
|
1765
|
+
def cancel_subscription(subscription_id,
|
1766
|
+
request = nil); end
|
1767
|
+
```
|
1768
|
+
|
1769
|
+
#### Parameters
|
1770
|
+
|
1771
|
+
| Parameter | Tags | Description |
|
1772
|
+
|-----------|------|-------------|
|
1773
|
+
| subscription_id | ``` Required ``` | Subscription id |
|
1774
|
+
| request | ``` Optional ``` | Request for cancelling a subscription |
|
1775
|
+
|
1776
|
+
|
1777
|
+
#### Example Usage
|
1778
|
+
|
1779
|
+
```ruby
|
1780
|
+
subscription_id = 'subscription_id'
|
1781
|
+
request = CreateCancelSubscriptionRequest.new
|
1782
|
+
|
1783
|
+
result = subscriptions.cancel_subscription(subscription_id, request)
|
1784
|
+
|
1785
|
+
```
|
1786
|
+
|
1787
|
+
|
1788
|
+
### <a name="delete_subscription_item"></a> delete_subscription_item
|
1789
|
+
|
1790
|
+
> Deletes a subscription item
|
1791
|
+
|
1792
|
+
|
1793
|
+
```ruby
|
1794
|
+
def delete_subscription_item(subscription_id,
|
1795
|
+
subscription_item_id); end
|
1796
|
+
```
|
1797
|
+
|
1798
|
+
#### Parameters
|
1799
|
+
|
1800
|
+
| Parameter | Tags | Description |
|
1801
|
+
|-----------|------|-------------|
|
1802
|
+
| subscription_id | ``` Required ``` | Subscription id |
|
1803
|
+
| subscription_item_id | ``` Required ``` | Subscription item id |
|
1804
|
+
|
1805
|
+
|
1806
|
+
#### Example Usage
|
1807
|
+
|
1808
|
+
```ruby
|
1809
|
+
subscription_id = 'subscription_id'
|
1810
|
+
subscription_item_id = 'subscription_item_id'
|
1811
|
+
|
1812
|
+
result = subscriptions.delete_subscription_item(subscription_id, subscription_item_id)
|
1813
|
+
|
1814
|
+
```
|
1815
|
+
|
1816
|
+
|
1817
|
+
### <a name="delete_usage"></a> delete_usage
|
1818
|
+
|
1819
|
+
> Deletes a usage
|
1820
|
+
|
1821
|
+
|
1822
|
+
```ruby
|
1823
|
+
def delete_usage(subscription_id,
|
1824
|
+
item_id,
|
1825
|
+
usage_id); end
|
1826
|
+
```
|
1827
|
+
|
1828
|
+
#### Parameters
|
1829
|
+
|
1830
|
+
| Parameter | Tags | Description |
|
1831
|
+
|-----------|------|-------------|
|
1832
|
+
| subscription_id | ``` Required ``` | The subscription id |
|
1833
|
+
| item_id | ``` Required ``` | The subscription item id |
|
1834
|
+
| usage_id | ``` Required ``` | The usage id |
|
1835
|
+
|
1836
|
+
|
1837
|
+
#### Example Usage
|
1838
|
+
|
1839
|
+
```ruby
|
1840
|
+
subscription_id = 'subscription_id'
|
1841
|
+
item_id = 'item_id'
|
1842
|
+
usage_id = 'usage_id'
|
1843
|
+
|
1844
|
+
result = subscriptions.delete_usage(subscription_id, item_id, usage_id)
|
1845
|
+
|
1846
|
+
```
|
1847
|
+
|
1848
|
+
|
1849
|
+
### <a name="get_usages"></a> get_usages
|
1850
|
+
|
1851
|
+
> Lists all usages from a subscription item
|
1852
|
+
|
1853
|
+
|
1854
|
+
```ruby
|
1855
|
+
def get_usages(subscription_id,
|
1856
|
+
item_id,
|
1857
|
+
page = nil,
|
1858
|
+
size = nil); end
|
1859
|
+
```
|
1860
|
+
|
1861
|
+
#### Parameters
|
1862
|
+
|
1863
|
+
| Parameter | Tags | Description |
|
1864
|
+
|-----------|------|-------------|
|
1865
|
+
| subscription_id | ``` Required ``` | The subscription id |
|
1866
|
+
| item_id | ``` Required ``` | The subscription item id |
|
1867
|
+
| page | ``` Optional ``` | Page number |
|
1868
|
+
| size | ``` Optional ``` | Page size |
|
1869
|
+
|
1870
|
+
|
1871
|
+
#### Example Usage
|
1872
|
+
|
1873
|
+
```ruby
|
1874
|
+
subscription_id = 'subscription_id'
|
1875
|
+
item_id = 'item_id'
|
1876
|
+
page = 110
|
1877
|
+
size = 110
|
1878
|
+
|
1879
|
+
result = subscriptions.get_usages(subscription_id, item_id, page, size)
|
1880
|
+
|
1881
|
+
```
|
1882
|
+
|
1883
|
+
|
1884
|
+
### <a name="update_subscription_metadata"></a> update_subscription_metadata
|
1885
|
+
|
1886
|
+
> Updates the metadata from a subscription
|
1887
|
+
|
1888
|
+
|
1889
|
+
```ruby
|
1890
|
+
def update_subscription_metadata(subscription_id,
|
1891
|
+
request); end
|
1892
|
+
```
|
1893
|
+
|
1894
|
+
#### Parameters
|
1895
|
+
|
1896
|
+
| Parameter | Tags | Description |
|
1897
|
+
|-----------|------|-------------|
|
1898
|
+
| subscription_id | ``` Required ``` | The subscription id |
|
1899
|
+
| request | ``` Required ``` | Request for updating the subscrption metadata |
|
1900
|
+
|
1901
|
+
|
1902
|
+
#### Example Usage
|
1903
|
+
|
1904
|
+
```ruby
|
1905
|
+
subscription_id = 'subscription_id'
|
1906
|
+
request = UpdateMetadataRequest.new
|
1907
|
+
|
1908
|
+
result = subscriptions.update_subscription_metadata(subscription_id, request)
|
1909
|
+
|
1910
|
+
```
|
1911
|
+
|
1912
|
+
|
1913
|
+
### <a name="get_subscriptions"></a> get_subscriptions
|
1914
|
+
|
1915
|
+
> Gets all subscriptions
|
1916
|
+
|
1917
|
+
|
1918
|
+
```ruby
|
1919
|
+
def get_subscriptions(page = nil,
|
1920
|
+
size = nil,
|
1921
|
+
code = nil,
|
1922
|
+
billing_type = nil,
|
1923
|
+
customer_id = nil,
|
1924
|
+
plan_id = nil,
|
1925
|
+
card_id = nil,
|
1926
|
+
status = nil,
|
1927
|
+
next_billing_since = nil,
|
1928
|
+
next_billing_until = nil,
|
1929
|
+
created_since = nil,
|
1930
|
+
created_until = nil); end
|
1931
|
+
```
|
1932
|
+
|
1933
|
+
#### Parameters
|
1934
|
+
|
1935
|
+
| Parameter | Tags | Description |
|
1936
|
+
|-----------|------|-------------|
|
1937
|
+
| page | ``` Optional ``` | Page number |
|
1938
|
+
| size | ``` Optional ``` | Page size |
|
1939
|
+
| code | ``` Optional ``` | Filter for subscription's code |
|
1940
|
+
| billing_type | ``` Optional ``` | Filter for subscription's billing type |
|
1941
|
+
| customer_id | ``` Optional ``` | Filter for subscription's customer id |
|
1942
|
+
| plan_id | ``` Optional ``` | Filter for subscription's plan id |
|
1943
|
+
| card_id | ``` Optional ``` | Filter for subscription's card id |
|
1944
|
+
| status | ``` Optional ``` | Filter for subscription's status |
|
1945
|
+
| next_billing_since | ``` Optional ``` | Filter for subscription's next billing date start range |
|
1946
|
+
| next_billing_until | ``` Optional ``` | Filter for subscription's next billing date end range |
|
1947
|
+
| created_since | ``` Optional ``` | Filter for subscription's creation date start range |
|
1948
|
+
| created_until | ``` Optional ``` | Filter for subscriptions creation date end range |
|
1949
|
+
|
1950
|
+
|
1951
|
+
#### Example Usage
|
1952
|
+
|
1953
|
+
```ruby
|
1954
|
+
page = 110
|
1955
|
+
size = 110
|
1956
|
+
code = 'code'
|
1957
|
+
billing_type = 'billing_type'
|
1958
|
+
customer_id = 'customer_id'
|
1959
|
+
plan_id = 'plan_id'
|
1960
|
+
card_id = 'card_id'
|
1961
|
+
status = 'status'
|
1962
|
+
next_billing_since = DateTime.now
|
1963
|
+
next_billing_until = DateTime.now
|
1964
|
+
created_since = DateTime.now
|
1965
|
+
created_until = DateTime.now
|
1966
|
+
|
1967
|
+
result = subscriptions.get_subscriptions(page, size, code, billing_type, customer_id, plan_id, card_id, status, next_billing_since, next_billing_until, created_since, created_until)
|
1968
|
+
|
1969
|
+
```
|
1970
|
+
|
1971
|
+
|
1972
|
+
[Back to List of Controllers](#list_of_controllers)
|
1973
|
+
|
1974
|
+
## <a name="orders_controller"></a> OrdersController
|
1975
|
+
|
1976
|
+
### Get singleton instance
|
1977
|
+
|
1978
|
+
The singleton instance of the ``` OrdersController ``` class can be accessed from the API Client.
|
1979
|
+
|
1980
|
+
```ruby
|
1981
|
+
orders = client.orders
|
1982
|
+
```
|
1983
|
+
|
1984
|
+
### <a name="get_order"></a> get_order
|
1985
|
+
|
1986
|
+
> Gets an order
|
1987
|
+
|
1988
|
+
|
1989
|
+
```ruby
|
1990
|
+
def get_order(order_id); end
|
1991
|
+
```
|
1992
|
+
|
1993
|
+
#### Parameters
|
1994
|
+
|
1995
|
+
| Parameter | Tags | Description |
|
1996
|
+
|-----------|------|-------------|
|
1997
|
+
| order_id | ``` Required ``` | Order id |
|
1998
|
+
|
1999
|
+
|
2000
|
+
#### Example Usage
|
2001
|
+
|
2002
|
+
```ruby
|
2003
|
+
order_id = 'order_id'
|
2004
|
+
|
2005
|
+
result = orders.get_order(order_id)
|
2006
|
+
|
2007
|
+
```
|
2008
|
+
|
2009
|
+
|
2010
|
+
### <a name="create_order"></a> create_order
|
2011
|
+
|
2012
|
+
> Creates a new Order
|
2013
|
+
|
2014
|
+
|
2015
|
+
```ruby
|
2016
|
+
def create_order(body); end
|
2017
|
+
```
|
2018
|
+
|
2019
|
+
#### Parameters
|
2020
|
+
|
2021
|
+
| Parameter | Tags | Description |
|
2022
|
+
|-----------|------|-------------|
|
2023
|
+
| body | ``` Required ``` | Request for creating an order |
|
2024
|
+
|
2025
|
+
|
2026
|
+
#### Example Usage
|
2027
|
+
|
2028
|
+
```ruby
|
2029
|
+
body = CreateOrderRequest.new
|
2030
|
+
|
2031
|
+
result = orders.create_order(body)
|
2032
|
+
|
2033
|
+
```
|
2034
|
+
|
2035
|
+
|
2036
|
+
### <a name="update_order_metadata"></a> update_order_metadata
|
2037
|
+
|
2038
|
+
> Updates the metadata from an order
|
2039
|
+
|
2040
|
+
|
2041
|
+
```ruby
|
2042
|
+
def update_order_metadata(order_id,
|
2043
|
+
request); end
|
2044
|
+
```
|
2045
|
+
|
2046
|
+
#### Parameters
|
2047
|
+
|
2048
|
+
| Parameter | Tags | Description |
|
2049
|
+
|-----------|------|-------------|
|
2050
|
+
| order_id | ``` Required ``` | The order id |
|
2051
|
+
| request | ``` Required ``` | Request for updating the order metadata |
|
2052
|
+
|
2053
|
+
|
2054
|
+
#### Example Usage
|
2055
|
+
|
2056
|
+
```ruby
|
2057
|
+
order_id = 'order_id'
|
2058
|
+
request = UpdateMetadataRequest.new
|
2059
|
+
|
2060
|
+
result = orders.update_order_metadata(order_id, request)
|
2061
|
+
|
2062
|
+
```
|
2063
|
+
|
2064
|
+
|
2065
|
+
### <a name="get_orders"></a> get_orders
|
2066
|
+
|
2067
|
+
> Gets all orders
|
2068
|
+
|
2069
|
+
|
2070
|
+
```ruby
|
2071
|
+
def get_orders(page = nil,
|
2072
|
+
size = nil,
|
2073
|
+
code = nil,
|
2074
|
+
status = nil,
|
2075
|
+
created_since = nil,
|
2076
|
+
created_until = nil,
|
2077
|
+
customer_id = nil); end
|
2078
|
+
```
|
2079
|
+
|
2080
|
+
#### Parameters
|
2081
|
+
|
2082
|
+
| Parameter | Tags | Description |
|
2083
|
+
|-----------|------|-------------|
|
2084
|
+
| page | ``` Optional ``` | Page number |
|
2085
|
+
| size | ``` Optional ``` | Page size |
|
2086
|
+
| code | ``` Optional ``` | Filter for order's code |
|
2087
|
+
| status | ``` Optional ``` | Filter for order's status |
|
2088
|
+
| created_since | ``` Optional ``` | Filter for order's creation date start range |
|
2089
|
+
| created_until | ``` Optional ``` | Filter for order's creation date end range |
|
2090
|
+
| customer_id | ``` Optional ``` | Filter for order's customer id |
|
2091
|
+
|
2092
|
+
|
2093
|
+
#### Example Usage
|
2094
|
+
|
2095
|
+
```ruby
|
2096
|
+
page = 110
|
2097
|
+
size = 110
|
2098
|
+
code = 'code'
|
2099
|
+
status = 'status'
|
2100
|
+
created_since = DateTime.now
|
2101
|
+
created_until = DateTime.now
|
2102
|
+
customer_id = 'customer_id'
|
2103
|
+
|
2104
|
+
result = orders.get_orders(page, size, code, status, created_since, created_until, customer_id)
|
2105
|
+
|
2106
|
+
```
|
2107
|
+
|
2108
|
+
|
2109
|
+
[Back to List of Controllers](#list_of_controllers)
|
2110
|
+
|
2111
|
+
## <a name="tokens_controller"></a> TokensController
|
2112
|
+
|
2113
|
+
### Get singleton instance
|
2114
|
+
|
2115
|
+
The singleton instance of the ``` TokensController ``` class can be accessed from the API Client.
|
2116
|
+
|
2117
|
+
```ruby
|
2118
|
+
tokens = client.tokens
|
2119
|
+
```
|
2120
|
+
|
2121
|
+
### <a name="get_token"></a> get_token
|
2122
|
+
|
2123
|
+
> *Tags:* ``` Skips Authentication ```
|
2124
|
+
|
2125
|
+
> Gets a token from its id
|
2126
|
+
|
2127
|
+
|
2128
|
+
```ruby
|
2129
|
+
def get_token(id,
|
2130
|
+
public_key); end
|
2131
|
+
```
|
2132
|
+
|
2133
|
+
#### Parameters
|
2134
|
+
|
2135
|
+
| Parameter | Tags | Description |
|
2136
|
+
|-----------|------|-------------|
|
2137
|
+
| id | ``` Required ``` | Token id |
|
2138
|
+
| public_key | ``` Required ``` | Public key |
|
2139
|
+
|
2140
|
+
|
2141
|
+
#### Example Usage
|
2142
|
+
|
2143
|
+
```ruby
|
2144
|
+
id = 'id'
|
2145
|
+
public_key = 'public_key'
|
2146
|
+
|
2147
|
+
result = tokens.get_token(id, public_key)
|
2148
|
+
|
2149
|
+
```
|
2150
|
+
|
2151
|
+
|
2152
|
+
### <a name="create_token"></a> create_token
|
2153
|
+
|
2154
|
+
> *Tags:* ``` Skips Authentication ```
|
2155
|
+
|
2156
|
+
> TODO: Add a method description
|
2157
|
+
|
2158
|
+
|
2159
|
+
```ruby
|
2160
|
+
def create_token(public_key,
|
2161
|
+
request); end
|
2162
|
+
```
|
2163
|
+
|
2164
|
+
#### Parameters
|
2165
|
+
|
2166
|
+
| Parameter | Tags | Description |
|
2167
|
+
|-----------|------|-------------|
|
2168
|
+
| public_key | ``` Required ``` | Public key |
|
2169
|
+
| request | ``` Required ``` | Request for creating a token |
|
2170
|
+
|
2171
|
+
|
2172
|
+
#### Example Usage
|
2173
|
+
|
2174
|
+
```ruby
|
2175
|
+
public_key = 'public_key'
|
2176
|
+
request = CreateTokenRequest.new
|
2177
|
+
|
2178
|
+
result = tokens.create_token(public_key, request)
|
2179
|
+
|
2180
|
+
```
|
2181
|
+
|
2182
|
+
|
2183
|
+
[Back to List of Controllers](#list_of_controllers)
|
2184
|
+
|
2185
|
+
|
2186
|
+
|