square_connect 2.0.0 → 2.0.2.13
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/Gemfile +7 -0
- data/README.md +151 -9
- data/Rakefile +8 -0
- data/docs/Address.md +26 -0
- data/docs/CaptureTransactionRequest.md +11 -0
- data/docs/CaptureTransactionResponse.md +12 -0
- data/docs/Card.md +18 -0
- data/docs/CardBrand.md +20 -0
- data/docs/ChargeRequest.md +22 -0
- data/docs/ChargeResponse.md +13 -0
- data/docs/Checkout.md +20 -0
- data/docs/CheckoutApi.md +62 -0
- data/docs/Country.md +261 -0
- data/docs/CreateCheckoutRequest.md +18 -0
- data/docs/CreateCheckoutResponse.md +13 -0
- data/docs/CreateCustomerCardRequest.md +14 -0
- data/docs/CreateCustomerCardResponse.md +13 -0
- data/docs/CreateCustomerRequest.md +20 -0
- data/docs/CreateCustomerResponse.md +13 -0
- data/docs/CreateOrderRequest.md +13 -0
- data/docs/CreateOrderRequestLineItem.md +14 -0
- data/docs/CreateOrderRequestOrder.md +13 -0
- data/docs/CreateRefundRequest.md +15 -0
- data/docs/CreateRefundResponse.md +13 -0
- data/docs/Currency.md +191 -0
- data/docs/Customer.md +26 -0
- data/docs/CustomerApi.md +267 -0
- data/docs/CustomerCardApi.md +116 -0
- data/docs/CustomerGroupInfo.md +13 -0
- data/docs/CustomerPreferences.md +12 -0
- data/docs/DeleteCustomerCardRequest.md +11 -0
- data/docs/DeleteCustomerCardResponse.md +12 -0
- data/docs/DeleteCustomerRequest.md +11 -0
- data/docs/DeleteCustomerResponse.md +12 -0
- data/docs/Error.md +15 -0
- data/docs/ErrorCategory.md +17 -0
- data/docs/ErrorCode.md +83 -0
- data/docs/ListCustomersRequest.md +12 -0
- data/docs/ListCustomersResponse.md +14 -0
- data/docs/ListLocationsRequest.md +11 -0
- data/docs/ListLocationsResponse.md +13 -0
- data/docs/ListRefundsRequest.md +15 -0
- data/docs/ListRefundsResponse.md +14 -0
- data/docs/ListTransactionsRequest.md +15 -0
- data/docs/ListTransactionsResponse.md +14 -0
- data/docs/Location.md +16 -0
- data/docs/LocationApi.md +56 -0
- data/docs/LocationCapability.md +12 -0
- data/docs/Money.md +13 -0
- data/docs/Order.md +16 -0
- data/docs/OrderLineItem.md +16 -0
- data/docs/Refund.md +20 -0
- data/docs/RefundApi.md +126 -0
- data/docs/RefundStatus.md +15 -0
- data/docs/RetrieveCustomerRequest.md +11 -0
- data/docs/RetrieveCustomerResponse.md +13 -0
- data/docs/RetrieveTransactionRequest.md +11 -0
- data/docs/RetrieveTransactionResponse.md +13 -0
- data/docs/SortOrder.md +13 -0
- data/docs/Tender.md +22 -0
- data/docs/TenderCardDetails.md +14 -0
- data/docs/TenderCardDetailsEntryMethod.md +16 -0
- data/docs/TenderCardDetailsStatus.md +15 -0
- data/docs/TenderCashDetails.md +13 -0
- data/docs/TenderType.md +17 -0
- data/docs/Transaction.md +21 -0
- data/docs/TransactionApi.md +285 -0
- data/docs/TransactionProduct.md +19 -0
- data/docs/UpdateCustomerRequest.md +20 -0
- data/docs/UpdateCustomerResponse.md +13 -0
- data/docs/VoidTransactionRequest.md +11 -0
- data/docs/VoidTransactionResponse.md +12 -0
- data/lib/square_connect.rb +33 -16
- data/lib/square_connect/api/checkout_api.rb +82 -0
- data/lib/square_connect/api/customer_api.rb +121 -162
- data/lib/square_connect/api/customer_card_api.rb +31 -50
- data/lib/square_connect/api/location_api.rb +12 -20
- data/lib/square_connect/api/refund_api.rb +70 -90
- data/lib/square_connect/api/transaction_api.rb +119 -165
- data/lib/square_connect/api_client.rb +64 -17
- data/lib/square_connect/api_error.rb +7 -3
- data/lib/square_connect/configuration.rb +31 -1
- data/lib/square_connect/models/address.rb +149 -78
- data/lib/square_connect/models/capture_transaction_request.rb +176 -0
- data/lib/square_connect/models/capture_transaction_response.rb +54 -26
- data/lib/square_connect/models/card.rb +98 -52
- data/lib/square_connect/models/card_brand.rb +12 -133
- data/lib/square_connect/models/charge_request.rb +106 -67
- data/lib/square_connect/models/charge_response.rb +57 -30
- data/lib/square_connect/models/checkout.rb +266 -0
- data/lib/square_connect/models/country.rb +253 -133
- data/lib/square_connect/models/create_checkout_request.rb +316 -0
- data/lib/square_connect/models/create_checkout_response.rb +198 -0
- data/lib/square_connect/models/create_customer_card_request.rb +66 -35
- data/lib/square_connect/models/create_customer_card_response.rb +58 -31
- data/lib/square_connect/models/create_customer_request.rb +79 -59
- data/lib/square_connect/models/create_customer_response.rb +58 -31
- data/lib/square_connect/models/create_order_request.rb +234 -0
- data/lib/square_connect/models/create_order_request_line_item.rb +268 -0
- data/lib/square_connect/models/create_order_request_order.rb +219 -0
- data/lib/square_connect/models/create_refund_request.rb +79 -39
- data/lib/square_connect/models/create_refund_response.rb +57 -30
- data/lib/square_connect/models/currency.rb +183 -133
- data/lib/square_connect/models/customer.rb +130 -77
- data/lib/square_connect/models/customer_group_info.rb +206 -0
- data/lib/square_connect/models/customer_preferences.rb +186 -0
- data/lib/square_connect/models/delete_customer_card_request.rb +176 -0
- data/lib/square_connect/models/delete_customer_card_response.rb +55 -27
- data/lib/square_connect/models/delete_customer_request.rb +176 -0
- data/lib/square_connect/models/delete_customer_response.rb +55 -27
- data/lib/square_connect/models/error.rb +107 -45
- data/lib/square_connect/models/error_category.rb +9 -133
- data/lib/square_connect/models/error_code.rb +75 -133
- data/lib/square_connect/models/list_customers_request.rb +55 -27
- data/lib/square_connect/models/list_customers_response.rb +61 -35
- data/lib/square_connect/models/list_locations_request.rb +176 -0
- data/lib/square_connect/models/list_locations_response.rb +57 -30
- data/lib/square_connect/models/list_refunds_request.rb +91 -42
- data/lib/square_connect/models/list_refunds_response.rb +59 -33
- data/lib/square_connect/models/list_transactions_request.rb +91 -42
- data/lib/square_connect/models/list_transactions_response.rb +59 -33
- data/lib/square_connect/models/location.rb +86 -41
- data/lib/square_connect/models/location_capability.rb +4 -133
- data/lib/square_connect/models/money.rb +85 -34
- data/lib/square_connect/models/order.rb +228 -0
- data/lib/square_connect/models/order_line_item.rb +226 -0
- data/lib/square_connect/models/refund.rb +138 -59
- data/lib/square_connect/models/refund_status.rb +7 -133
- data/lib/square_connect/models/retrieve_customer_request.rb +176 -0
- data/lib/square_connect/models/retrieve_customer_response.rb +58 -31
- data/lib/square_connect/models/retrieve_transaction_request.rb +176 -0
- data/lib/square_connect/models/retrieve_transaction_response.rb +57 -30
- data/lib/square_connect/models/sort_order.rb +5 -133
- data/lib/square_connect/models/tender.rb +112 -65
- data/lib/square_connect/models/tender_card_details.rb +93 -40
- data/lib/square_connect/models/tender_card_details_entry_method.rb +8 -133
- data/lib/square_connect/models/tender_card_details_status.rb +7 -133
- data/lib/square_connect/models/tender_cash_details.rb +58 -31
- data/lib/square_connect/models/tender_type.rb +9 -133
- data/lib/square_connect/models/transaction.rb +132 -56
- data/lib/square_connect/models/transaction_product.rb +11 -133
- data/lib/square_connect/models/update_customer_request.rb +79 -59
- data/lib/square_connect/models/update_customer_response.rb +58 -31
- data/lib/square_connect/models/void_transaction_request.rb +176 -0
- data/lib/square_connect/models/void_transaction_response.rb +54 -26
- data/lib/square_connect/version.rb +2 -3
- data/spec/api/checkout_api_spec.rb +53 -0
- data/spec/api/customer_api_spec.rb +121 -0
- data/spec/api/customer_card_api_spec.rb +71 -0
- data/spec/api/location_api_spec.rb +58 -0
- data/spec/api/refund_api_spec.rb +75 -0
- data/spec/api/transaction_api_spec.rb +128 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/address_spec.rb +186 -0
- data/spec/models/capture_transaction_request_spec.rb +36 -0
- data/spec/models/capture_transaction_response_spec.rb +46 -0
- data/spec/models/card_brand_spec.rb +36 -0
- data/spec/models/card_spec.rb +106 -0
- data/spec/models/charge_request_spec.rb +146 -0
- data/spec/models/charge_response_spec.rb +56 -0
- data/spec/models/checkout_spec.rb +126 -0
- data/spec/models/country_spec.rb +36 -0
- data/spec/models/create_checkout_request_spec.rb +106 -0
- data/spec/models/create_checkout_response_spec.rb +56 -0
- data/spec/models/create_customer_card_request_spec.rb +66 -0
- data/spec/models/create_customer_card_response_spec.rb +56 -0
- data/spec/models/create_customer_request_spec.rb +126 -0
- data/spec/models/create_customer_response_spec.rb +56 -0
- data/spec/models/create_order_request_line_item_spec.rb +66 -0
- data/spec/models/create_order_request_order_spec.rb +56 -0
- data/spec/models/create_order_request_spec.rb +56 -0
- data/spec/models/create_refund_request_spec.rb +76 -0
- data/spec/models/create_refund_response_spec.rb +56 -0
- data/spec/models/currency_spec.rb +36 -0
- data/spec/models/customer_group_info_spec.rb +56 -0
- data/spec/models/customer_preferences_spec.rb +46 -0
- data/spec/models/customer_spec.rb +186 -0
- data/spec/models/delete_customer_card_request_spec.rb +36 -0
- data/spec/models/delete_customer_card_response_spec.rb +46 -0
- data/spec/models/delete_customer_request_spec.rb +36 -0
- data/spec/models/delete_customer_response_spec.rb +46 -0
- data/spec/models/error_category_spec.rb +36 -0
- data/spec/models/error_code_spec.rb +36 -0
- data/spec/models/error_spec.rb +76 -0
- data/spec/models/list_customers_request_spec.rb +46 -0
- data/spec/models/list_customers_response_spec.rb +66 -0
- data/spec/models/list_locations_request_spec.rb +36 -0
- data/spec/models/list_locations_response_spec.rb +56 -0
- data/spec/models/list_refunds_request_spec.rb +76 -0
- data/spec/models/list_refunds_response_spec.rb +66 -0
- data/spec/models/list_transactions_request_spec.rb +76 -0
- data/spec/models/list_transactions_response_spec.rb +66 -0
- data/spec/models/location_capability_spec.rb +36 -0
- data/spec/models/location_spec.rb +86 -0
- data/spec/models/money_spec.rb +56 -0
- data/spec/models/order_line_item_spec.rb +86 -0
- data/spec/models/order_spec.rb +86 -0
- data/spec/models/refund_spec.rb +126 -0
- data/spec/models/refund_status_spec.rb +36 -0
- data/spec/models/retrieve_customer_request_spec.rb +36 -0
- data/spec/models/retrieve_customer_response_spec.rb +56 -0
- data/spec/models/retrieve_transaction_request_spec.rb +36 -0
- data/spec/models/retrieve_transaction_response_spec.rb +56 -0
- data/spec/models/sort_order_spec.rb +36 -0
- data/spec/models/tender_card_details_entry_method_spec.rb +36 -0
- data/spec/models/tender_card_details_spec.rb +66 -0
- data/spec/models/tender_card_details_status_spec.rb +36 -0
- data/spec/models/tender_cash_details_spec.rb +56 -0
- data/spec/models/tender_spec.rb +146 -0
- data/spec/models/tender_type_spec.rb +36 -0
- data/spec/models/transaction_product_spec.rb +36 -0
- data/spec/models/transaction_spec.rb +136 -0
- data/spec/models/update_customer_request_spec.rb +126 -0
- data/spec/models/update_customer_response_spec.rb +56 -0
- data/spec/models/void_transaction_request_spec.rb +36 -0
- data/spec/models/void_transaction_response_spec.rb +46 -0
- data/spec/spec_helper.rb +115 -0
- data/square_connect.gemspec +22 -11
- data/travis-ci/accounts.enc +0 -0
- metadata +264 -31
data/docs/LocationApi.md
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# SquareConnect::LocationApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://connect.squareup.com*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**list_locations**](LocationApi.md#list_locations) | **GET** /v2/locations | ListLocations
|
8
|
+
|
9
|
+
|
10
|
+
# **list_locations**
|
11
|
+
> ListLocationsResponse list_locations(authorization)
|
12
|
+
|
13
|
+
ListLocations
|
14
|
+
|
15
|
+
Provides the details for all of a business's locations. Most other Connect API endpoints have a required `location_id` path parameter. The `id` field of the [`Location`](#type-location) objects returned by this endpoint correspond to that `location_id` parameter.
|
16
|
+
|
17
|
+
### Example
|
18
|
+
```ruby
|
19
|
+
# load the gem
|
20
|
+
require 'square_connect'
|
21
|
+
|
22
|
+
api_instance = SquareConnect::LocationApi.new
|
23
|
+
|
24
|
+
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`.
|
25
|
+
|
26
|
+
|
27
|
+
begin
|
28
|
+
#ListLocations
|
29
|
+
result = api_instance.list_locations(authorization)
|
30
|
+
p result
|
31
|
+
rescue SquareConnect::ApiError => e
|
32
|
+
puts "Exception when calling LocationApi->list_locations: #{e}"
|
33
|
+
end
|
34
|
+
```
|
35
|
+
|
36
|
+
### Parameters
|
37
|
+
|
38
|
+
Name | Type | Description | Notes
|
39
|
+
------------- | ------------- | ------------- | -------------
|
40
|
+
**authorization** | **String**| The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`. |
|
41
|
+
|
42
|
+
### Return type
|
43
|
+
|
44
|
+
[**ListLocationsResponse**](ListLocationsResponse.md)
|
45
|
+
|
46
|
+
### Authorization
|
47
|
+
|
48
|
+
No authorization required
|
49
|
+
|
50
|
+
### HTTP request headers
|
51
|
+
|
52
|
+
- **Content-Type**: application/json
|
53
|
+
- **Accept**: application/json
|
54
|
+
|
55
|
+
|
56
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# SquareConnect::LocationCapability
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Indicates account capabilities that a business's location might or might not have enabled.
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type
|
9
|
+
------------ | -------------
|
10
|
+
**CREDIT_CARD_PROCESSING** | string
|
11
|
+
|
12
|
+
|
data/docs/Money.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# SquareConnect::Money
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Represents an amount of money. __Important:__ Unlike version 1 of the Connect API, __all monetary amounts returned by v2 endpoints are positive.__ (In v1, monetary amounts are negative if they represent money being paid _by_ a merchant, instead of money being paid _to_ a merchant.)
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type | Description | Notes
|
9
|
+
------------ | ------------- | ------------- | -------------
|
10
|
+
**amount** | **Integer** | The amount of money, in the smallest denomination of the currency indicated by `currency`. For example, when `currency` is `USD`, `amount` is in cents. | [optional]
|
11
|
+
**currency** | **String** | The type of currency, in __ISO 4217 format__. For example, the currency code for US dollars is `USD`. See [Currency](#type-currency) for possible values. | [optional]
|
12
|
+
|
13
|
+
|
data/docs/Order.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# SquareConnect::Order
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Contains all information related to a single order to process with Square, including line items that specify the products to purchase
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type | Description | Notes
|
9
|
+
------------ | ------------- | ------------- | -------------
|
10
|
+
**id** | **String** | The order's unique ID. This value is not present if the order was not created with the [CreateOrder](#endpoint-createorder) endpoint. | [optional]
|
11
|
+
**location_id** | **String** | The ID of the merchant location this order is associated with. | [optional]
|
12
|
+
**reference_id** | **String** | A client specified identifier to associate an entity in another system with this order. | [optional]
|
13
|
+
**line_items** | [**Array<OrderLineItem>**](OrderLineItem.md) | The line items included in the order. Every order has at least one line item. | [optional]
|
14
|
+
**total_money** | [**Money**](Money.md) | The total amount of money to collect for the order. | [optional]
|
15
|
+
|
16
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# SquareConnect::OrderLineItem
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Represents a line item in an order. Each line item describes a different product to purchase, with its own quantity and price details.
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type | Description | Notes
|
9
|
+
------------ | ------------- | ------------- | -------------
|
10
|
+
**id** | **String** | The line item's ID, unique only within this order. | [optional]
|
11
|
+
**name** | **String** | The name of the line item. | [optional]
|
12
|
+
**quantity** | **String** | The quantity of the product to purchase. Currently, this string must have an integer value. | [optional]
|
13
|
+
**base_price_money** | [**Money**](Money.md) | The base price for a single unit of the line item's associated variation. If a line item represents a Custom Amount instead of a particular product, this field indicates that amount. | [optional]
|
14
|
+
**total_money** | [**Money**](Money.md) | The total amount of money to collect for this line item. | [optional]
|
15
|
+
|
16
|
+
|
data/docs/Refund.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# SquareConnect::Refund
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Represents a refund processed for a Square transaction.
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type | Description | Notes
|
9
|
+
------------ | ------------- | ------------- | -------------
|
10
|
+
**id** | **String** | The refund's unique ID. |
|
11
|
+
**location_id** | **String** | The ID of the refund's associated location. |
|
12
|
+
**transaction_id** | **String** | The ID of the transaction that the refunded tender is part of. |
|
13
|
+
**tender_id** | **String** | The ID of the refunded tender. |
|
14
|
+
**created_at** | **String** | The time when the refund was created, in RFC 3339 format. | [optional]
|
15
|
+
**reason** | **String** | The reason for the refund being issued. |
|
16
|
+
**amount_money** | [**Money**](Money.md) | The amount of money refunded to the buyer. |
|
17
|
+
**status** | **String** | The current status of the refund (`PENDING`, `APPROVED`, `REJECTED`, or `FAILED`). |
|
18
|
+
**processing_fee_money** | [**Money**](Money.md) | The amount of Square processing fee money refunded to the *merchant*. | [optional]
|
19
|
+
|
20
|
+
|
data/docs/RefundApi.md
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
# SquareConnect::RefundApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://connect.squareup.com*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**create_refund**](RefundApi.md#create_refund) | **POST** /v2/locations/{location_id}/transactions/{transaction_id}/refund | CreateRefund
|
8
|
+
[**list_refunds**](RefundApi.md#list_refunds) | **GET** /v2/locations/{location_id}/refunds | ListRefunds
|
9
|
+
|
10
|
+
|
11
|
+
# **create_refund**
|
12
|
+
> CreateRefundResponse create_refund(authorization, location_id, transaction_id, body)
|
13
|
+
|
14
|
+
CreateRefund
|
15
|
+
|
16
|
+
Initiates a refund for a previously charged tender.
|
17
|
+
|
18
|
+
### Example
|
19
|
+
```ruby
|
20
|
+
# load the gem
|
21
|
+
require 'square_connect'
|
22
|
+
|
23
|
+
api_instance = SquareConnect::RefundApi.new
|
24
|
+
|
25
|
+
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`.
|
26
|
+
|
27
|
+
location_id = "location_id_example" # String | The ID of the original transaction's associated location.
|
28
|
+
|
29
|
+
transaction_id = "transaction_id_example" # String | The ID of the original transaction that includes the tender to refund.
|
30
|
+
|
31
|
+
body = SquareConnect::CreateRefundRequest.new # CreateRefundRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
32
|
+
|
33
|
+
|
34
|
+
begin
|
35
|
+
#CreateRefund
|
36
|
+
result = api_instance.create_refund(authorization, location_id, transaction_id, body)
|
37
|
+
p result
|
38
|
+
rescue SquareConnect::ApiError => e
|
39
|
+
puts "Exception when calling RefundApi->create_refund: #{e}"
|
40
|
+
end
|
41
|
+
```
|
42
|
+
|
43
|
+
### Parameters
|
44
|
+
|
45
|
+
Name | Type | Description | Notes
|
46
|
+
------------- | ------------- | ------------- | -------------
|
47
|
+
**authorization** | **String**| The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`. |
|
48
|
+
**location_id** | **String**| The ID of the original transaction's associated location. |
|
49
|
+
**transaction_id** | **String**| The ID of the original transaction that includes the tender to refund. |
|
50
|
+
**body** | [**CreateRefundRequest**](CreateRefundRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. |
|
51
|
+
|
52
|
+
### Return type
|
53
|
+
|
54
|
+
[**CreateRefundResponse**](CreateRefundResponse.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
|
+
# **list_refunds**
|
68
|
+
> ListRefundsResponse list_refunds(authorization, location_id, opts)
|
69
|
+
|
70
|
+
ListRefunds
|
71
|
+
|
72
|
+
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
|
73
|
+
|
74
|
+
### Example
|
75
|
+
```ruby
|
76
|
+
# load the gem
|
77
|
+
require 'square_connect'
|
78
|
+
|
79
|
+
api_instance = SquareConnect::RefundApi.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 list refunds for.
|
84
|
+
|
85
|
+
opts = {
|
86
|
+
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.
|
87
|
+
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.
|
88
|
+
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`
|
89
|
+
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.
|
90
|
+
}
|
91
|
+
|
92
|
+
begin
|
93
|
+
#ListRefunds
|
94
|
+
result = api_instance.list_refunds(authorization, location_id, opts)
|
95
|
+
p result
|
96
|
+
rescue SquareConnect::ApiError => e
|
97
|
+
puts "Exception when calling RefundApi->list_refunds: #{e}"
|
98
|
+
end
|
99
|
+
```
|
100
|
+
|
101
|
+
### Parameters
|
102
|
+
|
103
|
+
Name | Type | Description | Notes
|
104
|
+
------------- | ------------- | ------------- | -------------
|
105
|
+
**authorization** | **String**| The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`. |
|
106
|
+
**location_id** | **String**| The ID of the location to list refunds for. |
|
107
|
+
**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]
|
108
|
+
**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]
|
109
|
+
**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]
|
110
|
+
**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]
|
111
|
+
|
112
|
+
### Return type
|
113
|
+
|
114
|
+
[**ListRefundsResponse**](ListRefundsResponse.md)
|
115
|
+
|
116
|
+
### Authorization
|
117
|
+
|
118
|
+
No authorization required
|
119
|
+
|
120
|
+
### HTTP request headers
|
121
|
+
|
122
|
+
- **Content-Type**: application/json
|
123
|
+
- **Accept**: application/json
|
124
|
+
|
125
|
+
|
126
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# SquareConnect::RefundStatus
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Indicates a refund's current status.
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type
|
9
|
+
------------ | -------------
|
10
|
+
**PENDING** | string
|
11
|
+
**APPROVED** | string
|
12
|
+
**REJECTED** | string
|
13
|
+
**FAILED** | string
|
14
|
+
|
15
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# SquareConnect::RetrieveCustomerResponse
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Defines the fields that are included in the response body of a request to the [RetrieveCustomer](#endpoint-retrievecustomer) endpoint. One of `errors` or `customer` is present in a given response (never both).
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type | Description | Notes
|
9
|
+
------------ | ------------- | ------------- | -------------
|
10
|
+
**errors** | [**Array<Error>**](Error.md) | Any errors that occurred during the request. | [optional]
|
11
|
+
**customer** | [**Customer**](Customer.md) | The requested customer. | [optional]
|
12
|
+
|
13
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# SquareConnect::RetrieveTransactionResponse
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Defines the fields that are included in the response body of a request to the [RetrieveTransaction](#endpont-retrievetransaction) endpoint. One of `errors` or `transaction` is present in a given response (never both).
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type | Description | Notes
|
9
|
+
------------ | ------------- | ------------- | -------------
|
10
|
+
**errors** | [**Array<Error>**](Error.md) | Any errors that occurred during the request. | [optional]
|
11
|
+
**transaction** | [**Transaction**](Transaction.md) | The requested transaction. | [optional]
|
12
|
+
|
13
|
+
|
data/docs/SortOrder.md
ADDED
data/docs/Tender.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# SquareConnect::Tender
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Represents a tender (i.e., a method of payment) used in a Square transaction.
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type | Description | Notes
|
9
|
+
------------ | ------------- | ------------- | -------------
|
10
|
+
**id** | **String** | The tender's unique ID. | [optional]
|
11
|
+
**location_id** | **String** | The ID of the transaction's associated location. | [optional]
|
12
|
+
**transaction_id** | **String** | The ID of the tender's associated transaction. | [optional]
|
13
|
+
**created_at** | **String** | The time when the tender was created, in RFC 3339 format. | [optional]
|
14
|
+
**note** | **String** | An optional note associated with the tender at the time of payment. | [optional]
|
15
|
+
**amount_money** | [**Money**](Money.md) | The amount of the tender. | [optional]
|
16
|
+
**processing_fee_money** | [**Money**](Money.md) | The amount of any Square processing fees applied to the tender. This field is not immediately populated when a new transaction is created. It is usually available after about ten seconds. | [optional]
|
17
|
+
**customer_id** | **String** | If the tender is associated with a customer or represents a customer's card on file, this is the ID of the associated customer. | [optional]
|
18
|
+
**type** | **String** | The type of tender, such as `CARD` or `CASH`. |
|
19
|
+
**card_details** | [**TenderCardDetails**](TenderCardDetails.md) | The details of the card tender. This value is present only if the value of `type` is `CARD`. | [optional]
|
20
|
+
**cash_details** | [**TenderCashDetails**](TenderCashDetails.md) | The details of the cash tender. This value is present only if the value of `type` is `CASH`. | [optional]
|
21
|
+
|
22
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# SquareConnect::TenderCardDetails
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Represents additional details of a tender with `type` `CARD` or `SQUARE_GIFT_CARD`
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type | Description | Notes
|
9
|
+
------------ | ------------- | ------------- | -------------
|
10
|
+
**status** | **String** | The credit card payment's current state (such as `AUTHORIZED` or `CAPTURED`). See [TenderCardDetailsStatus](#type-tendercarddetailsstatus) for possible values. | [optional]
|
11
|
+
**card** | [**Card**](Card.md) | The credit card's non-confidential details. | [optional]
|
12
|
+
**entry_method** | **String** | The method used to enter the card's details for the transaction. | [optional]
|
13
|
+
|
14
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# SquareConnect::TenderCardDetailsEntryMethod
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Indicates the method used to enter the card's details.
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type
|
9
|
+
------------ | -------------
|
10
|
+
**SWIPED** | string
|
11
|
+
**KEYED** | string
|
12
|
+
**EMV** | string
|
13
|
+
**ON_FILE** | string
|
14
|
+
**CONTACTLESS** | string
|
15
|
+
|
16
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# SquareConnect::TenderCardDetailsStatus
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Indicates the card transaction's current status.
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type
|
9
|
+
------------ | -------------
|
10
|
+
**AUTHORIZED** | string
|
11
|
+
**CAPTURED** | string
|
12
|
+
**VOIDED** | string
|
13
|
+
**FAILED** | string
|
14
|
+
|
15
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# SquareConnect::TenderCashDetails
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Represents the details of a tender with `type` `CASH`.
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type | Description | Notes
|
9
|
+
------------ | ------------- | ------------- | -------------
|
10
|
+
**buyer_tendered_money** | [**Money**](Money.md) | The total amount of cash provided by the buyer, before change is given. | [optional]
|
11
|
+
**change_back_money** | [**Money**](Money.md) | The amount of change returned to the buyer. | [optional]
|
12
|
+
|
13
|
+
|
data/docs/TenderType.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# SquareConnect::TenderType
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Indicates a tender's type.
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type
|
9
|
+
------------ | -------------
|
10
|
+
**CARD** | string
|
11
|
+
**CASH** | string
|
12
|
+
**THIRD_PARTY_CARD** | string
|
13
|
+
**SQUARE_GIFT_CARD** | string
|
14
|
+
**NO_SALE** | string
|
15
|
+
**OTHER** | string
|
16
|
+
|
17
|
+
|