square_connect 2.0.0 → 2.0.2.13
Sign up to get free protection for your applications and to get access to all the features.
- 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/Transaction.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# SquareConnect::Transaction
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Represents a transaction processed with Square, either with the Connect API or with Square Register. The `tenders` field of this object lists all methods of payment used to pay in the transaction.
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type | Description | Notes
|
9
|
+
------------ | ------------- | ------------- | -------------
|
10
|
+
**id** | **String** | The transaction's unique ID, issued by Square payments servers. | [optional]
|
11
|
+
**location_id** | **String** | The ID of the transaction's associated location. | [optional]
|
12
|
+
**created_at** | **String** | The time when the transaction was created, in RFC 3339 format. | [optional]
|
13
|
+
**tenders** | [**Array<Tender>**](Tender.md) | The tenders used to pay in the transaction. | [optional]
|
14
|
+
**refunds** | [**Array<Refund>**](Refund.md) | Refunds that have been applied to any tender in the transaction. | [optional]
|
15
|
+
**reference_id** | **String** | If the transaction was created with the [Charge](#endpoint-charge) endpoint, this value is the same as the value provided for the `reference_id` parameter in the request to that endpoint. Otherwise, it is not set. | [optional]
|
16
|
+
**product** | **String** | The Square product that processed the transaction. | [optional]
|
17
|
+
**client_id** | **String** | If the transaction was created in the Square Register app, this value is the ID generated for the transaction by Square Register. This ID has no relationship to the transaction's canonical `id`, which is generated by Square's backend servers. This value is generated for bookkeeping purposes, in case the transaction cannot immediately be completed (for example, if the transaction is processed in offline mode). It is not currently possible with the Connect API to perform a transaction lookup by this value. | [optional]
|
18
|
+
**order** | [**Order**](Order.md) | The order associated with this transaction, if any. | [optional]
|
19
|
+
**shipping_address** | [**Address**](Address.md) | The shipping address provided in the request, if any. | [optional]
|
20
|
+
|
21
|
+
|
@@ -0,0 +1,285 @@
|
|
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
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# SquareConnect::TransactionProduct
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Indicates the Square product used to process a transaction.
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type
|
9
|
+
------------ | -------------
|
10
|
+
**REGISTER** | string
|
11
|
+
**EXTERNAL_API** | string
|
12
|
+
**BILLING** | string
|
13
|
+
**APPOINTMENTS** | string
|
14
|
+
**INVOICES** | string
|
15
|
+
**ONLINE_STORE** | string
|
16
|
+
**PAYROLL** | string
|
17
|
+
**OTHER** | string
|
18
|
+
|
19
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# SquareConnect::UpdateCustomerRequest
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Defines the body parameters that can be provided in a request to the [UpdateCustomer](#endpoint-updatecustomer) endpoint.
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type | Description | Notes
|
9
|
+
------------ | ------------- | ------------- | -------------
|
10
|
+
**given_name** | **String** | The customer's given (i.e., first) name. | [optional]
|
11
|
+
**family_name** | **String** | The customer's family (i.e., last) name. | [optional]
|
12
|
+
**company_name** | **String** | The name of the customer's company. | [optional]
|
13
|
+
**nickname** | **String** | A nickname for the customer. | [optional]
|
14
|
+
**email_address** | **String** | The customer's email address. | [optional]
|
15
|
+
**address** | [**Address**](Address.md) | The customer's physical address. | [optional]
|
16
|
+
**phone_number** | **String** | The customer's phone number. | [optional]
|
17
|
+
**reference_id** | **String** | An optional second ID you can set to associate the customer with an entity in another system. | [optional]
|
18
|
+
**note** | **String** | An optional note to associate with the customer. | [optional]
|
19
|
+
|
20
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# SquareConnect::UpdateCustomerResponse
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Defines the fields that are included in the response body of a request to the [UpdateCustomer](#endpoint-updatecustomer) 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 updated customer. | [optional]
|
12
|
+
|
13
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# SquareConnect::VoidTransactionResponse
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Defines the fields that are included in the response body of a request to the [CaptureTransaction](#endpoint-capturetransaction) endpoint.
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type | Description | Notes
|
9
|
+
------------ | ------------- | ------------- | -------------
|
10
|
+
**errors** | [**Array<Error>**](Error.md) | Any errors that occurred during the request. | [optional]
|
11
|
+
|
12
|
+
|
data/lib/square_connect.rb
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
=begin
|
2
|
-
Square Connect API
|
2
|
+
#Square Connect API
|
3
3
|
|
4
4
|
OpenAPI spec version: 2.0
|
5
5
|
|
6
6
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
7
7
|
|
8
|
-
|
9
8
|
=end
|
10
9
|
|
11
10
|
# Common files
|
@@ -15,59 +14,77 @@ require 'square_connect/version'
|
|
15
14
|
require 'square_connect/configuration'
|
16
15
|
|
17
16
|
# Models
|
18
|
-
require 'square_connect/models/card_brand'
|
19
|
-
require 'square_connect/models/country'
|
20
|
-
require 'square_connect/models/currency'
|
21
|
-
require 'square_connect/models/error_category'
|
22
|
-
require 'square_connect/models/error_code'
|
23
|
-
require 'square_connect/models/location_capability'
|
24
|
-
require 'square_connect/models/refund_status'
|
25
|
-
require 'square_connect/models/sort_order'
|
26
|
-
require 'square_connect/models/tender_card_details_entry_method'
|
27
|
-
require 'square_connect/models/tender_card_details_status'
|
28
|
-
require 'square_connect/models/tender_type'
|
29
|
-
require 'square_connect/models/transaction_product'
|
30
17
|
require 'square_connect/models/address'
|
18
|
+
require 'square_connect/models/capture_transaction_request'
|
31
19
|
require 'square_connect/models/capture_transaction_response'
|
32
20
|
require 'square_connect/models/card'
|
21
|
+
require 'square_connect/models/card_brand'
|
33
22
|
require 'square_connect/models/charge_request'
|
34
23
|
require 'square_connect/models/charge_response'
|
24
|
+
require 'square_connect/models/checkout'
|
25
|
+
require 'square_connect/models/country'
|
26
|
+
require 'square_connect/models/create_checkout_request'
|
27
|
+
require 'square_connect/models/create_checkout_response'
|
35
28
|
require 'square_connect/models/create_customer_card_request'
|
36
29
|
require 'square_connect/models/create_customer_card_response'
|
37
30
|
require 'square_connect/models/create_customer_request'
|
38
31
|
require 'square_connect/models/create_customer_response'
|
32
|
+
require 'square_connect/models/create_order_request'
|
33
|
+
require 'square_connect/models/create_order_request_line_item'
|
34
|
+
require 'square_connect/models/create_order_request_order'
|
39
35
|
require 'square_connect/models/create_refund_request'
|
40
36
|
require 'square_connect/models/create_refund_response'
|
37
|
+
require 'square_connect/models/currency'
|
41
38
|
require 'square_connect/models/customer'
|
39
|
+
require 'square_connect/models/customer_group_info'
|
40
|
+
require 'square_connect/models/customer_preferences'
|
41
|
+
require 'square_connect/models/delete_customer_card_request'
|
42
42
|
require 'square_connect/models/delete_customer_card_response'
|
43
|
+
require 'square_connect/models/delete_customer_request'
|
43
44
|
require 'square_connect/models/delete_customer_response'
|
44
45
|
require 'square_connect/models/error'
|
46
|
+
require 'square_connect/models/error_category'
|
47
|
+
require 'square_connect/models/error_code'
|
45
48
|
require 'square_connect/models/list_customers_request'
|
46
49
|
require 'square_connect/models/list_customers_response'
|
50
|
+
require 'square_connect/models/list_locations_request'
|
47
51
|
require 'square_connect/models/list_locations_response'
|
48
52
|
require 'square_connect/models/list_refunds_request'
|
49
53
|
require 'square_connect/models/list_refunds_response'
|
50
54
|
require 'square_connect/models/list_transactions_request'
|
51
55
|
require 'square_connect/models/list_transactions_response'
|
52
56
|
require 'square_connect/models/location'
|
57
|
+
require 'square_connect/models/location_capability'
|
53
58
|
require 'square_connect/models/money'
|
59
|
+
require 'square_connect/models/order'
|
60
|
+
require 'square_connect/models/order_line_item'
|
54
61
|
require 'square_connect/models/refund'
|
62
|
+
require 'square_connect/models/refund_status'
|
63
|
+
require 'square_connect/models/retrieve_customer_request'
|
55
64
|
require 'square_connect/models/retrieve_customer_response'
|
65
|
+
require 'square_connect/models/retrieve_transaction_request'
|
56
66
|
require 'square_connect/models/retrieve_transaction_response'
|
67
|
+
require 'square_connect/models/sort_order'
|
57
68
|
require 'square_connect/models/tender'
|
58
69
|
require 'square_connect/models/tender_card_details'
|
70
|
+
require 'square_connect/models/tender_card_details_entry_method'
|
71
|
+
require 'square_connect/models/tender_card_details_status'
|
59
72
|
require 'square_connect/models/tender_cash_details'
|
73
|
+
require 'square_connect/models/tender_type'
|
60
74
|
require 'square_connect/models/transaction'
|
75
|
+
require 'square_connect/models/transaction_product'
|
61
76
|
require 'square_connect/models/update_customer_request'
|
62
77
|
require 'square_connect/models/update_customer_response'
|
78
|
+
require 'square_connect/models/void_transaction_request'
|
63
79
|
require 'square_connect/models/void_transaction_response'
|
64
80
|
|
65
81
|
# APIs
|
82
|
+
require 'square_connect/api/checkout_api'
|
83
|
+
require 'square_connect/api/customer_api'
|
66
84
|
require 'square_connect/api/customer_card_api'
|
85
|
+
require 'square_connect/api/location_api'
|
67
86
|
require 'square_connect/api/refund_api'
|
68
87
|
require 'square_connect/api/transaction_api'
|
69
|
-
require 'square_connect/api/customer_api'
|
70
|
-
require 'square_connect/api/location_api'
|
71
88
|
|
72
89
|
module SquareConnect
|
73
90
|
class << self
|