square_connect 2.0.2.69 → 2.1.0.beta
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 +4 -4
- data/README.md +133 -21
- data/docs/ChargeRequest.md +1 -1
- data/docs/CheckoutApi.md +8 -6
- data/docs/CustomersApi.md +389 -0
- data/docs/Device.md +11 -0
- data/docs/LocationsApi.md +55 -0
- data/docs/TransactionsApi.md +417 -0
- data/docs/V1AdjustInventoryRequest.md +12 -0
- data/docs/V1BankAccount.md +17 -0
- data/docs/V1CashDrawerEvent.md +15 -0
- data/docs/V1CashDrawerShift.md +28 -0
- data/docs/V1Category.md +11 -0
- data/docs/V1CreateRefundRequest.md +14 -0
- data/docs/V1Discount.md +16 -0
- data/docs/V1Employee.md +21 -0
- data/docs/V1EmployeeRole.md +15 -0
- data/docs/V1EmployeesApi.md +915 -0
- data/docs/V1Fee.md +18 -0
- data/docs/V1InventoryEntry.md +11 -0
- data/docs/V1Item.md +23 -0
- data/docs/V1ItemImage.md +11 -0
- data/docs/V1ItemsApi.md +2297 -0
- data/docs/V1LocationApi.md +102 -0
- data/docs/V1LocationsApi.md +102 -0
- data/docs/V1Merchant.md +26 -0
- data/docs/V1MerchantLocationDetails.md +12 -0
- data/docs/V1ModifierList.md +13 -0
- data/docs/V1ModifierOption.md +15 -0
- data/docs/V1Money.md +13 -0
- data/docs/V1Order.md +34 -0
- data/docs/V1OrderHistoryEntry.md +11 -0
- data/docs/V1Page.md +13 -0
- data/docs/V1PageCell.md +15 -0
- data/docs/V1Payment.md +33 -0
- data/docs/V1PaymentDiscount.md +12 -0
- data/docs/V1PaymentItemDetail.md +13 -0
- data/docs/V1PaymentItemization.md +23 -0
- data/docs/V1PaymentModifier.md +12 -0
- data/docs/V1PaymentTax.md +15 -0
- data/docs/V1PhoneNumber.md +13 -0
- data/docs/V1Refund.md +16 -0
- data/docs/V1Settlement.md +15 -0
- data/docs/V1SettlementEntry.md +13 -0
- data/docs/V1Tender.md +22 -0
- data/docs/V1Timecard.md +20 -0
- data/docs/V1TimecardEvent.md +14 -0
- data/docs/V1TransactionsApi.md +650 -0
- data/docs/V1UpdateModifierListRequest.md +11 -0
- data/docs/V1UpdateOrderRequest.md +14 -0
- data/docs/V1Variation.md +20 -0
- data/lib/.DS_Store +0 -0
- data/lib/square_connect.rb +46 -5
- data/lib/square_connect/.DS_Store +0 -0
- data/lib/square_connect/api/checkout_api.rb +4 -9
- data/lib/square_connect/api/{customer_api.rb → customers_api.rb} +150 -61
- data/lib/square_connect/api/{location_api.rb → locations_api.rb} +7 -12
- data/lib/square_connect/api/{transaction_api.rb → transactions_api.rb} +169 -65
- data/lib/square_connect/api/v1_employees_api.rb +974 -0
- data/lib/square_connect/api/v1_items_api.rb +2365 -0
- data/lib/square_connect/api/v1_locations_api.rb +118 -0
- data/lib/square_connect/api/v1_transactions_api.rb +707 -0
- data/lib/square_connect/api_client.rb +1 -1
- data/lib/square_connect/models/charge_request.rb +1 -1
- data/lib/square_connect/models/device.rb +196 -0
- data/lib/square_connect/models/v1_adjust_inventory_request.rb +206 -0
- data/lib/square_connect/models/v1_bank_account.rb +289 -0
- data/lib/square_connect/models/v1_cash_drawer_event.rb +269 -0
- data/lib/square_connect/models/v1_cash_drawer_shift.rb +403 -0
- data/lib/square_connect/models/v1_category.rb +196 -0
- data/lib/square_connect/models/v1_create_refund_request.rb +274 -0
- data/lib/square_connect/models/v1_discount.rb +291 -0
- data/lib/square_connect/models/v1_employee.rb +323 -0
- data/lib/square_connect/models/v1_employee_role.rb +269 -0
- data/lib/square_connect/models/v1_fee.rb +335 -0
- data/lib/square_connect/models/v1_inventory_entry.rb +196 -0
- data/lib/square_connect/models/v1_item.rb +379 -0
- data/lib/square_connect/models/v1_item_image.rb +196 -0
- data/lib/square_connect/models/v1_merchant.rb +372 -0
- data/lib/square_connect/models/v1_merchant_location_details.rb +186 -0
- data/lib/square_connect/models/v1_modifier_list.rb +251 -0
- data/lib/square_connect/models/v1_modifier_option.rb +236 -0
- data/lib/square_connect/models/v1_money.rb +229 -0
- data/lib/square_connect/models/v1_order.rb +463 -0
- data/lib/square_connect/models/v1_order_history_entry.rb +229 -0
- data/lib/square_connect/models/v1_page.rb +218 -0
- data/lib/square_connect/models/v1_page_cell.rb +261 -0
- data/lib/square_connect/models/v1_payment.rb +423 -0
- data/lib/square_connect/models/v1_payment_discount.rb +206 -0
- data/lib/square_connect/models/v1_payment_item_detail.rb +216 -0
- data/lib/square_connect/models/v1_payment_itemization.rb +355 -0
- data/lib/square_connect/models/v1_payment_modifier.rb +206 -0
- data/lib/square_connect/models/v1_payment_tax.rb +271 -0
- data/lib/square_connect/models/v1_phone_number.rb +206 -0
- data/lib/square_connect/models/v1_refund.rb +279 -0
- data/lib/square_connect/models/v1_settlement.rb +271 -0
- data/lib/square_connect/models/v1_settlement_entry.rb +249 -0
- data/lib/square_connect/models/v1_tender.rb +363 -0
- data/lib/square_connect/models/v1_timecard.rb +271 -0
- data/lib/square_connect/models/v1_timecard_event.rb +259 -0
- data/lib/square_connect/models/v1_update_modifier_list_request.rb +229 -0
- data/lib/square_connect/models/v1_update_order_request.rb +264 -0
- data/lib/square_connect/models/v1_variation.rb +331 -0
- data/lib/square_connect/version.rb +1 -1
- data/spec/.DS_Store +0 -0
- data/spec/api/checkout_api_spec.rb +4 -12
- data/spec/api/{customer_api_spec.rb → customers_api_spec.rb} +39 -41
- data/spec/api/{location_api_spec.rb → locations_api_spec.rb} +9 -15
- data/spec/api/{transaction_api_spec.rb → transactions_api_spec.rb} +43 -41
- data/spec/api/v1_employees_api_spec.rb +250 -0
- data/spec/api/v1_items_api_spec.rb +568 -0
- data/spec/api/v1_locations_api_spec.rb +54 -0
- data/spec/api/v1_transactions_api_spec.rb +186 -0
- data/spec/models/address_spec.rb +22 -81
- data/spec/models/capture_transaction_request_spec.rb +3 -6
- data/spec/models/capture_transaction_response_spec.rb +4 -11
- data/spec/models/card_brand_spec.rb +3 -6
- data/spec/models/card_spec.rb +14 -41
- data/spec/models/charge_request_spec.rb +14 -61
- data/spec/models/charge_response_spec.rb +5 -16
- data/spec/models/checkout_spec.rb +12 -51
- data/spec/models/country_spec.rb +3 -6
- data/spec/models/create_checkout_request_spec.rb +10 -41
- data/spec/models/create_checkout_response_spec.rb +5 -16
- data/spec/models/create_customer_card_request_spec.rb +6 -21
- data/spec/models/create_customer_card_response_spec.rb +5 -16
- data/spec/models/create_customer_request_spec.rb +12 -51
- data/spec/models/create_customer_response_spec.rb +5 -16
- data/spec/models/create_order_request_line_item_spec.rb +6 -21
- data/spec/models/create_order_request_order_spec.rb +5 -16
- data/spec/models/create_order_request_spec.rb +5 -16
- data/spec/models/create_refund_request_spec.rb +7 -26
- data/spec/models/create_refund_response_spec.rb +5 -16
- data/spec/models/currency_spec.rb +3 -6
- data/spec/models/customer_group_info_spec.rb +5 -16
- data/spec/models/customer_preferences_spec.rb +4 -11
- data/spec/models/customer_spec.rb +18 -81
- data/spec/models/delete_customer_card_request_spec.rb +3 -6
- data/spec/models/delete_customer_card_response_spec.rb +4 -11
- data/spec/models/delete_customer_request_spec.rb +3 -6
- data/spec/models/delete_customer_response_spec.rb +4 -11
- data/spec/models/device_spec.rb +45 -0
- data/spec/models/error_category_spec.rb +3 -6
- data/spec/models/error_code_spec.rb +3 -6
- data/spec/models/error_spec.rb +15 -26
- data/spec/models/list_customers_request_spec.rb +4 -11
- data/spec/models/list_customers_response_spec.rb +6 -21
- data/spec/models/list_locations_request_spec.rb +3 -6
- data/spec/models/list_locations_response_spec.rb +5 -16
- data/spec/models/list_refunds_request_spec.rb +11 -26
- data/spec/models/list_refunds_response_spec.rb +6 -21
- data/spec/models/list_transactions_request_spec.rb +11 -26
- data/spec/models/list_transactions_response_spec.rb +6 -21
- data/spec/models/location_capability_spec.rb +3 -6
- data/spec/models/location_spec.rb +12 -31
- data/spec/models/money_spec.rb +9 -16
- data/spec/models/order_line_item_spec.rb +8 -31
- data/spec/models/order_spec.rb +8 -31
- data/spec/models/refund_spec.rb +16 -51
- data/spec/models/refund_status_spec.rb +3 -6
- data/spec/models/retrieve_customer_request_spec.rb +3 -6
- data/spec/models/retrieve_customer_response_spec.rb +5 -16
- data/spec/models/retrieve_transaction_request_spec.rb +3 -6
- data/spec/models/retrieve_transaction_response_spec.rb +5 -16
- data/spec/models/sort_order_spec.rb +3 -6
- data/spec/models/tender_card_details_entry_method_spec.rb +3 -6
- data/spec/models/tender_card_details_spec.rb +14 -21
- data/spec/models/tender_card_details_status_spec.rb +3 -6
- data/spec/models/tender_cash_details_spec.rb +5 -16
- data/spec/models/tender_spec.rb +18 -61
- data/spec/models/tender_type_spec.rb +3 -6
- data/spec/models/transaction_product_spec.rb +3 -6
- data/spec/models/transaction_spec.rb +17 -56
- data/spec/models/update_customer_request_spec.rb +12 -51
- data/spec/models/update_customer_response_spec.rb +5 -16
- data/spec/models/v1_adjust_inventory_request_spec.rb +51 -0
- data/spec/models/v1_bank_account_spec.rb +85 -0
- data/spec/models/v1_cash_drawer_event_spec.rb +73 -0
- data/spec/models/v1_cash_drawer_shift_spec.rb +151 -0
- data/spec/models/v1_category_spec.rb +45 -0
- data/spec/models/v1_create_refund_request_spec.rb +67 -0
- data/spec/models/v1_discount_spec.rb +83 -0
- data/spec/models/v1_employee_role_spec.rb +73 -0
- data/spec/models/v1_employee_spec.rb +97 -0
- data/spec/models/v1_fee_spec.rb +103 -0
- data/spec/models/v1_inventory_entry_spec.rb +45 -0
- data/spec/models/v1_item_image_spec.rb +45 -0
- data/spec/models/v1_item_spec.rb +129 -0
- data/spec/models/v1_merchant_location_details_spec.rb +39 -0
- data/spec/models/v1_merchant_spec.rb +131 -0
- data/spec/models/v1_modifier_list_spec.rb +61 -0
- data/spec/models/v1_modifier_option_spec.rb +69 -0
- data/spec/models/v1_money_spec.rb +49 -0
- data/spec/models/v1_order_history_entry_spec.rb +49 -0
- data/spec/models/v1_order_spec.rb +187 -0
- data/spec/models/v1_page_cell_spec.rb +77 -0
- data/spec/models/v1_page_spec.rb +57 -0
- data/spec/models/v1_payment_discount_spec.rb +51 -0
- data/spec/models/v1_payment_item_detail_spec.rb +57 -0
- data/spec/models/v1_payment_itemization_spec.rb +121 -0
- data/spec/models/v1_payment_modifier_spec.rb +51 -0
- data/spec/models/v1_payment_spec.rb +177 -0
- data/spec/models/v1_payment_tax_spec.rb +73 -0
- data/spec/models/v1_phone_number_spec.rb +45 -0
- data/spec/models/v1_refund_spec.rb +79 -0
- data/spec/models/v1_settlement_entry_spec.rb +61 -0
- data/spec/models/v1_settlement_spec.rb +73 -0
- data/spec/models/v1_tender_spec.rb +123 -0
- data/spec/models/v1_timecard_event_spec.rb +67 -0
- data/spec/models/v1_timecard_spec.rb +87 -0
- data/spec/models/v1_update_modifier_list_request_spec.rb +49 -0
- data/spec/models/v1_update_order_request_spec.rb +67 -0
- data/spec/models/v1_variation_spec.rb +107 -0
- data/spec/models/void_transaction_request_spec.rb +3 -6
- data/spec/models/void_transaction_response_spec.rb +4 -11
- data/spec/spec_helper.rb +10 -0
- data/square_connect-2.0.2.gem +0 -0
- data/square_connect-2.1.0.gem +0 -0
- data/square_connect-2.1.0beta.gem +0 -0
- data/square_connect.gemspec +1 -1
- data/travis-ci/accounts.enc +0 -0
- metadata +197 -26
- data/docs/CustomerApi.md +0 -267
- data/docs/CustomerCardApi.md +0 -116
- data/docs/LocationApi.md +0 -56
- data/docs/RefundApi.md +0 -126
- data/docs/TransactionApi.md +0 -285
- data/lib/square_connect/api/customer_card_api.rb +0 -144
- data/lib/square_connect/api/refund_api.rb +0 -159
- data/spec/api/customer_card_api_spec.rb +0 -71
- data/spec/api/refund_api_spec.rb +0 -75
data/docs/TransactionApi.md
DELETED
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
# SquareConnect::TransactionApi
|
|
2
|
-
|
|
3
|
-
All URIs are relative to *https://connect.squareup.com*
|
|
4
|
-
|
|
5
|
-
Method | HTTP request | Description
|
|
6
|
-
------------- | ------------- | -------------
|
|
7
|
-
[**capture_transaction**](TransactionApi.md#capture_transaction) | **POST** /v2/locations/{location_id}/transactions/{transaction_id}/capture | CaptureTransaction
|
|
8
|
-
[**charge**](TransactionApi.md#charge) | **POST** /v2/locations/{location_id}/transactions | Charge
|
|
9
|
-
[**list_transactions**](TransactionApi.md#list_transactions) | **GET** /v2/locations/{location_id}/transactions | ListTransactions
|
|
10
|
-
[**retrieve_transaction**](TransactionApi.md#retrieve_transaction) | **GET** /v2/locations/{location_id}/transactions/{transaction_id} | RetrieveTransaction
|
|
11
|
-
[**void_transaction**](TransactionApi.md#void_transaction) | **POST** /v2/locations/{location_id}/transactions/{transaction_id}/void | VoidTransaction
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
# **capture_transaction**
|
|
15
|
-
> CaptureTransactionResponse capture_transaction(authorization, location_id, transaction_id)
|
|
16
|
-
|
|
17
|
-
CaptureTransaction
|
|
18
|
-
|
|
19
|
-
Captures a transaction that was created with the [Charge](#endpoint-charge) endpoint with a `delay_capture` value of `true`. See [Delayed capture transactions](/articles/delayed-capture-transactions/) for more information.
|
|
20
|
-
|
|
21
|
-
### Example
|
|
22
|
-
```ruby
|
|
23
|
-
# load the gem
|
|
24
|
-
require 'square_connect'
|
|
25
|
-
|
|
26
|
-
api_instance = SquareConnect::TransactionApi.new
|
|
27
|
-
|
|
28
|
-
authorization = "authorization_example" # String | The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
29
|
-
|
|
30
|
-
location_id = "location_id_example" # String |
|
|
31
|
-
|
|
32
|
-
transaction_id = "transaction_id_example" # String |
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
begin
|
|
36
|
-
#CaptureTransaction
|
|
37
|
-
result = api_instance.capture_transaction(authorization, location_id, transaction_id)
|
|
38
|
-
p result
|
|
39
|
-
rescue SquareConnect::ApiError => e
|
|
40
|
-
puts "Exception when calling TransactionApi->capture_transaction: #{e}"
|
|
41
|
-
end
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Parameters
|
|
45
|
-
|
|
46
|
-
Name | Type | Description | Notes
|
|
47
|
-
------------- | ------------- | ------------- | -------------
|
|
48
|
-
**authorization** | **String**| The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`. |
|
|
49
|
-
**location_id** | **String**| |
|
|
50
|
-
**transaction_id** | **String**| |
|
|
51
|
-
|
|
52
|
-
### Return type
|
|
53
|
-
|
|
54
|
-
[**CaptureTransactionResponse**](CaptureTransactionResponse.md)
|
|
55
|
-
|
|
56
|
-
### Authorization
|
|
57
|
-
|
|
58
|
-
No authorization required
|
|
59
|
-
|
|
60
|
-
### HTTP request headers
|
|
61
|
-
|
|
62
|
-
- **Content-Type**: application/json
|
|
63
|
-
- **Accept**: application/json
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
# **charge**
|
|
68
|
-
> ChargeResponse charge(authorization, location_id, body)
|
|
69
|
-
|
|
70
|
-
Charge
|
|
71
|
-
|
|
72
|
-
Charges a card represented by a card nonce or a customer's card on file. Your request to this endpoint must include _either_: - A value for the `card_nonce` parameter (to charge a card nonce generated with the `SqPaymentForm`) - Values for the `customer_card_id` and `customer_id` parameters (to charge a customer's card on file) In order for an e-commerce payment to potentially qualify for [Square chargeback protection](https://squareup.com/help/article/5394), you _must_ provide values for the following parameters in your request: - `buyer_email_address` - At least one of `billing_address` or `shipping_address` When this response is returned, the amount of Square's processing fee might not yet be calculated. To obtain the processing fee, wait about ten seconds and call [RetrieveTransaction](#endpoint-retrievetransaction). See the `processing_fee_money` field of each [Tender included](#type-tender) in the transaction.
|
|
73
|
-
|
|
74
|
-
### Example
|
|
75
|
-
```ruby
|
|
76
|
-
# load the gem
|
|
77
|
-
require 'square_connect'
|
|
78
|
-
|
|
79
|
-
api_instance = SquareConnect::TransactionApi.new
|
|
80
|
-
|
|
81
|
-
authorization = "authorization_example" # String | The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
82
|
-
|
|
83
|
-
location_id = "location_id_example" # String | The ID of the location to associate the created transaction with.
|
|
84
|
-
|
|
85
|
-
body = SquareConnect::ChargeRequest.new # ChargeRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
begin
|
|
89
|
-
#Charge
|
|
90
|
-
result = api_instance.charge(authorization, location_id, body)
|
|
91
|
-
p result
|
|
92
|
-
rescue SquareConnect::ApiError => e
|
|
93
|
-
puts "Exception when calling TransactionApi->charge: #{e}"
|
|
94
|
-
end
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### Parameters
|
|
98
|
-
|
|
99
|
-
Name | Type | Description | Notes
|
|
100
|
-
------------- | ------------- | ------------- | -------------
|
|
101
|
-
**authorization** | **String**| The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`. |
|
|
102
|
-
**location_id** | **String**| The ID of the location to associate the created transaction with. |
|
|
103
|
-
**body** | [**ChargeRequest**](ChargeRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. |
|
|
104
|
-
|
|
105
|
-
### Return type
|
|
106
|
-
|
|
107
|
-
[**ChargeResponse**](ChargeResponse.md)
|
|
108
|
-
|
|
109
|
-
### Authorization
|
|
110
|
-
|
|
111
|
-
No authorization required
|
|
112
|
-
|
|
113
|
-
### HTTP request headers
|
|
114
|
-
|
|
115
|
-
- **Content-Type**: application/json
|
|
116
|
-
- **Accept**: application/json
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
# **list_transactions**
|
|
121
|
-
> ListTransactionsResponse list_transactions(authorization, location_id, opts)
|
|
122
|
-
|
|
123
|
-
ListTransactions
|
|
124
|
-
|
|
125
|
-
Lists transactions for a particular location. Max results per [page](#paginatingresults): 50
|
|
126
|
-
|
|
127
|
-
### Example
|
|
128
|
-
```ruby
|
|
129
|
-
# load the gem
|
|
130
|
-
require 'square_connect'
|
|
131
|
-
|
|
132
|
-
api_instance = SquareConnect::TransactionApi.new
|
|
133
|
-
|
|
134
|
-
authorization = "authorization_example" # String | The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
135
|
-
|
|
136
|
-
location_id = "location_id_example" # String | The ID of the location to list transactions for.
|
|
137
|
-
|
|
138
|
-
opts = {
|
|
139
|
-
begin_time: "begin_time_example", # String | The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year.
|
|
140
|
-
end_time: "end_time_example", # String | The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time.
|
|
141
|
-
sort_order: "sort_order_example", # String | The order in which results are listed in the response (`ASC` for oldest first, `DESC` for newest first). Default value: `DESC`
|
|
142
|
-
cursor: "cursor_example" # String | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information.
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
begin
|
|
146
|
-
#ListTransactions
|
|
147
|
-
result = api_instance.list_transactions(authorization, location_id, opts)
|
|
148
|
-
p result
|
|
149
|
-
rescue SquareConnect::ApiError => e
|
|
150
|
-
puts "Exception when calling TransactionApi->list_transactions: #{e}"
|
|
151
|
-
end
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
### Parameters
|
|
155
|
-
|
|
156
|
-
Name | Type | Description | Notes
|
|
157
|
-
------------- | ------------- | ------------- | -------------
|
|
158
|
-
**authorization** | **String**| The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`. |
|
|
159
|
-
**location_id** | **String**| The ID of the location to list transactions for. |
|
|
160
|
-
**begin_time** | **String**| The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year. | [optional]
|
|
161
|
-
**end_time** | **String**| The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time. | [optional]
|
|
162
|
-
**sort_order** | **String**| The order in which results are listed in the response (`ASC` for oldest first, `DESC` for newest first). Default value: `DESC` | [optional]
|
|
163
|
-
**cursor** | **String**| A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information. | [optional]
|
|
164
|
-
|
|
165
|
-
### Return type
|
|
166
|
-
|
|
167
|
-
[**ListTransactionsResponse**](ListTransactionsResponse.md)
|
|
168
|
-
|
|
169
|
-
### Authorization
|
|
170
|
-
|
|
171
|
-
No authorization required
|
|
172
|
-
|
|
173
|
-
### HTTP request headers
|
|
174
|
-
|
|
175
|
-
- **Content-Type**: application/json
|
|
176
|
-
- **Accept**: application/json
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
# **retrieve_transaction**
|
|
181
|
-
> RetrieveTransactionResponse retrieve_transaction(authorization, location_id, transaction_id)
|
|
182
|
-
|
|
183
|
-
RetrieveTransaction
|
|
184
|
-
|
|
185
|
-
Retrieves details for a single transaction.
|
|
186
|
-
|
|
187
|
-
### Example
|
|
188
|
-
```ruby
|
|
189
|
-
# load the gem
|
|
190
|
-
require 'square_connect'
|
|
191
|
-
|
|
192
|
-
api_instance = SquareConnect::TransactionApi.new
|
|
193
|
-
|
|
194
|
-
authorization = "authorization_example" # String | The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
195
|
-
|
|
196
|
-
location_id = "location_id_example" # String | The ID of the transaction's associated location.
|
|
197
|
-
|
|
198
|
-
transaction_id = "transaction_id_example" # String | The ID of the transaction to retrieve.
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
begin
|
|
202
|
-
#RetrieveTransaction
|
|
203
|
-
result = api_instance.retrieve_transaction(authorization, location_id, transaction_id)
|
|
204
|
-
p result
|
|
205
|
-
rescue SquareConnect::ApiError => e
|
|
206
|
-
puts "Exception when calling TransactionApi->retrieve_transaction: #{e}"
|
|
207
|
-
end
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### Parameters
|
|
211
|
-
|
|
212
|
-
Name | Type | Description | Notes
|
|
213
|
-
------------- | ------------- | ------------- | -------------
|
|
214
|
-
**authorization** | **String**| The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`. |
|
|
215
|
-
**location_id** | **String**| The ID of the transaction's associated location. |
|
|
216
|
-
**transaction_id** | **String**| The ID of the transaction to retrieve. |
|
|
217
|
-
|
|
218
|
-
### Return type
|
|
219
|
-
|
|
220
|
-
[**RetrieveTransactionResponse**](RetrieveTransactionResponse.md)
|
|
221
|
-
|
|
222
|
-
### Authorization
|
|
223
|
-
|
|
224
|
-
No authorization required
|
|
225
|
-
|
|
226
|
-
### HTTP request headers
|
|
227
|
-
|
|
228
|
-
- **Content-Type**: application/json
|
|
229
|
-
- **Accept**: application/json
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
# **void_transaction**
|
|
234
|
-
> VoidTransactionResponse void_transaction(authorization, location_id, transaction_id)
|
|
235
|
-
|
|
236
|
-
VoidTransaction
|
|
237
|
-
|
|
238
|
-
Cancels a transaction that was created with the [Charge](#endpoint-charge) endpoint with a `delay_capture` value of `true`. See [Delayed capture transactions](/articles/delayed-capture-transactions/) for more information.
|
|
239
|
-
|
|
240
|
-
### Example
|
|
241
|
-
```ruby
|
|
242
|
-
# load the gem
|
|
243
|
-
require 'square_connect'
|
|
244
|
-
|
|
245
|
-
api_instance = SquareConnect::TransactionApi.new
|
|
246
|
-
|
|
247
|
-
authorization = "authorization_example" # String | The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
248
|
-
|
|
249
|
-
location_id = "location_id_example" # String |
|
|
250
|
-
|
|
251
|
-
transaction_id = "transaction_id_example" # String |
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
begin
|
|
255
|
-
#VoidTransaction
|
|
256
|
-
result = api_instance.void_transaction(authorization, location_id, transaction_id)
|
|
257
|
-
p result
|
|
258
|
-
rescue SquareConnect::ApiError => e
|
|
259
|
-
puts "Exception when calling TransactionApi->void_transaction: #{e}"
|
|
260
|
-
end
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
### Parameters
|
|
264
|
-
|
|
265
|
-
Name | Type | Description | Notes
|
|
266
|
-
------------- | ------------- | ------------- | -------------
|
|
267
|
-
**authorization** | **String**| The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`. |
|
|
268
|
-
**location_id** | **String**| |
|
|
269
|
-
**transaction_id** | **String**| |
|
|
270
|
-
|
|
271
|
-
### Return type
|
|
272
|
-
|
|
273
|
-
[**VoidTransactionResponse**](VoidTransactionResponse.md)
|
|
274
|
-
|
|
275
|
-
### Authorization
|
|
276
|
-
|
|
277
|
-
No authorization required
|
|
278
|
-
|
|
279
|
-
### HTTP request headers
|
|
280
|
-
|
|
281
|
-
- **Content-Type**: application/json
|
|
282
|
-
- **Accept**: application/json
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
#Square Connect API
|
|
3
|
-
|
|
4
|
-
OpenAPI spec version: 2.0
|
|
5
|
-
Contact: developers@squareup.com
|
|
6
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
7
|
-
|
|
8
|
-
=end
|
|
9
|
-
|
|
10
|
-
require "uri"
|
|
11
|
-
|
|
12
|
-
module SquareConnect
|
|
13
|
-
class CustomerCardApi
|
|
14
|
-
attr_accessor :api_client
|
|
15
|
-
|
|
16
|
-
def initialize(api_client = ApiClient.default)
|
|
17
|
-
@api_client = api_client
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
# CreateCustomerCard
|
|
21
|
-
# Adds a card on file to an existing customer.
|
|
22
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
23
|
-
# @param customer_id The ID of the customer to link the card on file to.
|
|
24
|
-
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
|
25
|
-
# @param [Hash] opts the optional parameters
|
|
26
|
-
# @return [CreateCustomerCardResponse]
|
|
27
|
-
def create_customer_card(authorization, customer_id, body, opts = {})
|
|
28
|
-
data, _status_code, _headers = create_customer_card_with_http_info(authorization, customer_id, body, opts)
|
|
29
|
-
return data
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
# CreateCustomerCard
|
|
33
|
-
# Adds a card on file to an existing customer.
|
|
34
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
35
|
-
# @param customer_id The ID of the customer to link the card on file to.
|
|
36
|
-
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
|
37
|
-
# @param [Hash] opts the optional parameters
|
|
38
|
-
# @return [Array<(CreateCustomerCardResponse, Fixnum, Hash)>] CreateCustomerCardResponse data, response status code and response headers
|
|
39
|
-
def create_customer_card_with_http_info(authorization, customer_id, body, opts = {})
|
|
40
|
-
if @api_client.config.debugging
|
|
41
|
-
@api_client.config.logger.debug "Calling API: CustomerCardApi.create_customer_card ..."
|
|
42
|
-
end
|
|
43
|
-
# verify the required parameter 'authorization' is set
|
|
44
|
-
fail ArgumentError, "Missing the required parameter 'authorization' when calling CustomerCardApi.create_customer_card" if authorization.nil?
|
|
45
|
-
# verify the required parameter 'customer_id' is set
|
|
46
|
-
fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomerCardApi.create_customer_card" if customer_id.nil?
|
|
47
|
-
# verify the required parameter 'body' is set
|
|
48
|
-
fail ArgumentError, "Missing the required parameter 'body' when calling CustomerCardApi.create_customer_card" if body.nil?
|
|
49
|
-
# resource path
|
|
50
|
-
local_var_path = "/v2/customers/{customer_id}/cards".sub('{format}','json').sub('{' + 'customer_id' + '}', customer_id.to_s)
|
|
51
|
-
|
|
52
|
-
# query parameters
|
|
53
|
-
query_params = {}
|
|
54
|
-
|
|
55
|
-
# header parameters
|
|
56
|
-
header_params = {}
|
|
57
|
-
# HTTP header 'Accept' (if needed)
|
|
58
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
59
|
-
# HTTP header 'Content-Type'
|
|
60
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
61
|
-
header_params[:'Authorization'] = authorization
|
|
62
|
-
|
|
63
|
-
# form parameters
|
|
64
|
-
form_params = {}
|
|
65
|
-
|
|
66
|
-
# http body (model)
|
|
67
|
-
post_body = @api_client.object_to_http_body(body)
|
|
68
|
-
auth_names = []
|
|
69
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
70
|
-
:header_params => header_params,
|
|
71
|
-
:query_params => query_params,
|
|
72
|
-
:form_params => form_params,
|
|
73
|
-
:body => post_body,
|
|
74
|
-
:auth_names => auth_names,
|
|
75
|
-
:return_type => 'CreateCustomerCardResponse')
|
|
76
|
-
if @api_client.config.debugging
|
|
77
|
-
@api_client.config.logger.debug "API called: CustomerCardApi#create_customer_card\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
78
|
-
end
|
|
79
|
-
return data, status_code, headers
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
# DeleteCustomerCard
|
|
83
|
-
# Removes a card on file from a customer.
|
|
84
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
85
|
-
# @param customer_id The ID of the customer that the card on file belongs to.
|
|
86
|
-
# @param card_id The ID of the card on file to delete.
|
|
87
|
-
# @param [Hash] opts the optional parameters
|
|
88
|
-
# @return [DeleteCustomerCardResponse]
|
|
89
|
-
def delete_customer_card(authorization, customer_id, card_id, opts = {})
|
|
90
|
-
data, _status_code, _headers = delete_customer_card_with_http_info(authorization, customer_id, card_id, opts)
|
|
91
|
-
return data
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
# DeleteCustomerCard
|
|
95
|
-
# Removes a card on file from a customer.
|
|
96
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
97
|
-
# @param customer_id The ID of the customer that the card on file belongs to.
|
|
98
|
-
# @param card_id The ID of the card on file to delete.
|
|
99
|
-
# @param [Hash] opts the optional parameters
|
|
100
|
-
# @return [Array<(DeleteCustomerCardResponse, Fixnum, Hash)>] DeleteCustomerCardResponse data, response status code and response headers
|
|
101
|
-
def delete_customer_card_with_http_info(authorization, customer_id, card_id, opts = {})
|
|
102
|
-
if @api_client.config.debugging
|
|
103
|
-
@api_client.config.logger.debug "Calling API: CustomerCardApi.delete_customer_card ..."
|
|
104
|
-
end
|
|
105
|
-
# verify the required parameter 'authorization' is set
|
|
106
|
-
fail ArgumentError, "Missing the required parameter 'authorization' when calling CustomerCardApi.delete_customer_card" if authorization.nil?
|
|
107
|
-
# verify the required parameter 'customer_id' is set
|
|
108
|
-
fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomerCardApi.delete_customer_card" if customer_id.nil?
|
|
109
|
-
# verify the required parameter 'card_id' is set
|
|
110
|
-
fail ArgumentError, "Missing the required parameter 'card_id' when calling CustomerCardApi.delete_customer_card" if card_id.nil?
|
|
111
|
-
# resource path
|
|
112
|
-
local_var_path = "/v2/customers/{customer_id}/cards/{card_id}".sub('{format}','json').sub('{' + 'customer_id' + '}', customer_id.to_s).sub('{' + 'card_id' + '}', card_id.to_s)
|
|
113
|
-
|
|
114
|
-
# query parameters
|
|
115
|
-
query_params = {}
|
|
116
|
-
|
|
117
|
-
# header parameters
|
|
118
|
-
header_params = {}
|
|
119
|
-
# HTTP header 'Accept' (if needed)
|
|
120
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
121
|
-
# HTTP header 'Content-Type'
|
|
122
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
123
|
-
header_params[:'Authorization'] = authorization
|
|
124
|
-
|
|
125
|
-
# form parameters
|
|
126
|
-
form_params = {}
|
|
127
|
-
|
|
128
|
-
# http body (model)
|
|
129
|
-
post_body = nil
|
|
130
|
-
auth_names = []
|
|
131
|
-
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
|
132
|
-
:header_params => header_params,
|
|
133
|
-
:query_params => query_params,
|
|
134
|
-
:form_params => form_params,
|
|
135
|
-
:body => post_body,
|
|
136
|
-
:auth_names => auth_names,
|
|
137
|
-
:return_type => 'DeleteCustomerCardResponse')
|
|
138
|
-
if @api_client.config.debugging
|
|
139
|
-
@api_client.config.logger.debug "API called: CustomerCardApi#delete_customer_card\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
140
|
-
end
|
|
141
|
-
return data, status_code, headers
|
|
142
|
-
end
|
|
143
|
-
end
|
|
144
|
-
end
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
#Square Connect API
|
|
3
|
-
|
|
4
|
-
OpenAPI spec version: 2.0
|
|
5
|
-
Contact: developers@squareup.com
|
|
6
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
7
|
-
|
|
8
|
-
=end
|
|
9
|
-
|
|
10
|
-
require "uri"
|
|
11
|
-
|
|
12
|
-
module SquareConnect
|
|
13
|
-
class RefundApi
|
|
14
|
-
attr_accessor :api_client
|
|
15
|
-
|
|
16
|
-
def initialize(api_client = ApiClient.default)
|
|
17
|
-
@api_client = api_client
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
# CreateRefund
|
|
21
|
-
# Initiates a refund for a previously charged tender.
|
|
22
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
23
|
-
# @param location_id The ID of the original transaction's associated location.
|
|
24
|
-
# @param transaction_id The ID of the original transaction that includes the tender to refund.
|
|
25
|
-
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
|
26
|
-
# @param [Hash] opts the optional parameters
|
|
27
|
-
# @return [CreateRefundResponse]
|
|
28
|
-
def create_refund(authorization, location_id, transaction_id, body, opts = {})
|
|
29
|
-
data, _status_code, _headers = create_refund_with_http_info(authorization, location_id, transaction_id, body, opts)
|
|
30
|
-
return data
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
# CreateRefund
|
|
34
|
-
# Initiates a refund for a previously charged tender.
|
|
35
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
36
|
-
# @param location_id The ID of the original transaction's associated location.
|
|
37
|
-
# @param transaction_id The ID of the original transaction that includes the tender to refund.
|
|
38
|
-
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
|
39
|
-
# @param [Hash] opts the optional parameters
|
|
40
|
-
# @return [Array<(CreateRefundResponse, Fixnum, Hash)>] CreateRefundResponse data, response status code and response headers
|
|
41
|
-
def create_refund_with_http_info(authorization, location_id, transaction_id, body, opts = {})
|
|
42
|
-
if @api_client.config.debugging
|
|
43
|
-
@api_client.config.logger.debug "Calling API: RefundApi.create_refund ..."
|
|
44
|
-
end
|
|
45
|
-
# verify the required parameter 'authorization' is set
|
|
46
|
-
fail ArgumentError, "Missing the required parameter 'authorization' when calling RefundApi.create_refund" if authorization.nil?
|
|
47
|
-
# verify the required parameter 'location_id' is set
|
|
48
|
-
fail ArgumentError, "Missing the required parameter 'location_id' when calling RefundApi.create_refund" if location_id.nil?
|
|
49
|
-
# verify the required parameter 'transaction_id' is set
|
|
50
|
-
fail ArgumentError, "Missing the required parameter 'transaction_id' when calling RefundApi.create_refund" if transaction_id.nil?
|
|
51
|
-
# verify the required parameter 'body' is set
|
|
52
|
-
fail ArgumentError, "Missing the required parameter 'body' when calling RefundApi.create_refund" if body.nil?
|
|
53
|
-
# resource path
|
|
54
|
-
local_var_path = "/v2/locations/{location_id}/transactions/{transaction_id}/refund".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'transaction_id' + '}', transaction_id.to_s)
|
|
55
|
-
|
|
56
|
-
# query parameters
|
|
57
|
-
query_params = {}
|
|
58
|
-
|
|
59
|
-
# header parameters
|
|
60
|
-
header_params = {}
|
|
61
|
-
# HTTP header 'Accept' (if needed)
|
|
62
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
63
|
-
# HTTP header 'Content-Type'
|
|
64
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
65
|
-
header_params[:'Authorization'] = authorization
|
|
66
|
-
|
|
67
|
-
# form parameters
|
|
68
|
-
form_params = {}
|
|
69
|
-
|
|
70
|
-
# http body (model)
|
|
71
|
-
post_body = @api_client.object_to_http_body(body)
|
|
72
|
-
auth_names = []
|
|
73
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
74
|
-
:header_params => header_params,
|
|
75
|
-
:query_params => query_params,
|
|
76
|
-
:form_params => form_params,
|
|
77
|
-
:body => post_body,
|
|
78
|
-
:auth_names => auth_names,
|
|
79
|
-
:return_type => 'CreateRefundResponse')
|
|
80
|
-
if @api_client.config.debugging
|
|
81
|
-
@api_client.config.logger.debug "API called: RefundApi#create_refund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
82
|
-
end
|
|
83
|
-
return data, status_code, headers
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
# ListRefunds
|
|
87
|
-
# Lists refunds for one of a business's locations. Refunds with a `status` of `PENDING` are not currently included in this endpoint's response. Max results per [page](#paginatingresults): 50
|
|
88
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
89
|
-
# @param location_id The ID of the location to list refunds for.
|
|
90
|
-
# @param [Hash] opts the optional parameters
|
|
91
|
-
# @option opts [String] :begin_time The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year.
|
|
92
|
-
# @option opts [String] :end_time The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time.
|
|
93
|
-
# @option opts [String] :sort_order The order in which results are listed in the response (`ASC` for oldest first, `DESC` for newest first). Default value: `DESC`
|
|
94
|
-
# @option opts [String] :cursor A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information.
|
|
95
|
-
# @return [ListRefundsResponse]
|
|
96
|
-
def list_refunds(authorization, location_id, opts = {})
|
|
97
|
-
data, _status_code, _headers = list_refunds_with_http_info(authorization, location_id, opts)
|
|
98
|
-
return data
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
# ListRefunds
|
|
102
|
-
# Lists refunds for one of a business's locations. Refunds with a `status` of `PENDING` are not currently included in this endpoint's response. Max results per [page](#paginatingresults): 50
|
|
103
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
104
|
-
# @param location_id The ID of the location to list refunds for.
|
|
105
|
-
# @param [Hash] opts the optional parameters
|
|
106
|
-
# @option opts [String] :begin_time The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year.
|
|
107
|
-
# @option opts [String] :end_time The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time.
|
|
108
|
-
# @option opts [String] :sort_order The order in which results are listed in the response (`ASC` for oldest first, `DESC` for newest first). Default value: `DESC`
|
|
109
|
-
# @option opts [String] :cursor A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information.
|
|
110
|
-
# @return [Array<(ListRefundsResponse, Fixnum, Hash)>] ListRefundsResponse data, response status code and response headers
|
|
111
|
-
def list_refunds_with_http_info(authorization, location_id, opts = {})
|
|
112
|
-
if @api_client.config.debugging
|
|
113
|
-
@api_client.config.logger.debug "Calling API: RefundApi.list_refunds ..."
|
|
114
|
-
end
|
|
115
|
-
# verify the required parameter 'authorization' is set
|
|
116
|
-
fail ArgumentError, "Missing the required parameter 'authorization' when calling RefundApi.list_refunds" if authorization.nil?
|
|
117
|
-
# verify the required parameter 'location_id' is set
|
|
118
|
-
fail ArgumentError, "Missing the required parameter 'location_id' when calling RefundApi.list_refunds" if location_id.nil?
|
|
119
|
-
if opts[:'sort_order'] && !['DESC', 'ASC'].include?(opts[:'sort_order'])
|
|
120
|
-
fail ArgumentError, 'invalid value for "sort_order", must be one of DESC, ASC'
|
|
121
|
-
end
|
|
122
|
-
# resource path
|
|
123
|
-
local_var_path = "/v2/locations/{location_id}/refunds".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)
|
|
124
|
-
|
|
125
|
-
# query parameters
|
|
126
|
-
query_params = {}
|
|
127
|
-
query_params[:'begin_time'] = opts[:'begin_time'] if !opts[:'begin_time'].nil?
|
|
128
|
-
query_params[:'end_time'] = opts[:'end_time'] if !opts[:'end_time'].nil?
|
|
129
|
-
query_params[:'sort_order'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
|
|
130
|
-
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
|
131
|
-
|
|
132
|
-
# header parameters
|
|
133
|
-
header_params = {}
|
|
134
|
-
# HTTP header 'Accept' (if needed)
|
|
135
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
136
|
-
# HTTP header 'Content-Type'
|
|
137
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
138
|
-
header_params[:'Authorization'] = authorization
|
|
139
|
-
|
|
140
|
-
# form parameters
|
|
141
|
-
form_params = {}
|
|
142
|
-
|
|
143
|
-
# http body (model)
|
|
144
|
-
post_body = nil
|
|
145
|
-
auth_names = []
|
|
146
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
147
|
-
:header_params => header_params,
|
|
148
|
-
:query_params => query_params,
|
|
149
|
-
:form_params => form_params,
|
|
150
|
-
:body => post_body,
|
|
151
|
-
:auth_names => auth_names,
|
|
152
|
-
:return_type => 'ListRefundsResponse')
|
|
153
|
-
if @api_client.config.debugging
|
|
154
|
-
@api_client.config.logger.debug "API called: RefundApi#list_refunds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
155
|
-
end
|
|
156
|
-
return data, status_code, headers
|
|
157
|
-
end
|
|
158
|
-
end
|
|
159
|
-
end
|