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
|
@@ -10,7 +10,7 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
|
10
10
|
require "uri"
|
|
11
11
|
|
|
12
12
|
module SquareConnect
|
|
13
|
-
class
|
|
13
|
+
class LocationsApi
|
|
14
14
|
attr_accessor :api_client
|
|
15
15
|
|
|
16
16
|
def initialize(api_client = ApiClient.default)
|
|
@@ -19,25 +19,21 @@ module SquareConnect
|
|
|
19
19
|
|
|
20
20
|
# ListLocations
|
|
21
21
|
# 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.
|
|
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
22
|
# @param [Hash] opts the optional parameters
|
|
24
23
|
# @return [ListLocationsResponse]
|
|
25
|
-
def list_locations(
|
|
26
|
-
data, _status_code, _headers = list_locations_with_http_info(
|
|
24
|
+
def list_locations(opts = {})
|
|
25
|
+
data, _status_code, _headers = list_locations_with_http_info(opts)
|
|
27
26
|
return data
|
|
28
27
|
end
|
|
29
28
|
|
|
30
29
|
# ListLocations
|
|
31
30
|
# 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.
|
|
32
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
33
31
|
# @param [Hash] opts the optional parameters
|
|
34
32
|
# @return [Array<(ListLocationsResponse, Fixnum, Hash)>] ListLocationsResponse data, response status code and response headers
|
|
35
|
-
def list_locations_with_http_info(
|
|
33
|
+
def list_locations_with_http_info(opts = {})
|
|
36
34
|
if @api_client.config.debugging
|
|
37
|
-
@api_client.config.logger.debug "Calling API:
|
|
35
|
+
@api_client.config.logger.debug "Calling API: LocationsApi.list_locations ..."
|
|
38
36
|
end
|
|
39
|
-
# verify the required parameter 'authorization' is set
|
|
40
|
-
fail ArgumentError, "Missing the required parameter 'authorization' when calling LocationApi.list_locations" if authorization.nil?
|
|
41
37
|
# resource path
|
|
42
38
|
local_var_path = "/v2/locations".sub('{format}','json')
|
|
43
39
|
|
|
@@ -50,14 +46,13 @@ module SquareConnect
|
|
|
50
46
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
51
47
|
# HTTP header 'Content-Type'
|
|
52
48
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
53
|
-
header_params[:'Authorization'] = authorization
|
|
54
49
|
|
|
55
50
|
# form parameters
|
|
56
51
|
form_params = {}
|
|
57
52
|
|
|
58
53
|
# http body (model)
|
|
59
54
|
post_body = nil
|
|
60
|
-
auth_names = []
|
|
55
|
+
auth_names = ['oauth2']
|
|
61
56
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
62
57
|
:header_params => header_params,
|
|
63
58
|
:query_params => query_params,
|
|
@@ -66,7 +61,7 @@ module SquareConnect
|
|
|
66
61
|
:auth_names => auth_names,
|
|
67
62
|
:return_type => 'ListLocationsResponse')
|
|
68
63
|
if @api_client.config.debugging
|
|
69
|
-
@api_client.config.logger.debug "API called:
|
|
64
|
+
@api_client.config.logger.debug "API called: LocationsApi#list_locations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
70
65
|
end
|
|
71
66
|
return data, status_code, headers
|
|
72
67
|
end
|
|
@@ -10,7 +10,7 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
|
10
10
|
require "uri"
|
|
11
11
|
|
|
12
12
|
module SquareConnect
|
|
13
|
-
class
|
|
13
|
+
class TransactionsApi
|
|
14
14
|
attr_accessor :api_client
|
|
15
15
|
|
|
16
16
|
def initialize(api_client = ApiClient.default)
|
|
@@ -19,33 +19,29 @@ module SquareConnect
|
|
|
19
19
|
|
|
20
20
|
# CaptureTransaction
|
|
21
21
|
# 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.
|
|
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
22
|
# @param location_id
|
|
24
23
|
# @param transaction_id
|
|
25
24
|
# @param [Hash] opts the optional parameters
|
|
26
25
|
# @return [CaptureTransactionResponse]
|
|
27
|
-
def capture_transaction(
|
|
28
|
-
data, _status_code, _headers = capture_transaction_with_http_info(
|
|
26
|
+
def capture_transaction(location_id, transaction_id, opts = {})
|
|
27
|
+
data, _status_code, _headers = capture_transaction_with_http_info(location_id, transaction_id, opts)
|
|
29
28
|
return data
|
|
30
29
|
end
|
|
31
30
|
|
|
32
31
|
# CaptureTransaction
|
|
33
32
|
# 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.
|
|
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
33
|
# @param location_id
|
|
36
34
|
# @param transaction_id
|
|
37
35
|
# @param [Hash] opts the optional parameters
|
|
38
36
|
# @return [Array<(CaptureTransactionResponse, Fixnum, Hash)>] CaptureTransactionResponse data, response status code and response headers
|
|
39
|
-
def capture_transaction_with_http_info(
|
|
37
|
+
def capture_transaction_with_http_info(location_id, transaction_id, opts = {})
|
|
40
38
|
if @api_client.config.debugging
|
|
41
|
-
@api_client.config.logger.debug "Calling API:
|
|
39
|
+
@api_client.config.logger.debug "Calling API: TransactionsApi.capture_transaction ..."
|
|
42
40
|
end
|
|
43
|
-
# verify the required parameter 'authorization' is set
|
|
44
|
-
fail ArgumentError, "Missing the required parameter 'authorization' when calling TransactionApi.capture_transaction" if authorization.nil?
|
|
45
41
|
# verify the required parameter 'location_id' is set
|
|
46
|
-
fail ArgumentError, "Missing the required parameter 'location_id' when calling
|
|
42
|
+
fail ArgumentError, "Missing the required parameter 'location_id' when calling TransactionsApi.capture_transaction" if location_id.nil?
|
|
47
43
|
# verify the required parameter 'transaction_id' is set
|
|
48
|
-
fail ArgumentError, "Missing the required parameter 'transaction_id' when calling
|
|
44
|
+
fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TransactionsApi.capture_transaction" if transaction_id.nil?
|
|
49
45
|
# resource path
|
|
50
46
|
local_var_path = "/v2/locations/{location_id}/transactions/{transaction_id}/capture".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'transaction_id' + '}', transaction_id.to_s)
|
|
51
47
|
|
|
@@ -58,14 +54,13 @@ module SquareConnect
|
|
|
58
54
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
59
55
|
# HTTP header 'Content-Type'
|
|
60
56
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
61
|
-
header_params[:'Authorization'] = authorization
|
|
62
57
|
|
|
63
58
|
# form parameters
|
|
64
59
|
form_params = {}
|
|
65
60
|
|
|
66
61
|
# http body (model)
|
|
67
62
|
post_body = nil
|
|
68
|
-
auth_names = []
|
|
63
|
+
auth_names = ['oauth2']
|
|
69
64
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
70
65
|
:header_params => header_params,
|
|
71
66
|
:query_params => query_params,
|
|
@@ -74,40 +69,36 @@ module SquareConnect
|
|
|
74
69
|
:auth_names => auth_names,
|
|
75
70
|
:return_type => 'CaptureTransactionResponse')
|
|
76
71
|
if @api_client.config.debugging
|
|
77
|
-
@api_client.config.logger.debug "API called:
|
|
72
|
+
@api_client.config.logger.debug "API called: TransactionsApi#capture_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
78
73
|
end
|
|
79
74
|
return data, status_code, headers
|
|
80
75
|
end
|
|
81
76
|
|
|
82
77
|
# Charge
|
|
83
78
|
# 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.
|
|
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
79
|
# @param location_id The ID of the location to associate the created transaction with.
|
|
86
80
|
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
|
87
81
|
# @param [Hash] opts the optional parameters
|
|
88
82
|
# @return [ChargeResponse]
|
|
89
|
-
def charge(
|
|
90
|
-
data, _status_code, _headers = charge_with_http_info(
|
|
83
|
+
def charge(location_id, body, opts = {})
|
|
84
|
+
data, _status_code, _headers = charge_with_http_info(location_id, body, opts)
|
|
91
85
|
return data
|
|
92
86
|
end
|
|
93
87
|
|
|
94
88
|
# Charge
|
|
95
89
|
# 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.
|
|
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
90
|
# @param location_id The ID of the location to associate the created transaction with.
|
|
98
91
|
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
|
99
92
|
# @param [Hash] opts the optional parameters
|
|
100
93
|
# @return [Array<(ChargeResponse, Fixnum, Hash)>] ChargeResponse data, response status code and response headers
|
|
101
|
-
def charge_with_http_info(
|
|
94
|
+
def charge_with_http_info(location_id, body, opts = {})
|
|
102
95
|
if @api_client.config.debugging
|
|
103
|
-
@api_client.config.logger.debug "Calling API:
|
|
96
|
+
@api_client.config.logger.debug "Calling API: TransactionsApi.charge ..."
|
|
104
97
|
end
|
|
105
|
-
# verify the required parameter 'authorization' is set
|
|
106
|
-
fail ArgumentError, "Missing the required parameter 'authorization' when calling TransactionApi.charge" if authorization.nil?
|
|
107
98
|
# verify the required parameter 'location_id' is set
|
|
108
|
-
fail ArgumentError, "Missing the required parameter 'location_id' when calling
|
|
99
|
+
fail ArgumentError, "Missing the required parameter 'location_id' when calling TransactionsApi.charge" if location_id.nil?
|
|
109
100
|
# verify the required parameter 'body' is set
|
|
110
|
-
fail ArgumentError, "Missing the required parameter 'body' when calling
|
|
101
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling TransactionsApi.charge" if body.nil?
|
|
111
102
|
# resource path
|
|
112
103
|
local_var_path = "/v2/locations/{location_id}/transactions".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)
|
|
113
104
|
|
|
@@ -120,14 +111,13 @@ module SquareConnect
|
|
|
120
111
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
121
112
|
# HTTP header 'Content-Type'
|
|
122
113
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
123
|
-
header_params[:'Authorization'] = authorization
|
|
124
114
|
|
|
125
115
|
# form parameters
|
|
126
116
|
form_params = {}
|
|
127
117
|
|
|
128
118
|
# http body (model)
|
|
129
119
|
post_body = @api_client.object_to_http_body(body)
|
|
130
|
-
auth_names = []
|
|
120
|
+
auth_names = ['oauth2']
|
|
131
121
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
132
122
|
:header_params => header_params,
|
|
133
123
|
:query_params => query_params,
|
|
@@ -136,14 +126,142 @@ module SquareConnect
|
|
|
136
126
|
:auth_names => auth_names,
|
|
137
127
|
:return_type => 'ChargeResponse')
|
|
138
128
|
if @api_client.config.debugging
|
|
139
|
-
@api_client.config.logger.debug "API called:
|
|
129
|
+
@api_client.config.logger.debug "API called: TransactionsApi#charge\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
130
|
+
end
|
|
131
|
+
return data, status_code, headers
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# CreateRefund
|
|
135
|
+
# Initiates a refund for a previously charged tender.
|
|
136
|
+
# @param location_id The ID of the original transaction's associated location.
|
|
137
|
+
# @param transaction_id The ID of the original transaction that includes the tender to refund.
|
|
138
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
|
139
|
+
# @param [Hash] opts the optional parameters
|
|
140
|
+
# @return [CreateRefundResponse]
|
|
141
|
+
def create_refund(location_id, transaction_id, body, opts = {})
|
|
142
|
+
data, _status_code, _headers = create_refund_with_http_info(location_id, transaction_id, body, opts)
|
|
143
|
+
return data
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# CreateRefund
|
|
147
|
+
# Initiates a refund for a previously charged tender.
|
|
148
|
+
# @param location_id The ID of the original transaction's associated location.
|
|
149
|
+
# @param transaction_id The ID of the original transaction that includes the tender to refund.
|
|
150
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
|
151
|
+
# @param [Hash] opts the optional parameters
|
|
152
|
+
# @return [Array<(CreateRefundResponse, Fixnum, Hash)>] CreateRefundResponse data, response status code and response headers
|
|
153
|
+
def create_refund_with_http_info(location_id, transaction_id, body, opts = {})
|
|
154
|
+
if @api_client.config.debugging
|
|
155
|
+
@api_client.config.logger.debug "Calling API: TransactionsApi.create_refund ..."
|
|
156
|
+
end
|
|
157
|
+
# verify the required parameter 'location_id' is set
|
|
158
|
+
fail ArgumentError, "Missing the required parameter 'location_id' when calling TransactionsApi.create_refund" if location_id.nil?
|
|
159
|
+
# verify the required parameter 'transaction_id' is set
|
|
160
|
+
fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TransactionsApi.create_refund" if transaction_id.nil?
|
|
161
|
+
# verify the required parameter 'body' is set
|
|
162
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling TransactionsApi.create_refund" if body.nil?
|
|
163
|
+
# resource path
|
|
164
|
+
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)
|
|
165
|
+
|
|
166
|
+
# query parameters
|
|
167
|
+
query_params = {}
|
|
168
|
+
|
|
169
|
+
# header parameters
|
|
170
|
+
header_params = {}
|
|
171
|
+
# HTTP header 'Accept' (if needed)
|
|
172
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
173
|
+
# HTTP header 'Content-Type'
|
|
174
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
175
|
+
|
|
176
|
+
# form parameters
|
|
177
|
+
form_params = {}
|
|
178
|
+
|
|
179
|
+
# http body (model)
|
|
180
|
+
post_body = @api_client.object_to_http_body(body)
|
|
181
|
+
auth_names = ['oauth2']
|
|
182
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
183
|
+
:header_params => header_params,
|
|
184
|
+
:query_params => query_params,
|
|
185
|
+
:form_params => form_params,
|
|
186
|
+
:body => post_body,
|
|
187
|
+
:auth_names => auth_names,
|
|
188
|
+
:return_type => 'CreateRefundResponse')
|
|
189
|
+
if @api_client.config.debugging
|
|
190
|
+
@api_client.config.logger.debug "API called: TransactionsApi#create_refund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
191
|
+
end
|
|
192
|
+
return data, status_code, headers
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# ListRefunds
|
|
196
|
+
# 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
|
|
197
|
+
# @param location_id The ID of the location to list refunds for.
|
|
198
|
+
# @param [Hash] opts the optional parameters
|
|
199
|
+
# @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.
|
|
200
|
+
# @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.
|
|
201
|
+
# @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`
|
|
202
|
+
# @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.
|
|
203
|
+
# @return [ListRefundsResponse]
|
|
204
|
+
def list_refunds(location_id, opts = {})
|
|
205
|
+
data, _status_code, _headers = list_refunds_with_http_info(location_id, opts)
|
|
206
|
+
return data
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# ListRefunds
|
|
210
|
+
# 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
|
|
211
|
+
# @param location_id The ID of the location to list refunds for.
|
|
212
|
+
# @param [Hash] opts the optional parameters
|
|
213
|
+
# @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.
|
|
214
|
+
# @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.
|
|
215
|
+
# @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`
|
|
216
|
+
# @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.
|
|
217
|
+
# @return [Array<(ListRefundsResponse, Fixnum, Hash)>] ListRefundsResponse data, response status code and response headers
|
|
218
|
+
def list_refunds_with_http_info(location_id, opts = {})
|
|
219
|
+
if @api_client.config.debugging
|
|
220
|
+
@api_client.config.logger.debug "Calling API: TransactionsApi.list_refunds ..."
|
|
221
|
+
end
|
|
222
|
+
# verify the required parameter 'location_id' is set
|
|
223
|
+
fail ArgumentError, "Missing the required parameter 'location_id' when calling TransactionsApi.list_refunds" if location_id.nil?
|
|
224
|
+
if opts[:'sort_order'] && !['DESC', 'ASC'].include?(opts[:'sort_order'])
|
|
225
|
+
fail ArgumentError, 'invalid value for "sort_order", must be one of DESC, ASC'
|
|
226
|
+
end
|
|
227
|
+
# resource path
|
|
228
|
+
local_var_path = "/v2/locations/{location_id}/refunds".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)
|
|
229
|
+
|
|
230
|
+
# query parameters
|
|
231
|
+
query_params = {}
|
|
232
|
+
query_params[:'begin_time'] = opts[:'begin_time'] if !opts[:'begin_time'].nil?
|
|
233
|
+
query_params[:'end_time'] = opts[:'end_time'] if !opts[:'end_time'].nil?
|
|
234
|
+
query_params[:'sort_order'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
|
|
235
|
+
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
|
236
|
+
|
|
237
|
+
# header parameters
|
|
238
|
+
header_params = {}
|
|
239
|
+
# HTTP header 'Accept' (if needed)
|
|
240
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
241
|
+
# HTTP header 'Content-Type'
|
|
242
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
243
|
+
|
|
244
|
+
# form parameters
|
|
245
|
+
form_params = {}
|
|
246
|
+
|
|
247
|
+
# http body (model)
|
|
248
|
+
post_body = nil
|
|
249
|
+
auth_names = ['oauth2']
|
|
250
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
251
|
+
:header_params => header_params,
|
|
252
|
+
:query_params => query_params,
|
|
253
|
+
:form_params => form_params,
|
|
254
|
+
:body => post_body,
|
|
255
|
+
:auth_names => auth_names,
|
|
256
|
+
:return_type => 'ListRefundsResponse')
|
|
257
|
+
if @api_client.config.debugging
|
|
258
|
+
@api_client.config.logger.debug "API called: TransactionsApi#list_refunds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
140
259
|
end
|
|
141
260
|
return data, status_code, headers
|
|
142
261
|
end
|
|
143
262
|
|
|
144
263
|
# ListTransactions
|
|
145
264
|
# Lists transactions for a particular location. Max results per [page](#paginatingresults): 50
|
|
146
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
147
265
|
# @param location_id The ID of the location to list transactions for.
|
|
148
266
|
# @param [Hash] opts the optional parameters
|
|
149
267
|
# @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.
|
|
@@ -151,14 +269,13 @@ module SquareConnect
|
|
|
151
269
|
# @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`
|
|
152
270
|
# @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.
|
|
153
271
|
# @return [ListTransactionsResponse]
|
|
154
|
-
def list_transactions(
|
|
155
|
-
data, _status_code, _headers = list_transactions_with_http_info(
|
|
272
|
+
def list_transactions(location_id, opts = {})
|
|
273
|
+
data, _status_code, _headers = list_transactions_with_http_info(location_id, opts)
|
|
156
274
|
return data
|
|
157
275
|
end
|
|
158
276
|
|
|
159
277
|
# ListTransactions
|
|
160
278
|
# Lists transactions for a particular location. Max results per [page](#paginatingresults): 50
|
|
161
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
162
279
|
# @param location_id The ID of the location to list transactions for.
|
|
163
280
|
# @param [Hash] opts the optional parameters
|
|
164
281
|
# @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.
|
|
@@ -166,14 +283,12 @@ module SquareConnect
|
|
|
166
283
|
# @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`
|
|
167
284
|
# @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.
|
|
168
285
|
# @return [Array<(ListTransactionsResponse, Fixnum, Hash)>] ListTransactionsResponse data, response status code and response headers
|
|
169
|
-
def list_transactions_with_http_info(
|
|
286
|
+
def list_transactions_with_http_info(location_id, opts = {})
|
|
170
287
|
if @api_client.config.debugging
|
|
171
|
-
@api_client.config.logger.debug "Calling API:
|
|
288
|
+
@api_client.config.logger.debug "Calling API: TransactionsApi.list_transactions ..."
|
|
172
289
|
end
|
|
173
|
-
# verify the required parameter 'authorization' is set
|
|
174
|
-
fail ArgumentError, "Missing the required parameter 'authorization' when calling TransactionApi.list_transactions" if authorization.nil?
|
|
175
290
|
# verify the required parameter 'location_id' is set
|
|
176
|
-
fail ArgumentError, "Missing the required parameter 'location_id' when calling
|
|
291
|
+
fail ArgumentError, "Missing the required parameter 'location_id' when calling TransactionsApi.list_transactions" if location_id.nil?
|
|
177
292
|
if opts[:'sort_order'] && !['DESC', 'ASC'].include?(opts[:'sort_order'])
|
|
178
293
|
fail ArgumentError, 'invalid value for "sort_order", must be one of DESC, ASC'
|
|
179
294
|
end
|
|
@@ -193,14 +308,13 @@ module SquareConnect
|
|
|
193
308
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
194
309
|
# HTTP header 'Content-Type'
|
|
195
310
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
196
|
-
header_params[:'Authorization'] = authorization
|
|
197
311
|
|
|
198
312
|
# form parameters
|
|
199
313
|
form_params = {}
|
|
200
314
|
|
|
201
315
|
# http body (model)
|
|
202
316
|
post_body = nil
|
|
203
|
-
auth_names = []
|
|
317
|
+
auth_names = ['oauth2']
|
|
204
318
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
205
319
|
:header_params => header_params,
|
|
206
320
|
:query_params => query_params,
|
|
@@ -209,40 +323,36 @@ module SquareConnect
|
|
|
209
323
|
:auth_names => auth_names,
|
|
210
324
|
:return_type => 'ListTransactionsResponse')
|
|
211
325
|
if @api_client.config.debugging
|
|
212
|
-
@api_client.config.logger.debug "API called:
|
|
326
|
+
@api_client.config.logger.debug "API called: TransactionsApi#list_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
213
327
|
end
|
|
214
328
|
return data, status_code, headers
|
|
215
329
|
end
|
|
216
330
|
|
|
217
331
|
# RetrieveTransaction
|
|
218
332
|
# Retrieves details for a single transaction.
|
|
219
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
220
333
|
# @param location_id The ID of the transaction's associated location.
|
|
221
334
|
# @param transaction_id The ID of the transaction to retrieve.
|
|
222
335
|
# @param [Hash] opts the optional parameters
|
|
223
336
|
# @return [RetrieveTransactionResponse]
|
|
224
|
-
def retrieve_transaction(
|
|
225
|
-
data, _status_code, _headers = retrieve_transaction_with_http_info(
|
|
337
|
+
def retrieve_transaction(location_id, transaction_id, opts = {})
|
|
338
|
+
data, _status_code, _headers = retrieve_transaction_with_http_info(location_id, transaction_id, opts)
|
|
226
339
|
return data
|
|
227
340
|
end
|
|
228
341
|
|
|
229
342
|
# RetrieveTransaction
|
|
230
343
|
# Retrieves details for a single transaction.
|
|
231
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
232
344
|
# @param location_id The ID of the transaction's associated location.
|
|
233
345
|
# @param transaction_id The ID of the transaction to retrieve.
|
|
234
346
|
# @param [Hash] opts the optional parameters
|
|
235
347
|
# @return [Array<(RetrieveTransactionResponse, Fixnum, Hash)>] RetrieveTransactionResponse data, response status code and response headers
|
|
236
|
-
def retrieve_transaction_with_http_info(
|
|
348
|
+
def retrieve_transaction_with_http_info(location_id, transaction_id, opts = {})
|
|
237
349
|
if @api_client.config.debugging
|
|
238
|
-
@api_client.config.logger.debug "Calling API:
|
|
350
|
+
@api_client.config.logger.debug "Calling API: TransactionsApi.retrieve_transaction ..."
|
|
239
351
|
end
|
|
240
|
-
# verify the required parameter 'authorization' is set
|
|
241
|
-
fail ArgumentError, "Missing the required parameter 'authorization' when calling TransactionApi.retrieve_transaction" if authorization.nil?
|
|
242
352
|
# verify the required parameter 'location_id' is set
|
|
243
|
-
fail ArgumentError, "Missing the required parameter 'location_id' when calling
|
|
353
|
+
fail ArgumentError, "Missing the required parameter 'location_id' when calling TransactionsApi.retrieve_transaction" if location_id.nil?
|
|
244
354
|
# verify the required parameter 'transaction_id' is set
|
|
245
|
-
fail ArgumentError, "Missing the required parameter 'transaction_id' when calling
|
|
355
|
+
fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TransactionsApi.retrieve_transaction" if transaction_id.nil?
|
|
246
356
|
# resource path
|
|
247
357
|
local_var_path = "/v2/locations/{location_id}/transactions/{transaction_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'transaction_id' + '}', transaction_id.to_s)
|
|
248
358
|
|
|
@@ -255,14 +365,13 @@ module SquareConnect
|
|
|
255
365
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
256
366
|
# HTTP header 'Content-Type'
|
|
257
367
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
258
|
-
header_params[:'Authorization'] = authorization
|
|
259
368
|
|
|
260
369
|
# form parameters
|
|
261
370
|
form_params = {}
|
|
262
371
|
|
|
263
372
|
# http body (model)
|
|
264
373
|
post_body = nil
|
|
265
|
-
auth_names = []
|
|
374
|
+
auth_names = ['oauth2']
|
|
266
375
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
267
376
|
:header_params => header_params,
|
|
268
377
|
:query_params => query_params,
|
|
@@ -271,40 +380,36 @@ module SquareConnect
|
|
|
271
380
|
:auth_names => auth_names,
|
|
272
381
|
:return_type => 'RetrieveTransactionResponse')
|
|
273
382
|
if @api_client.config.debugging
|
|
274
|
-
@api_client.config.logger.debug "API called:
|
|
383
|
+
@api_client.config.logger.debug "API called: TransactionsApi#retrieve_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
275
384
|
end
|
|
276
385
|
return data, status_code, headers
|
|
277
386
|
end
|
|
278
387
|
|
|
279
388
|
# VoidTransaction
|
|
280
389
|
# 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.
|
|
281
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
282
390
|
# @param location_id
|
|
283
391
|
# @param transaction_id
|
|
284
392
|
# @param [Hash] opts the optional parameters
|
|
285
393
|
# @return [VoidTransactionResponse]
|
|
286
|
-
def void_transaction(
|
|
287
|
-
data, _status_code, _headers = void_transaction_with_http_info(
|
|
394
|
+
def void_transaction(location_id, transaction_id, opts = {})
|
|
395
|
+
data, _status_code, _headers = void_transaction_with_http_info(location_id, transaction_id, opts)
|
|
288
396
|
return data
|
|
289
397
|
end
|
|
290
398
|
|
|
291
399
|
# VoidTransaction
|
|
292
400
|
# 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.
|
|
293
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
|
294
401
|
# @param location_id
|
|
295
402
|
# @param transaction_id
|
|
296
403
|
# @param [Hash] opts the optional parameters
|
|
297
404
|
# @return [Array<(VoidTransactionResponse, Fixnum, Hash)>] VoidTransactionResponse data, response status code and response headers
|
|
298
|
-
def void_transaction_with_http_info(
|
|
405
|
+
def void_transaction_with_http_info(location_id, transaction_id, opts = {})
|
|
299
406
|
if @api_client.config.debugging
|
|
300
|
-
@api_client.config.logger.debug "Calling API:
|
|
407
|
+
@api_client.config.logger.debug "Calling API: TransactionsApi.void_transaction ..."
|
|
301
408
|
end
|
|
302
|
-
# verify the required parameter 'authorization' is set
|
|
303
|
-
fail ArgumentError, "Missing the required parameter 'authorization' when calling TransactionApi.void_transaction" if authorization.nil?
|
|
304
409
|
# verify the required parameter 'location_id' is set
|
|
305
|
-
fail ArgumentError, "Missing the required parameter 'location_id' when calling
|
|
410
|
+
fail ArgumentError, "Missing the required parameter 'location_id' when calling TransactionsApi.void_transaction" if location_id.nil?
|
|
306
411
|
# verify the required parameter 'transaction_id' is set
|
|
307
|
-
fail ArgumentError, "Missing the required parameter 'transaction_id' when calling
|
|
412
|
+
fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TransactionsApi.void_transaction" if transaction_id.nil?
|
|
308
413
|
# resource path
|
|
309
414
|
local_var_path = "/v2/locations/{location_id}/transactions/{transaction_id}/void".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'transaction_id' + '}', transaction_id.to_s)
|
|
310
415
|
|
|
@@ -317,14 +422,13 @@ module SquareConnect
|
|
|
317
422
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
318
423
|
# HTTP header 'Content-Type'
|
|
319
424
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
320
|
-
header_params[:'Authorization'] = authorization
|
|
321
425
|
|
|
322
426
|
# form parameters
|
|
323
427
|
form_params = {}
|
|
324
428
|
|
|
325
429
|
# http body (model)
|
|
326
430
|
post_body = nil
|
|
327
|
-
auth_names = []
|
|
431
|
+
auth_names = ['oauth2']
|
|
328
432
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
329
433
|
:header_params => header_params,
|
|
330
434
|
:query_params => query_params,
|
|
@@ -333,7 +437,7 @@ module SquareConnect
|
|
|
333
437
|
:auth_names => auth_names,
|
|
334
438
|
:return_type => 'VoidTransactionResponse')
|
|
335
439
|
if @api_client.config.debugging
|
|
336
|
-
@api_client.config.logger.debug "API called:
|
|
440
|
+
@api_client.config.logger.debug "API called: TransactionsApi#void_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
337
441
|
end
|
|
338
442
|
return data, status_code, headers
|
|
339
443
|
end
|