billabear 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +1340 -0
- data/Rakefile +8 -0
- data/billabear.gemspec +38 -0
- data/docs/Address.md +13 -0
- data/docs/BillingAdmin.md +8 -0
- data/docs/CheckoutApi.md +61 -0
- data/docs/CheckoutBody.md +12 -0
- data/docs/CheckoutItems.md +11 -0
- data/docs/CheckoutSubscriptions.md +9 -0
- data/docs/Customer.md +18 -0
- data/docs/CustomersApi.md +904 -0
- data/docs/Error.md +8 -0
- data/docs/Feature.md +10 -0
- data/docs/FrontendToken.md +7 -0
- data/docs/InlineResponse200.md +9 -0
- data/docs/InlineResponse2001.md +9 -0
- data/docs/InlineResponse20010.md +9 -0
- data/docs/InlineResponse20011.md +7 -0
- data/docs/InlineResponse20012.md +8 -0
- data/docs/InlineResponse2002.md +9 -0
- data/docs/InlineResponse2003.md +9 -0
- data/docs/InlineResponse2004.md +9 -0
- data/docs/InlineResponse2005.md +9 -0
- data/docs/InlineResponse2006.md +9 -0
- data/docs/InlineResponse2007.md +9 -0
- data/docs/InlineResponse2007Data.md +14 -0
- data/docs/InlineResponse2007Receipts.md +9 -0
- data/docs/InlineResponse2008.md +9 -0
- data/docs/InlineResponse2009.md +9 -0
- data/docs/InlineResponse201.md +15 -0
- data/docs/InlineResponse201Lines.md +14 -0
- data/docs/InlineResponse400.md +7 -0
- data/docs/Invoice.md +21 -0
- data/docs/InvoiceLines.md +12 -0
- data/docs/InvoicesApi.md +169 -0
- data/docs/IssueRefundPayment.md +9 -0
- data/docs/Limit.md +8 -0
- data/docs/PaymentDetails.md +14 -0
- data/docs/PaymentDetailsApi.md +447 -0
- data/docs/PaymentsApi.md +399 -0
- data/docs/Price.md +14 -0
- data/docs/PricesApi.md +122 -0
- data/docs/Product.md +10 -0
- data/docs/ProductTaxType.md +9 -0
- data/docs/ProductsApi.md +228 -0
- data/docs/ReceiptApi.md +61 -0
- data/docs/Refund.md +16 -0
- data/docs/RefundsApi.md +181 -0
- data/docs/SeatsAddBody.md +7 -0
- data/docs/SeatsRemoveBody.md +7 -0
- data/docs/Subscription.md +18 -0
- data/docs/SubscriptionIdCancelBody.md +10 -0
- data/docs/SubscriptionIdExtendBody.md +7 -0
- data/docs/SubscriptionIdPlanBody.md +9 -0
- data/docs/SubscriptionIdPriceBody.md +8 -0
- data/docs/SubscriptionPlan.md +20 -0
- data/docs/SubscriptionStartBody.md +14 -0
- data/docs/SubscriptionTrialBody.md +10 -0
- data/docs/SubscriptionsApi.md +731 -0
- data/docs/VoucherCode.md +7 -0
- data/git_push.sh +55 -0
- data/lib/swagger_client/api/checkout_api.rb +78 -0
- data/lib/swagger_client/api/customers_api.rb +980 -0
- data/lib/swagger_client/api/invoices_api.rb +188 -0
- data/lib/swagger_client/api/payment_details_api.rb +494 -0
- data/lib/swagger_client/api/payments_api.rb +432 -0
- data/lib/swagger_client/api/prices_api.rb +146 -0
- data/lib/swagger_client/api/products_api.rb +249 -0
- data/lib/swagger_client/api/receipt_api.rb +76 -0
- data/lib/swagger_client/api/refunds_api.rb +200 -0
- data/lib/swagger_client/api/subscriptions_api.rb +812 -0
- data/lib/swagger_client/api_client.rb +388 -0
- data/lib/swagger_client/api_error.rb +57 -0
- data/lib/swagger_client/configuration.rb +205 -0
- data/lib/swagger_client/models/address.rb +265 -0
- data/lib/swagger_client/models/billing_admin.rb +215 -0
- data/lib/swagger_client/models/checkout_body.rb +265 -0
- data/lib/swagger_client/models/checkout_items.rb +242 -0
- data/lib/swagger_client/models/checkout_subscriptions.rb +224 -0
- data/lib/swagger_client/models/customer.rb +370 -0
- data/lib/swagger_client/models/error.rb +225 -0
- data/lib/swagger_client/models/feature.rb +240 -0
- data/lib/swagger_client/models/frontend_token.rb +211 -0
- data/lib/swagger_client/models/inline_response_200.rb +226 -0
- data/lib/swagger_client/models/inline_response_200_1.rb +228 -0
- data/lib/swagger_client/models/inline_response_200_10.rb +226 -0
- data/lib/swagger_client/models/inline_response_200_11.rb +206 -0
- data/lib/swagger_client/models/inline_response_200_12.rb +250 -0
- data/lib/swagger_client/models/inline_response_200_2.rb +226 -0
- data/lib/swagger_client/models/inline_response_200_3.rb +226 -0
- data/lib/swagger_client/models/inline_response_200_4.rb +226 -0
- data/lib/swagger_client/models/inline_response_200_5.rb +226 -0
- data/lib/swagger_client/models/inline_response_200_6.rb +226 -0
- data/lib/swagger_client/models/inline_response_200_7.rb +226 -0
- data/lib/swagger_client/models/inline_response_200_7_data.rb +307 -0
- data/lib/swagger_client/models/inline_response_200_7_receipts.rb +224 -0
- data/lib/swagger_client/models/inline_response_200_8.rb +226 -0
- data/lib/swagger_client/models/inline_response_200_9.rb +226 -0
- data/lib/swagger_client/models/inline_response_201.rb +285 -0
- data/lib/swagger_client/models/inline_response_201_lines.rb +269 -0
- data/lib/swagger_client/models/inline_response_400.rb +213 -0
- data/lib/swagger_client/models/invoice.rb +334 -0
- data/lib/swagger_client/models/invoice_lines.rb +251 -0
- data/lib/swagger_client/models/issue_refund_payment.rb +232 -0
- data/lib/swagger_client/models/limit.rb +215 -0
- data/lib/swagger_client/models/payment_details.rb +271 -0
- data/lib/swagger_client/models/price.rb +325 -0
- data/lib/swagger_client/models/product.rb +240 -0
- data/lib/swagger_client/models/product_tax_type.rb +229 -0
- data/lib/swagger_client/models/refund.rb +324 -0
- data/lib/swagger_client/models/seats_add_body.rb +211 -0
- data/lib/swagger_client/models/seats_remove_body.rb +211 -0
- data/lib/swagger_client/models/subscription.rb +305 -0
- data/lib/swagger_client/models/subscription_id_cancel_body.rb +294 -0
- data/lib/swagger_client/models/subscription_id_extend_body.rb +211 -0
- data/lib/swagger_client/models/subscription_id_plan_body.rb +270 -0
- data/lib/swagger_client/models/subscription_id_price_body.rb +259 -0
- data/lib/swagger_client/models/subscription_plan.rb +330 -0
- data/lib/swagger_client/models/subscription_start_body.rb +314 -0
- data/lib/swagger_client/models/subscription_trial_body.rb +242 -0
- data/lib/swagger_client/models/voucher_code.rb +211 -0
- data/lib/swagger_client/version.rb +14 -0
- data/lib/swagger_client.rb +95 -0
- data/spec/api/checkout_api_spec.rb +46 -0
- data/spec/api/customers_api_spec.rb +241 -0
- data/spec/api/invoices_api_spec.rb +70 -0
- data/spec/api/payment_details_api_spec.rb +134 -0
- data/spec/api/payments_api_spec.rb +124 -0
- data/spec/api/prices_api_spec.rb +61 -0
- data/spec/api/products_api_spec.rb +84 -0
- data/spec/api/receipt_api_spec.rb +46 -0
- data/spec/api/refunds_api_spec.rb +75 -0
- data/spec/api/subscriptions_api_spec.rb +200 -0
- data/spec/api_client_spec.rb +225 -0
- data/spec/base_object_spec.rb +109 -0
- data/spec/configuration_spec.rb +41 -0
- data/spec/models/address_spec.rb +76 -0
- data/spec/models/billing_admin_spec.rb +46 -0
- data/spec/models/checkout_body_spec.rb +70 -0
- data/spec/models/checkout_items_spec.rb +64 -0
- data/spec/models/checkout_subscriptions_spec.rb +52 -0
- data/spec/models/customer_spec.rb +114 -0
- data/spec/models/error_spec.rb +46 -0
- data/spec/models/feature_spec.rb +58 -0
- data/spec/models/frontend_token_spec.rb +40 -0
- data/spec/models/inline_response_200_10_spec.rb +52 -0
- data/spec/models/inline_response_200_11_spec.rb +40 -0
- data/spec/models/inline_response_200_12_spec.rb +50 -0
- data/spec/models/inline_response_200_1_spec.rb +52 -0
- data/spec/models/inline_response_200_2_spec.rb +52 -0
- data/spec/models/inline_response_200_3_spec.rb +52 -0
- data/spec/models/inline_response_200_4_spec.rb +52 -0
- data/spec/models/inline_response_200_5_spec.rb +52 -0
- data/spec/models/inline_response_200_6_spec.rb +52 -0
- data/spec/models/inline_response_200_7_data_spec.rb +86 -0
- data/spec/models/inline_response_200_7_receipts_spec.rb +52 -0
- data/spec/models/inline_response_200_7_spec.rb +52 -0
- data/spec/models/inline_response_200_8_spec.rb +52 -0
- data/spec/models/inline_response_200_9_spec.rb +52 -0
- data/spec/models/inline_response_200_spec.rb +52 -0
- data/spec/models/inline_response_201_lines_spec.rb +82 -0
- data/spec/models/inline_response_201_spec.rb +88 -0
- data/spec/models/inline_response_400_spec.rb +40 -0
- data/spec/models/invoice_lines_spec.rb +70 -0
- data/spec/models/invoice_spec.rb +124 -0
- data/spec/models/issue_refund_payment_spec.rb +52 -0
- data/spec/models/limit_spec.rb +46 -0
- data/spec/models/payment_details_spec.rb +82 -0
- data/spec/models/price_spec.rb +86 -0
- data/spec/models/product_spec.rb +58 -0
- data/spec/models/product_tax_type_spec.rb +52 -0
- data/spec/models/refund_spec.rb +98 -0
- data/spec/models/seats_add_body_spec.rb +40 -0
- data/spec/models/seats_remove_body_spec.rb +40 -0
- data/spec/models/subscription_id_cancel_body_spec.rb +66 -0
- data/spec/models/subscription_id_extend_body_spec.rb +40 -0
- data/spec/models/subscription_id_plan_body_spec.rb +56 -0
- data/spec/models/subscription_id_price_body_spec.rb +50 -0
- data/spec/models/subscription_plan_spec.rb +118 -0
- data/spec/models/subscription_spec.rb +106 -0
- data/spec/models/subscription_start_body_spec.rb +86 -0
- data/spec/models/subscription_trial_body_spec.rb +58 -0
- data/spec/models/voucher_code_spec.rb +40 -0
- data/spec/spec_helper.rb +110 -0
- metadata +349 -0
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#BillaBear
|
|
3
|
+
|
|
4
|
+
#The REST API provided by BillaBear
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 1.0.0
|
|
7
|
+
Contact: support@billabear.com
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 3.0.56
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
module SwaggerClient
|
|
13
|
+
class PaymentsApi
|
|
14
|
+
attr_accessor :api_client
|
|
15
|
+
|
|
16
|
+
def initialize(api_client = ApiClient.default)
|
|
17
|
+
@api_client = api_client
|
|
18
|
+
end
|
|
19
|
+
# Charge Invoice
|
|
20
|
+
# Attempts to charge a card that is on file for the invoice amount
|
|
21
|
+
# @param invoice_id The id of the invoice
|
|
22
|
+
# @param [Hash] opts the optional parameters
|
|
23
|
+
# @return [InlineResponse20012]
|
|
24
|
+
def charge_invoice(invoice_id, opts = {})
|
|
25
|
+
data, _status_code, _headers = charge_invoice_with_http_info(invoice_id, opts)
|
|
26
|
+
data
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Charge Invoice
|
|
30
|
+
# Attempts to charge a card that is on file for the invoice amount
|
|
31
|
+
# @param invoice_id The id of the invoice
|
|
32
|
+
# @param [Hash] opts the optional parameters
|
|
33
|
+
# @return [Array<(InlineResponse20012, Integer, Hash)>] InlineResponse20012 data, response status code and response headers
|
|
34
|
+
def charge_invoice_with_http_info(invoice_id, opts = {})
|
|
35
|
+
if @api_client.config.debugging
|
|
36
|
+
@api_client.config.logger.debug 'Calling API: PaymentsApi.charge_invoice ...'
|
|
37
|
+
end
|
|
38
|
+
# verify the required parameter 'invoice_id' is set
|
|
39
|
+
if @api_client.config.client_side_validation && invoice_id.nil?
|
|
40
|
+
fail ArgumentError, "Missing the required parameter 'invoice_id' when calling PaymentsApi.charge_invoice"
|
|
41
|
+
end
|
|
42
|
+
# resource path
|
|
43
|
+
local_var_path = '/invoice/{invoiceId}/charge'.sub('{' + 'invoiceId' + '}', invoice_id.to_s)
|
|
44
|
+
|
|
45
|
+
# query parameters
|
|
46
|
+
query_params = opts[:query_params] || {}
|
|
47
|
+
|
|
48
|
+
# header parameters
|
|
49
|
+
header_params = opts[:header_params] || {}
|
|
50
|
+
# HTTP header 'Accept' (if needed)
|
|
51
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
52
|
+
|
|
53
|
+
# form parameters
|
|
54
|
+
form_params = opts[:form_params] || {}
|
|
55
|
+
|
|
56
|
+
# http body (model)
|
|
57
|
+
post_body = opts[:body]
|
|
58
|
+
|
|
59
|
+
return_type = opts[:return_type] || 'InlineResponse20012'
|
|
60
|
+
|
|
61
|
+
auth_names = opts[:auth_names] || ['ApiKeyAuth']
|
|
62
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
63
|
+
:header_params => header_params,
|
|
64
|
+
:query_params => query_params,
|
|
65
|
+
:form_params => form_params,
|
|
66
|
+
:body => post_body,
|
|
67
|
+
:auth_names => auth_names,
|
|
68
|
+
:return_type => return_type)
|
|
69
|
+
|
|
70
|
+
if @api_client.config.debugging
|
|
71
|
+
@api_client.config.logger.debug "API called: PaymentsApi#charge_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
72
|
+
end
|
|
73
|
+
return data, status_code, headers
|
|
74
|
+
end
|
|
75
|
+
# Download Invoice
|
|
76
|
+
# Returns the pdf blob for the invoice
|
|
77
|
+
# @param invoice_id The id of the invoice
|
|
78
|
+
# @param [Hash] opts the optional parameters
|
|
79
|
+
# @return [String]
|
|
80
|
+
def download_invoice(invoice_id, opts = {})
|
|
81
|
+
data, _status_code, _headers = download_invoice_with_http_info(invoice_id, opts)
|
|
82
|
+
data
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Download Invoice
|
|
86
|
+
# Returns the pdf blob for the invoice
|
|
87
|
+
# @param invoice_id The id of the invoice
|
|
88
|
+
# @param [Hash] opts the optional parameters
|
|
89
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
|
90
|
+
def download_invoice_with_http_info(invoice_id, opts = {})
|
|
91
|
+
if @api_client.config.debugging
|
|
92
|
+
@api_client.config.logger.debug 'Calling API: PaymentsApi.download_invoice ...'
|
|
93
|
+
end
|
|
94
|
+
# verify the required parameter 'invoice_id' is set
|
|
95
|
+
if @api_client.config.client_side_validation && invoice_id.nil?
|
|
96
|
+
fail ArgumentError, "Missing the required parameter 'invoice_id' when calling PaymentsApi.download_invoice"
|
|
97
|
+
end
|
|
98
|
+
# resource path
|
|
99
|
+
local_var_path = '/invoice/{invoiceId}/download'.sub('{' + 'invoiceId' + '}', invoice_id.to_s)
|
|
100
|
+
|
|
101
|
+
# query parameters
|
|
102
|
+
query_params = opts[:query_params] || {}
|
|
103
|
+
|
|
104
|
+
# header parameters
|
|
105
|
+
header_params = opts[:header_params] || {}
|
|
106
|
+
# HTTP header 'Accept' (if needed)
|
|
107
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/pdf'])
|
|
108
|
+
|
|
109
|
+
# form parameters
|
|
110
|
+
form_params = opts[:form_params] || {}
|
|
111
|
+
|
|
112
|
+
# http body (model)
|
|
113
|
+
post_body = opts[:body]
|
|
114
|
+
|
|
115
|
+
return_type = opts[:return_type] || 'String'
|
|
116
|
+
|
|
117
|
+
auth_names = opts[:auth_names] || ['ApiKeyAuth']
|
|
118
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
119
|
+
:header_params => header_params,
|
|
120
|
+
:query_params => query_params,
|
|
121
|
+
:form_params => form_params,
|
|
122
|
+
:body => post_body,
|
|
123
|
+
:auth_names => auth_names,
|
|
124
|
+
:return_type => return_type)
|
|
125
|
+
|
|
126
|
+
if @api_client.config.debugging
|
|
127
|
+
@api_client.config.logger.debug "API called: PaymentsApi#download_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
128
|
+
end
|
|
129
|
+
return data, status_code, headers
|
|
130
|
+
end
|
|
131
|
+
# Download Receipt
|
|
132
|
+
# Returns the pdf blob for the Receipt
|
|
133
|
+
# @param receipt The id of the receipt
|
|
134
|
+
# @param [Hash] opts the optional parameters
|
|
135
|
+
# @return [String]
|
|
136
|
+
def download_receipt(receipt, opts = {})
|
|
137
|
+
data, _status_code, _headers = download_receipt_with_http_info(receipt, opts)
|
|
138
|
+
data
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Download Receipt
|
|
142
|
+
# Returns the pdf blob for the Receipt
|
|
143
|
+
# @param receipt The id of the receipt
|
|
144
|
+
# @param [Hash] opts the optional parameters
|
|
145
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
|
146
|
+
def download_receipt_with_http_info(receipt, opts = {})
|
|
147
|
+
if @api_client.config.debugging
|
|
148
|
+
@api_client.config.logger.debug 'Calling API: PaymentsApi.download_receipt ...'
|
|
149
|
+
end
|
|
150
|
+
# verify the required parameter 'receipt' is set
|
|
151
|
+
if @api_client.config.client_side_validation && receipt.nil?
|
|
152
|
+
fail ArgumentError, "Missing the required parameter 'receipt' when calling PaymentsApi.download_receipt"
|
|
153
|
+
end
|
|
154
|
+
# resource path
|
|
155
|
+
local_var_path = '/receipt/{receiptId}/download'.sub('{' + 'receipt' + '}', receipt.to_s)
|
|
156
|
+
|
|
157
|
+
# query parameters
|
|
158
|
+
query_params = opts[:query_params] || {}
|
|
159
|
+
|
|
160
|
+
# header parameters
|
|
161
|
+
header_params = opts[:header_params] || {}
|
|
162
|
+
# HTTP header 'Accept' (if needed)
|
|
163
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/pdf'])
|
|
164
|
+
|
|
165
|
+
# form parameters
|
|
166
|
+
form_params = opts[:form_params] || {}
|
|
167
|
+
|
|
168
|
+
# http body (model)
|
|
169
|
+
post_body = opts[:body]
|
|
170
|
+
|
|
171
|
+
return_type = opts[:return_type] || 'String'
|
|
172
|
+
|
|
173
|
+
auth_names = opts[:auth_names] || ['ApiKeyAuth']
|
|
174
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
175
|
+
:header_params => header_params,
|
|
176
|
+
:query_params => query_params,
|
|
177
|
+
:form_params => form_params,
|
|
178
|
+
:body => post_body,
|
|
179
|
+
:auth_names => auth_names,
|
|
180
|
+
:return_type => return_type)
|
|
181
|
+
|
|
182
|
+
if @api_client.config.debugging
|
|
183
|
+
@api_client.config.logger.debug "API called: PaymentsApi#download_receipt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
184
|
+
end
|
|
185
|
+
return data, status_code, headers
|
|
186
|
+
end
|
|
187
|
+
# List Customer Invoices
|
|
188
|
+
# List Customer Invoices
|
|
189
|
+
# @param customer_id The id of the customer to retrieve
|
|
190
|
+
# @param [Hash] opts the optional parameters
|
|
191
|
+
# @return [InlineResponse2004]
|
|
192
|
+
def get_invoices_for_customer(customer_id, opts = {})
|
|
193
|
+
data, _status_code, _headers = get_invoices_for_customer_with_http_info(customer_id, opts)
|
|
194
|
+
data
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# List Customer Invoices
|
|
198
|
+
# List Customer Invoices
|
|
199
|
+
# @param customer_id The id of the customer to retrieve
|
|
200
|
+
# @param [Hash] opts the optional parameters
|
|
201
|
+
# @return [Array<(InlineResponse2004, Integer, Hash)>] InlineResponse2004 data, response status code and response headers
|
|
202
|
+
def get_invoices_for_customer_with_http_info(customer_id, opts = {})
|
|
203
|
+
if @api_client.config.debugging
|
|
204
|
+
@api_client.config.logger.debug 'Calling API: PaymentsApi.get_invoices_for_customer ...'
|
|
205
|
+
end
|
|
206
|
+
# verify the required parameter 'customer_id' is set
|
|
207
|
+
if @api_client.config.client_side_validation && customer_id.nil?
|
|
208
|
+
fail ArgumentError, "Missing the required parameter 'customer_id' when calling PaymentsApi.get_invoices_for_customer"
|
|
209
|
+
end
|
|
210
|
+
# resource path
|
|
211
|
+
local_var_path = '/customer/{customerId}/invoices'.sub('{' + 'customerId' + '}', customer_id.to_s)
|
|
212
|
+
|
|
213
|
+
# query parameters
|
|
214
|
+
query_params = opts[:query_params] || {}
|
|
215
|
+
|
|
216
|
+
# header parameters
|
|
217
|
+
header_params = opts[:header_params] || {}
|
|
218
|
+
# HTTP header 'Accept' (if needed)
|
|
219
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
220
|
+
|
|
221
|
+
# form parameters
|
|
222
|
+
form_params = opts[:form_params] || {}
|
|
223
|
+
|
|
224
|
+
# http body (model)
|
|
225
|
+
post_body = opts[:body]
|
|
226
|
+
|
|
227
|
+
return_type = opts[:return_type] || 'InlineResponse2004'
|
|
228
|
+
|
|
229
|
+
auth_names = opts[:auth_names] || ['ApiKeyAuth']
|
|
230
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
231
|
+
:header_params => header_params,
|
|
232
|
+
:query_params => query_params,
|
|
233
|
+
:form_params => form_params,
|
|
234
|
+
:body => post_body,
|
|
235
|
+
:auth_names => auth_names,
|
|
236
|
+
:return_type => return_type)
|
|
237
|
+
|
|
238
|
+
if @api_client.config.debugging
|
|
239
|
+
@api_client.config.logger.debug "API called: PaymentsApi#get_invoices_for_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
240
|
+
end
|
|
241
|
+
return data, status_code, headers
|
|
242
|
+
end
|
|
243
|
+
# List Customer Payments
|
|
244
|
+
# List Customer Payment
|
|
245
|
+
# @param customer_id The id of the customer to retrieve
|
|
246
|
+
# @param [Hash] opts the optional parameters
|
|
247
|
+
# @option opts [Integer] :limit How many items to return at one time (max 100)
|
|
248
|
+
# @option opts [String] :last_key The key to be used in pagination to say what the last key of the previous page was
|
|
249
|
+
# @option opts [String] :name The name to search for
|
|
250
|
+
# @return [InlineResponse2003]
|
|
251
|
+
def get_payments_for_customer(customer_id, opts = {})
|
|
252
|
+
data, _status_code, _headers = get_payments_for_customer_with_http_info(customer_id, opts)
|
|
253
|
+
data
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# List Customer Payments
|
|
257
|
+
# List Customer Payment
|
|
258
|
+
# @param customer_id The id of the customer to retrieve
|
|
259
|
+
# @param [Hash] opts the optional parameters
|
|
260
|
+
# @option opts [Integer] :limit How many items to return at one time (max 100)
|
|
261
|
+
# @option opts [String] :last_key The key to be used in pagination to say what the last key of the previous page was
|
|
262
|
+
# @option opts [String] :name The name to search for
|
|
263
|
+
# @return [Array<(InlineResponse2003, Integer, Hash)>] InlineResponse2003 data, response status code and response headers
|
|
264
|
+
def get_payments_for_customer_with_http_info(customer_id, opts = {})
|
|
265
|
+
if @api_client.config.debugging
|
|
266
|
+
@api_client.config.logger.debug 'Calling API: PaymentsApi.get_payments_for_customer ...'
|
|
267
|
+
end
|
|
268
|
+
# verify the required parameter 'customer_id' is set
|
|
269
|
+
if @api_client.config.client_side_validation && customer_id.nil?
|
|
270
|
+
fail ArgumentError, "Missing the required parameter 'customer_id' when calling PaymentsApi.get_payments_for_customer"
|
|
271
|
+
end
|
|
272
|
+
# resource path
|
|
273
|
+
local_var_path = '/customer/{customerId}/payment'.sub('{' + 'customerId' + '}', customer_id.to_s)
|
|
274
|
+
|
|
275
|
+
# query parameters
|
|
276
|
+
query_params = opts[:query_params] || {}
|
|
277
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
278
|
+
query_params[:'last_key'] = opts[:'last_key'] if !opts[:'last_key'].nil?
|
|
279
|
+
query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
|
|
280
|
+
|
|
281
|
+
# header parameters
|
|
282
|
+
header_params = opts[:header_params] || {}
|
|
283
|
+
# HTTP header 'Accept' (if needed)
|
|
284
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
285
|
+
|
|
286
|
+
# form parameters
|
|
287
|
+
form_params = opts[:form_params] || {}
|
|
288
|
+
|
|
289
|
+
# http body (model)
|
|
290
|
+
post_body = opts[:body]
|
|
291
|
+
|
|
292
|
+
return_type = opts[:return_type] || 'InlineResponse2003'
|
|
293
|
+
|
|
294
|
+
auth_names = opts[:auth_names] || ['ApiKeyAuth']
|
|
295
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
296
|
+
:header_params => header_params,
|
|
297
|
+
:query_params => query_params,
|
|
298
|
+
:form_params => form_params,
|
|
299
|
+
:body => post_body,
|
|
300
|
+
:auth_names => auth_names,
|
|
301
|
+
:return_type => return_type)
|
|
302
|
+
|
|
303
|
+
if @api_client.config.debugging
|
|
304
|
+
@api_client.config.logger.debug "API called: PaymentsApi#get_payments_for_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
305
|
+
end
|
|
306
|
+
return data, status_code, headers
|
|
307
|
+
end
|
|
308
|
+
# List
|
|
309
|
+
# List all payment
|
|
310
|
+
# @param [Hash] opts the optional parameters
|
|
311
|
+
# @option opts [Integer] :limit How many items to return at one time (max 100)
|
|
312
|
+
# @option opts [String] :last_key The key to be used in pagination to say what the last key of the previous page was
|
|
313
|
+
# @option opts [String] :name The name to search for
|
|
314
|
+
# @return [InlineResponse2007]
|
|
315
|
+
def list_payment(opts = {})
|
|
316
|
+
data, _status_code, _headers = list_payment_with_http_info(opts)
|
|
317
|
+
data
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
# List
|
|
321
|
+
# List all payment
|
|
322
|
+
# @param [Hash] opts the optional parameters
|
|
323
|
+
# @option opts [Integer] :limit How many items to return at one time (max 100)
|
|
324
|
+
# @option opts [String] :last_key The key to be used in pagination to say what the last key of the previous page was
|
|
325
|
+
# @option opts [String] :name The name to search for
|
|
326
|
+
# @return [Array<(InlineResponse2007, Integer, Hash)>] InlineResponse2007 data, response status code and response headers
|
|
327
|
+
def list_payment_with_http_info(opts = {})
|
|
328
|
+
if @api_client.config.debugging
|
|
329
|
+
@api_client.config.logger.debug 'Calling API: PaymentsApi.list_payment ...'
|
|
330
|
+
end
|
|
331
|
+
# resource path
|
|
332
|
+
local_var_path = '/payment'
|
|
333
|
+
|
|
334
|
+
# query parameters
|
|
335
|
+
query_params = opts[:query_params] || {}
|
|
336
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
337
|
+
query_params[:'last_key'] = opts[:'last_key'] if !opts[:'last_key'].nil?
|
|
338
|
+
query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
|
|
339
|
+
|
|
340
|
+
# header parameters
|
|
341
|
+
header_params = opts[:header_params] || {}
|
|
342
|
+
# HTTP header 'Accept' (if needed)
|
|
343
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
344
|
+
|
|
345
|
+
# form parameters
|
|
346
|
+
form_params = opts[:form_params] || {}
|
|
347
|
+
|
|
348
|
+
# http body (model)
|
|
349
|
+
post_body = opts[:body]
|
|
350
|
+
|
|
351
|
+
return_type = opts[:return_type] || 'InlineResponse2007'
|
|
352
|
+
|
|
353
|
+
auth_names = opts[:auth_names] || ['ApiKeyAuth']
|
|
354
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
355
|
+
:header_params => header_params,
|
|
356
|
+
:query_params => query_params,
|
|
357
|
+
:form_params => form_params,
|
|
358
|
+
:body => post_body,
|
|
359
|
+
:auth_names => auth_names,
|
|
360
|
+
:return_type => return_type)
|
|
361
|
+
|
|
362
|
+
if @api_client.config.debugging
|
|
363
|
+
@api_client.config.logger.debug "API called: PaymentsApi#list_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
364
|
+
end
|
|
365
|
+
return data, status_code, headers
|
|
366
|
+
end
|
|
367
|
+
# Refund Payment
|
|
368
|
+
# Issue a refund for payment
|
|
369
|
+
# @param body
|
|
370
|
+
# @param payment_id The id of the payment
|
|
371
|
+
# @param [Hash] opts the optional parameters
|
|
372
|
+
# @return [String]
|
|
373
|
+
def refund_payment(body, payment_id, opts = {})
|
|
374
|
+
data, _status_code, _headers = refund_payment_with_http_info(body, payment_id, opts)
|
|
375
|
+
data
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
# Refund Payment
|
|
379
|
+
# Issue a refund for payment
|
|
380
|
+
# @param body
|
|
381
|
+
# @param payment_id The id of the payment
|
|
382
|
+
# @param [Hash] opts the optional parameters
|
|
383
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
|
384
|
+
def refund_payment_with_http_info(body, payment_id, opts = {})
|
|
385
|
+
if @api_client.config.debugging
|
|
386
|
+
@api_client.config.logger.debug 'Calling API: PaymentsApi.refund_payment ...'
|
|
387
|
+
end
|
|
388
|
+
# verify the required parameter 'body' is set
|
|
389
|
+
if @api_client.config.client_side_validation && body.nil?
|
|
390
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling PaymentsApi.refund_payment"
|
|
391
|
+
end
|
|
392
|
+
# verify the required parameter 'payment_id' is set
|
|
393
|
+
if @api_client.config.client_side_validation && payment_id.nil?
|
|
394
|
+
fail ArgumentError, "Missing the required parameter 'payment_id' when calling PaymentsApi.refund_payment"
|
|
395
|
+
end
|
|
396
|
+
# resource path
|
|
397
|
+
local_var_path = '/payment/{paymentId}/refund'.sub('{' + 'paymentId' + '}', payment_id.to_s)
|
|
398
|
+
|
|
399
|
+
# query parameters
|
|
400
|
+
query_params = opts[:query_params] || {}
|
|
401
|
+
|
|
402
|
+
# header parameters
|
|
403
|
+
header_params = opts[:header_params] || {}
|
|
404
|
+
# HTTP header 'Accept' (if needed)
|
|
405
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
406
|
+
# HTTP header 'Content-Type'
|
|
407
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
408
|
+
|
|
409
|
+
# form parameters
|
|
410
|
+
form_params = opts[:form_params] || {}
|
|
411
|
+
|
|
412
|
+
# http body (model)
|
|
413
|
+
post_body = opts[:body] || @api_client.object_to_http_body(body)
|
|
414
|
+
|
|
415
|
+
return_type = opts[:return_type] || 'String'
|
|
416
|
+
|
|
417
|
+
auth_names = opts[:auth_names] || ['ApiKeyAuth']
|
|
418
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
419
|
+
:header_params => header_params,
|
|
420
|
+
:query_params => query_params,
|
|
421
|
+
:form_params => form_params,
|
|
422
|
+
:body => post_body,
|
|
423
|
+
:auth_names => auth_names,
|
|
424
|
+
:return_type => return_type)
|
|
425
|
+
|
|
426
|
+
if @api_client.config.debugging
|
|
427
|
+
@api_client.config.logger.debug "API called: PaymentsApi#refund_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
428
|
+
end
|
|
429
|
+
return data, status_code, headers
|
|
430
|
+
end
|
|
431
|
+
end
|
|
432
|
+
end
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#BillaBear
|
|
3
|
+
|
|
4
|
+
#The REST API provided by BillaBear
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 1.0.0
|
|
7
|
+
Contact: support@billabear.com
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 3.0.56
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
module SwaggerClient
|
|
13
|
+
class PricesApi
|
|
14
|
+
attr_accessor :api_client
|
|
15
|
+
|
|
16
|
+
def initialize(api_client = ApiClient.default)
|
|
17
|
+
@api_client = api_client
|
|
18
|
+
end
|
|
19
|
+
# Create
|
|
20
|
+
# Create a price
|
|
21
|
+
# @param body
|
|
22
|
+
# @param product_id The id of the product to retrieve
|
|
23
|
+
# @param [Hash] opts the optional parameters
|
|
24
|
+
# @return [String]
|
|
25
|
+
def create_price(body, product_id, opts = {})
|
|
26
|
+
data, _status_code, _headers = create_price_with_http_info(body, product_id, opts)
|
|
27
|
+
data
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Create
|
|
31
|
+
# Create a price
|
|
32
|
+
# @param body
|
|
33
|
+
# @param product_id The id of the product to retrieve
|
|
34
|
+
# @param [Hash] opts the optional parameters
|
|
35
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
|
36
|
+
def create_price_with_http_info(body, product_id, opts = {})
|
|
37
|
+
if @api_client.config.debugging
|
|
38
|
+
@api_client.config.logger.debug 'Calling API: PricesApi.create_price ...'
|
|
39
|
+
end
|
|
40
|
+
# verify the required parameter 'body' is set
|
|
41
|
+
if @api_client.config.client_side_validation && body.nil?
|
|
42
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling PricesApi.create_price"
|
|
43
|
+
end
|
|
44
|
+
# verify the required parameter 'product_id' is set
|
|
45
|
+
if @api_client.config.client_side_validation && product_id.nil?
|
|
46
|
+
fail ArgumentError, "Missing the required parameter 'product_id' when calling PricesApi.create_price"
|
|
47
|
+
end
|
|
48
|
+
# resource path
|
|
49
|
+
local_var_path = '/product/{productId}/price'.sub('{' + 'productId' + '}', product_id.to_s)
|
|
50
|
+
|
|
51
|
+
# query parameters
|
|
52
|
+
query_params = opts[:query_params] || {}
|
|
53
|
+
|
|
54
|
+
# header parameters
|
|
55
|
+
header_params = opts[:header_params] || {}
|
|
56
|
+
# HTTP header 'Accept' (if needed)
|
|
57
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
58
|
+
# HTTP header 'Content-Type'
|
|
59
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = opts[:form_params] || {}
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = opts[:body] || @api_client.object_to_http_body(body)
|
|
66
|
+
|
|
67
|
+
return_type = opts[:return_type] || 'String'
|
|
68
|
+
|
|
69
|
+
auth_names = opts[:auth_names] || ['ApiKeyAuth']
|
|
70
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
71
|
+
:header_params => header_params,
|
|
72
|
+
:query_params => query_params,
|
|
73
|
+
:form_params => form_params,
|
|
74
|
+
:body => post_body,
|
|
75
|
+
:auth_names => auth_names,
|
|
76
|
+
:return_type => return_type)
|
|
77
|
+
|
|
78
|
+
if @api_client.config.debugging
|
|
79
|
+
@api_client.config.logger.debug "API called: PricesApi#create_price\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
80
|
+
end
|
|
81
|
+
return data, status_code, headers
|
|
82
|
+
end
|
|
83
|
+
# List
|
|
84
|
+
# List all prices
|
|
85
|
+
# @param product_id The id of the product to retrieve
|
|
86
|
+
# @param [Hash] opts the optional parameters
|
|
87
|
+
# @option opts [Integer] :limit How many items to return at one time (max 100)
|
|
88
|
+
# @option opts [String] :last_key The key to be used in pagination to say what the last key of the previous page was
|
|
89
|
+
# @return [InlineResponse2009]
|
|
90
|
+
def list_price(product_id, opts = {})
|
|
91
|
+
data, _status_code, _headers = list_price_with_http_info(product_id, opts)
|
|
92
|
+
data
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# List
|
|
96
|
+
# List all prices
|
|
97
|
+
# @param product_id The id of the product to retrieve
|
|
98
|
+
# @param [Hash] opts the optional parameters
|
|
99
|
+
# @option opts [Integer] :limit How many items to return at one time (max 100)
|
|
100
|
+
# @option opts [String] :last_key The key to be used in pagination to say what the last key of the previous page was
|
|
101
|
+
# @return [Array<(InlineResponse2009, Integer, Hash)>] InlineResponse2009 data, response status code and response headers
|
|
102
|
+
def list_price_with_http_info(product_id, opts = {})
|
|
103
|
+
if @api_client.config.debugging
|
|
104
|
+
@api_client.config.logger.debug 'Calling API: PricesApi.list_price ...'
|
|
105
|
+
end
|
|
106
|
+
# verify the required parameter 'product_id' is set
|
|
107
|
+
if @api_client.config.client_side_validation && product_id.nil?
|
|
108
|
+
fail ArgumentError, "Missing the required parameter 'product_id' when calling PricesApi.list_price"
|
|
109
|
+
end
|
|
110
|
+
# resource path
|
|
111
|
+
local_var_path = '/product/{productId}/price'.sub('{' + 'productId' + '}', product_id.to_s)
|
|
112
|
+
|
|
113
|
+
# query parameters
|
|
114
|
+
query_params = opts[:query_params] || {}
|
|
115
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
116
|
+
query_params[:'last_key'] = opts[:'last_key'] if !opts[:'last_key'].nil?
|
|
117
|
+
|
|
118
|
+
# header parameters
|
|
119
|
+
header_params = opts[:header_params] || {}
|
|
120
|
+
# HTTP header 'Accept' (if needed)
|
|
121
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
122
|
+
|
|
123
|
+
# form parameters
|
|
124
|
+
form_params = opts[:form_params] || {}
|
|
125
|
+
|
|
126
|
+
# http body (model)
|
|
127
|
+
post_body = opts[:body]
|
|
128
|
+
|
|
129
|
+
return_type = opts[:return_type] || 'InlineResponse2009'
|
|
130
|
+
|
|
131
|
+
auth_names = opts[:auth_names] || ['ApiKeyAuth']
|
|
132
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
133
|
+
:header_params => header_params,
|
|
134
|
+
:query_params => query_params,
|
|
135
|
+
:form_params => form_params,
|
|
136
|
+
:body => post_body,
|
|
137
|
+
:auth_names => auth_names,
|
|
138
|
+
:return_type => return_type)
|
|
139
|
+
|
|
140
|
+
if @api_client.config.debugging
|
|
141
|
+
@api_client.config.logger.debug "API called: PricesApi#list_price\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
142
|
+
end
|
|
143
|
+
return data, status_code, headers
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
end
|