square_connect 2.0.2.69 → 2.1.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -0,0 +1,11 @@
|
|
1
|
+
# SquareConnect::V1UpdateModifierListRequest
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
## Properties
|
6
|
+
Name | Type | Description | Notes
|
7
|
+
------------ | ------------- | ------------- | -------------
|
8
|
+
**name** | **String** | The modifier list's name. | [optional]
|
9
|
+
**selection_type** | **String** | Indicates whether multiple options from the modifier list can be applied to a single item. | [optional]
|
10
|
+
|
11
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# SquareConnect::V1UpdateOrderRequest
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
## Properties
|
6
|
+
Name | Type | Description | Notes
|
7
|
+
------------ | ------------- | ------------- | -------------
|
8
|
+
**action** | **String** | The action to perform on the order (COMPLETE, CANCEL, or REFUND). |
|
9
|
+
**shipped_tracking_number** | **String** | The tracking number of the shipment associated with the order. Only valid if action is COMPLETE. | [optional]
|
10
|
+
**completed_note** | **String** | A merchant-specified note about the completion of the order. Only valid if action is COMPLETE. | [optional]
|
11
|
+
**refunded_note** | **String** | A merchant-specified note about the refunding of the order. Only valid if action is REFUND. | [optional]
|
12
|
+
**canceled_note** | **String** | A merchant-specified note about the canceling of the order. Only valid if action is CANCEL. | [optional]
|
13
|
+
|
14
|
+
|
data/docs/V1Variation.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# SquareConnect::V1Variation
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
## Properties
|
6
|
+
Name | Type | Description | Notes
|
7
|
+
------------ | ------------- | ------------- | -------------
|
8
|
+
**id** | **String** | The item variation's unique ID. | [optional]
|
9
|
+
**name** | **String** | The item variation's name. | [optional]
|
10
|
+
**item_id** | **String** | The ID of the variation's associated item. | [optional]
|
11
|
+
**ordinal** | **String** | ndicates the variation's list position when displayed in Square Register and the merchant dashboard. If more than one variation for the same item has the same ordinal value, those variations are displayed in alphabetical order | [optional]
|
12
|
+
**pricing_type** | **String** | Indicates whether the item variation's price is fixed or determined at the time of sale. | [optional]
|
13
|
+
**price_money** | [**V1Money**](V1Money.md) | The item variation's price, if any. | [optional]
|
14
|
+
**sku** | **String** | The item variation's SKU, if any. | [optional]
|
15
|
+
**track_inventory** | **BOOLEAN** | If true, inventory tracking is active for the variation. | [optional]
|
16
|
+
**inventory_alert_type** | **String** | Indicates whether the item variation displays an alert when its inventory quantity is less than or equal to its inventory_alert_threshold. | [optional]
|
17
|
+
**inventory_alert_threshold** | **Integer** | If the inventory quantity for the variation is less than or equal to this value and inventory_alert_type is LOW_QUANTITY, the variation displays an alert in the merchant dashboard. | [optional]
|
18
|
+
**user_data** | **String** | Arbitrary metadata associated with the variation. Cannot exceed 255 characters. | [optional]
|
19
|
+
|
20
|
+
|
data/lib/.DS_Store
ADDED
Binary file
|
data/lib/square_connect.rb
CHANGED
@@ -42,6 +42,7 @@ require 'square_connect/models/delete_customer_card_request'
|
|
42
42
|
require 'square_connect/models/delete_customer_card_response'
|
43
43
|
require 'square_connect/models/delete_customer_request'
|
44
44
|
require 'square_connect/models/delete_customer_response'
|
45
|
+
require 'square_connect/models/device'
|
45
46
|
require 'square_connect/models/error'
|
46
47
|
require 'square_connect/models/error_category'
|
47
48
|
require 'square_connect/models/error_code'
|
@@ -75,16 +76,56 @@ require 'square_connect/models/transaction'
|
|
75
76
|
require 'square_connect/models/transaction_product'
|
76
77
|
require 'square_connect/models/update_customer_request'
|
77
78
|
require 'square_connect/models/update_customer_response'
|
79
|
+
require 'square_connect/models/v1_adjust_inventory_request'
|
80
|
+
require 'square_connect/models/v1_bank_account'
|
81
|
+
require 'square_connect/models/v1_cash_drawer_event'
|
82
|
+
require 'square_connect/models/v1_cash_drawer_shift'
|
83
|
+
require 'square_connect/models/v1_category'
|
84
|
+
require 'square_connect/models/v1_create_refund_request'
|
85
|
+
require 'square_connect/models/v1_discount'
|
86
|
+
require 'square_connect/models/v1_employee'
|
87
|
+
require 'square_connect/models/v1_employee_role'
|
88
|
+
require 'square_connect/models/v1_fee'
|
89
|
+
require 'square_connect/models/v1_inventory_entry'
|
90
|
+
require 'square_connect/models/v1_item'
|
91
|
+
require 'square_connect/models/v1_item_image'
|
92
|
+
require 'square_connect/models/v1_merchant'
|
93
|
+
require 'square_connect/models/v1_merchant_location_details'
|
94
|
+
require 'square_connect/models/v1_modifier_list'
|
95
|
+
require 'square_connect/models/v1_modifier_option'
|
96
|
+
require 'square_connect/models/v1_money'
|
97
|
+
require 'square_connect/models/v1_order'
|
98
|
+
require 'square_connect/models/v1_order_history_entry'
|
99
|
+
require 'square_connect/models/v1_page'
|
100
|
+
require 'square_connect/models/v1_page_cell'
|
101
|
+
require 'square_connect/models/v1_payment'
|
102
|
+
require 'square_connect/models/v1_payment_discount'
|
103
|
+
require 'square_connect/models/v1_payment_item_detail'
|
104
|
+
require 'square_connect/models/v1_payment_itemization'
|
105
|
+
require 'square_connect/models/v1_payment_modifier'
|
106
|
+
require 'square_connect/models/v1_payment_tax'
|
107
|
+
require 'square_connect/models/v1_phone_number'
|
108
|
+
require 'square_connect/models/v1_refund'
|
109
|
+
require 'square_connect/models/v1_settlement'
|
110
|
+
require 'square_connect/models/v1_settlement_entry'
|
111
|
+
require 'square_connect/models/v1_tender'
|
112
|
+
require 'square_connect/models/v1_timecard'
|
113
|
+
require 'square_connect/models/v1_timecard_event'
|
114
|
+
require 'square_connect/models/v1_update_modifier_list_request'
|
115
|
+
require 'square_connect/models/v1_update_order_request'
|
116
|
+
require 'square_connect/models/v1_variation'
|
78
117
|
require 'square_connect/models/void_transaction_request'
|
79
118
|
require 'square_connect/models/void_transaction_response'
|
80
119
|
|
81
120
|
# APIs
|
82
121
|
require 'square_connect/api/checkout_api'
|
83
|
-
require 'square_connect/api/
|
84
|
-
require 'square_connect/api/
|
85
|
-
require 'square_connect/api/
|
86
|
-
require 'square_connect/api/
|
87
|
-
require 'square_connect/api/
|
122
|
+
require 'square_connect/api/customers_api'
|
123
|
+
require 'square_connect/api/locations_api'
|
124
|
+
require 'square_connect/api/transactions_api'
|
125
|
+
require 'square_connect/api/v1_employees_api'
|
126
|
+
require 'square_connect/api/v1_items_api'
|
127
|
+
require 'square_connect/api/v1_locations_api'
|
128
|
+
require 'square_connect/api/v1_transactions_api'
|
88
129
|
|
89
130
|
module SquareConnect
|
90
131
|
class << self
|
Binary file
|
@@ -19,29 +19,25 @@ module SquareConnect
|
|
19
19
|
|
20
20
|
# CreateCheckout
|
21
21
|
# Creates a [Checkout](#type-checkout) response that links a `checkoutId` and `checkout_page_url` that customers can be directed to in order to provide their payment information using a payment processing workflow hosted on connect.squareup.com.
|
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 The ID of the business location to associate the checkout with.
|
24
23
|
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
25
24
|
# @param [Hash] opts the optional parameters
|
26
25
|
# @return [CreateCheckoutResponse]
|
27
|
-
def create_checkout(
|
28
|
-
data, _status_code, _headers = create_checkout_with_http_info(
|
26
|
+
def create_checkout(location_id, body, opts = {})
|
27
|
+
data, _status_code, _headers = create_checkout_with_http_info(location_id, body, opts)
|
29
28
|
return data
|
30
29
|
end
|
31
30
|
|
32
31
|
# CreateCheckout
|
33
32
|
# Creates a [Checkout](#type-checkout) response that links a `checkoutId` and `checkout_page_url` that customers can be directed to in order to provide their payment information using a payment processing workflow hosted on connect.squareup.com.
|
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 The ID of the business location to associate the checkout with.
|
36
34
|
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
37
35
|
# @param [Hash] opts the optional parameters
|
38
36
|
# @return [Array<(CreateCheckoutResponse, Fixnum, Hash)>] CreateCheckoutResponse data, response status code and response headers
|
39
|
-
def create_checkout_with_http_info(
|
37
|
+
def create_checkout_with_http_info(location_id, body, opts = {})
|
40
38
|
if @api_client.config.debugging
|
41
39
|
@api_client.config.logger.debug "Calling API: CheckoutApi.create_checkout ..."
|
42
40
|
end
|
43
|
-
# verify the required parameter 'authorization' is set
|
44
|
-
fail ArgumentError, "Missing the required parameter 'authorization' when calling CheckoutApi.create_checkout" if authorization.nil?
|
45
41
|
# verify the required parameter 'location_id' is set
|
46
42
|
fail ArgumentError, "Missing the required parameter 'location_id' when calling CheckoutApi.create_checkout" if location_id.nil?
|
47
43
|
# verify the required parameter 'body' is set
|
@@ -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 = @api_client.object_to_http_body(body)
|
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,
|
@@ -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 CustomersApi
|
14
14
|
attr_accessor :api_client
|
15
15
|
|
16
16
|
def initialize(api_client = ApiClient.default)
|
@@ -19,29 +19,25 @@ module SquareConnect
|
|
19
19
|
|
20
20
|
# CreateCustomer
|
21
21
|
# Creates a new customer for a business, which can have associated cards on file. You must provide __at least one__ of the following values in your request to this endpoint: - `given_name` - `family_name` - `company_name` - `email_address` - `phone_number` This endpoint does not accept an idempotency key. If you accidentally create a duplicate customer, you can delete it with the [DeleteCustomer](#endpoint-deletecustomer) endpoint.
|
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 body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
24
23
|
# @param [Hash] opts the optional parameters
|
25
24
|
# @return [CreateCustomerResponse]
|
26
|
-
def create_customer(
|
27
|
-
data, _status_code, _headers = create_customer_with_http_info(
|
25
|
+
def create_customer(body, opts = {})
|
26
|
+
data, _status_code, _headers = create_customer_with_http_info(body, opts)
|
28
27
|
return data
|
29
28
|
end
|
30
29
|
|
31
30
|
# CreateCustomer
|
32
31
|
# Creates a new customer for a business, which can have associated cards on file. You must provide __at least one__ of the following values in your request to this endpoint: - `given_name` - `family_name` - `company_name` - `email_address` - `phone_number` This endpoint does not accept an idempotency key. If you accidentally create a duplicate customer, you can delete it with the [DeleteCustomer](#endpoint-deletecustomer) endpoint.
|
33
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
34
32
|
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
35
33
|
# @param [Hash] opts the optional parameters
|
36
34
|
# @return [Array<(CreateCustomerResponse, Fixnum, Hash)>] CreateCustomerResponse data, response status code and response headers
|
37
|
-
def create_customer_with_http_info(
|
35
|
+
def create_customer_with_http_info(body, opts = {})
|
38
36
|
if @api_client.config.debugging
|
39
|
-
@api_client.config.logger.debug "Calling API:
|
37
|
+
@api_client.config.logger.debug "Calling API: CustomersApi.create_customer ..."
|
40
38
|
end
|
41
|
-
# verify the required parameter 'authorization' is set
|
42
|
-
fail ArgumentError, "Missing the required parameter 'authorization' when calling CustomerApi.create_customer" if authorization.nil?
|
43
39
|
# verify the required parameter 'body' is set
|
44
|
-
fail ArgumentError, "Missing the required parameter 'body' when calling
|
40
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling CustomersApi.create_customer" if body.nil?
|
45
41
|
# resource path
|
46
42
|
local_var_path = "/v2/customers".sub('{format}','json')
|
47
43
|
|
@@ -54,14 +50,13 @@ module SquareConnect
|
|
54
50
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
51
|
# HTTP header 'Content-Type'
|
56
52
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
57
|
-
header_params[:'Authorization'] = authorization
|
58
53
|
|
59
54
|
# form parameters
|
60
55
|
form_params = {}
|
61
56
|
|
62
57
|
# http body (model)
|
63
58
|
post_body = @api_client.object_to_http_body(body)
|
64
|
-
auth_names = []
|
59
|
+
auth_names = ['oauth2']
|
65
60
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
66
61
|
:header_params => header_params,
|
67
62
|
:query_params => query_params,
|
@@ -70,36 +65,89 @@ module SquareConnect
|
|
70
65
|
:auth_names => auth_names,
|
71
66
|
:return_type => 'CreateCustomerResponse')
|
72
67
|
if @api_client.config.debugging
|
73
|
-
@api_client.config.logger.debug "API called:
|
68
|
+
@api_client.config.logger.debug "API called: CustomersApi#create_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
69
|
+
end
|
70
|
+
return data, status_code, headers
|
71
|
+
end
|
72
|
+
|
73
|
+
# CreateCustomerCard
|
74
|
+
# Adds a card on file to an existing customer.
|
75
|
+
# @param customer_id The ID of the customer to link the card on file to.
|
76
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
77
|
+
# @param [Hash] opts the optional parameters
|
78
|
+
# @return [CreateCustomerCardResponse]
|
79
|
+
def create_customer_card(customer_id, body, opts = {})
|
80
|
+
data, _status_code, _headers = create_customer_card_with_http_info(customer_id, body, opts)
|
81
|
+
return data
|
82
|
+
end
|
83
|
+
|
84
|
+
# CreateCustomerCard
|
85
|
+
# Adds a card on file to an existing customer.
|
86
|
+
# @param customer_id The ID of the customer to link the card on file to.
|
87
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
88
|
+
# @param [Hash] opts the optional parameters
|
89
|
+
# @return [Array<(CreateCustomerCardResponse, Fixnum, Hash)>] CreateCustomerCardResponse data, response status code and response headers
|
90
|
+
def create_customer_card_with_http_info(customer_id, body, opts = {})
|
91
|
+
if @api_client.config.debugging
|
92
|
+
@api_client.config.logger.debug "Calling API: CustomersApi.create_customer_card ..."
|
93
|
+
end
|
94
|
+
# verify the required parameter 'customer_id' is set
|
95
|
+
fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.create_customer_card" if customer_id.nil?
|
96
|
+
# verify the required parameter 'body' is set
|
97
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling CustomersApi.create_customer_card" if body.nil?
|
98
|
+
# resource path
|
99
|
+
local_var_path = "/v2/customers/{customer_id}/cards".sub('{format}','json').sub('{' + 'customer_id' + '}', customer_id.to_s)
|
100
|
+
|
101
|
+
# query parameters
|
102
|
+
query_params = {}
|
103
|
+
|
104
|
+
# header parameters
|
105
|
+
header_params = {}
|
106
|
+
# HTTP header 'Accept' (if needed)
|
107
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
108
|
+
# HTTP header 'Content-Type'
|
109
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
110
|
+
|
111
|
+
# form parameters
|
112
|
+
form_params = {}
|
113
|
+
|
114
|
+
# http body (model)
|
115
|
+
post_body = @api_client.object_to_http_body(body)
|
116
|
+
auth_names = ['oauth2']
|
117
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
118
|
+
:header_params => header_params,
|
119
|
+
:query_params => query_params,
|
120
|
+
:form_params => form_params,
|
121
|
+
:body => post_body,
|
122
|
+
:auth_names => auth_names,
|
123
|
+
:return_type => 'CreateCustomerCardResponse')
|
124
|
+
if @api_client.config.debugging
|
125
|
+
@api_client.config.logger.debug "API called: CustomersApi#create_customer_card\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
74
126
|
end
|
75
127
|
return data, status_code, headers
|
76
128
|
end
|
77
129
|
|
78
130
|
# DeleteCustomer
|
79
131
|
# Deletes a customer from a business, along with any linked cards on file.
|
80
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
81
132
|
# @param customer_id The ID of the customer to delete.
|
82
133
|
# @param [Hash] opts the optional parameters
|
83
134
|
# @return [DeleteCustomerResponse]
|
84
|
-
def delete_customer(
|
85
|
-
data, _status_code, _headers = delete_customer_with_http_info(
|
135
|
+
def delete_customer(customer_id, opts = {})
|
136
|
+
data, _status_code, _headers = delete_customer_with_http_info(customer_id, opts)
|
86
137
|
return data
|
87
138
|
end
|
88
139
|
|
89
140
|
# DeleteCustomer
|
90
141
|
# Deletes a customer from a business, along with any linked cards on file.
|
91
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
92
142
|
# @param customer_id The ID of the customer to delete.
|
93
143
|
# @param [Hash] opts the optional parameters
|
94
144
|
# @return [Array<(DeleteCustomerResponse, Fixnum, Hash)>] DeleteCustomerResponse data, response status code and response headers
|
95
|
-
def delete_customer_with_http_info(
|
145
|
+
def delete_customer_with_http_info(customer_id, opts = {})
|
96
146
|
if @api_client.config.debugging
|
97
|
-
@api_client.config.logger.debug "Calling API:
|
147
|
+
@api_client.config.logger.debug "Calling API: CustomersApi.delete_customer ..."
|
98
148
|
end
|
99
|
-
# verify the required parameter 'authorization' is set
|
100
|
-
fail ArgumentError, "Missing the required parameter 'authorization' when calling CustomerApi.delete_customer" if authorization.nil?
|
101
149
|
# verify the required parameter 'customer_id' is set
|
102
|
-
fail ArgumentError, "Missing the required parameter 'customer_id' when calling
|
150
|
+
fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.delete_customer" if customer_id.nil?
|
103
151
|
# resource path
|
104
152
|
local_var_path = "/v2/customers/{customer_id}".sub('{format}','json').sub('{' + 'customer_id' + '}', customer_id.to_s)
|
105
153
|
|
@@ -112,14 +160,13 @@ module SquareConnect
|
|
112
160
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
113
161
|
# HTTP header 'Content-Type'
|
114
162
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
115
|
-
header_params[:'Authorization'] = authorization
|
116
163
|
|
117
164
|
# form parameters
|
118
165
|
form_params = {}
|
119
166
|
|
120
167
|
# http body (model)
|
121
168
|
post_body = nil
|
122
|
-
auth_names = []
|
169
|
+
auth_names = ['oauth2']
|
123
170
|
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
124
171
|
:header_params => header_params,
|
125
172
|
:query_params => query_params,
|
@@ -128,34 +175,87 @@ module SquareConnect
|
|
128
175
|
:auth_names => auth_names,
|
129
176
|
:return_type => 'DeleteCustomerResponse')
|
130
177
|
if @api_client.config.debugging
|
131
|
-
@api_client.config.logger.debug "API called:
|
178
|
+
@api_client.config.logger.debug "API called: CustomersApi#delete_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
179
|
+
end
|
180
|
+
return data, status_code, headers
|
181
|
+
end
|
182
|
+
|
183
|
+
# DeleteCustomerCard
|
184
|
+
# Removes a card on file from a customer.
|
185
|
+
# @param customer_id The ID of the customer that the card on file belongs to.
|
186
|
+
# @param card_id The ID of the card on file to delete.
|
187
|
+
# @param [Hash] opts the optional parameters
|
188
|
+
# @return [DeleteCustomerCardResponse]
|
189
|
+
def delete_customer_card(customer_id, card_id, opts = {})
|
190
|
+
data, _status_code, _headers = delete_customer_card_with_http_info(customer_id, card_id, opts)
|
191
|
+
return data
|
192
|
+
end
|
193
|
+
|
194
|
+
# DeleteCustomerCard
|
195
|
+
# Removes a card on file from a customer.
|
196
|
+
# @param customer_id The ID of the customer that the card on file belongs to.
|
197
|
+
# @param card_id The ID of the card on file to delete.
|
198
|
+
# @param [Hash] opts the optional parameters
|
199
|
+
# @return [Array<(DeleteCustomerCardResponse, Fixnum, Hash)>] DeleteCustomerCardResponse data, response status code and response headers
|
200
|
+
def delete_customer_card_with_http_info(customer_id, card_id, opts = {})
|
201
|
+
if @api_client.config.debugging
|
202
|
+
@api_client.config.logger.debug "Calling API: CustomersApi.delete_customer_card ..."
|
203
|
+
end
|
204
|
+
# verify the required parameter 'customer_id' is set
|
205
|
+
fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.delete_customer_card" if customer_id.nil?
|
206
|
+
# verify the required parameter 'card_id' is set
|
207
|
+
fail ArgumentError, "Missing the required parameter 'card_id' when calling CustomersApi.delete_customer_card" if card_id.nil?
|
208
|
+
# resource path
|
209
|
+
local_var_path = "/v2/customers/{customer_id}/cards/{card_id}".sub('{format}','json').sub('{' + 'customer_id' + '}', customer_id.to_s).sub('{' + 'card_id' + '}', card_id.to_s)
|
210
|
+
|
211
|
+
# query parameters
|
212
|
+
query_params = {}
|
213
|
+
|
214
|
+
# header parameters
|
215
|
+
header_params = {}
|
216
|
+
# HTTP header 'Accept' (if needed)
|
217
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
218
|
+
# HTTP header 'Content-Type'
|
219
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
220
|
+
|
221
|
+
# form parameters
|
222
|
+
form_params = {}
|
223
|
+
|
224
|
+
# http body (model)
|
225
|
+
post_body = nil
|
226
|
+
auth_names = ['oauth2']
|
227
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
228
|
+
:header_params => header_params,
|
229
|
+
:query_params => query_params,
|
230
|
+
:form_params => form_params,
|
231
|
+
:body => post_body,
|
232
|
+
:auth_names => auth_names,
|
233
|
+
:return_type => 'DeleteCustomerCardResponse')
|
234
|
+
if @api_client.config.debugging
|
235
|
+
@api_client.config.logger.debug "API called: CustomersApi#delete_customer_card\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
132
236
|
end
|
133
237
|
return data, status_code, headers
|
134
238
|
end
|
135
239
|
|
136
240
|
# ListCustomers
|
137
241
|
# Lists a business's customers.
|
138
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
139
242
|
# @param [Hash] opts the optional parameters
|
140
243
|
# @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.
|
141
244
|
# @return [ListCustomersResponse]
|
142
|
-
def list_customers(
|
143
|
-
data, _status_code, _headers = list_customers_with_http_info(
|
245
|
+
def list_customers(opts = {})
|
246
|
+
data, _status_code, _headers = list_customers_with_http_info(opts)
|
144
247
|
return data
|
145
248
|
end
|
146
249
|
|
147
250
|
# ListCustomers
|
148
251
|
# Lists a business's customers.
|
149
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
150
252
|
# @param [Hash] opts the optional parameters
|
151
253
|
# @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.
|
152
254
|
# @return [Array<(ListCustomersResponse, Fixnum, Hash)>] ListCustomersResponse data, response status code and response headers
|
153
|
-
def list_customers_with_http_info(
|
255
|
+
def list_customers_with_http_info(opts = {})
|
154
256
|
if @api_client.config.debugging
|
155
|
-
@api_client.config.logger.debug "Calling API:
|
257
|
+
@api_client.config.logger.debug "Calling API: CustomersApi.list_customers ..."
|
156
258
|
end
|
157
|
-
# verify the required parameter 'authorization' is set
|
158
|
-
fail ArgumentError, "Missing the required parameter 'authorization' when calling CustomerApi.list_customers" if authorization.nil?
|
159
259
|
# resource path
|
160
260
|
local_var_path = "/v2/customers".sub('{format}','json')
|
161
261
|
|
@@ -169,14 +269,13 @@ module SquareConnect
|
|
169
269
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
170
270
|
# HTTP header 'Content-Type'
|
171
271
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
172
|
-
header_params[:'Authorization'] = authorization
|
173
272
|
|
174
273
|
# form parameters
|
175
274
|
form_params = {}
|
176
275
|
|
177
276
|
# http body (model)
|
178
277
|
post_body = nil
|
179
|
-
auth_names = []
|
278
|
+
auth_names = ['oauth2']
|
180
279
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
181
280
|
:header_params => header_params,
|
182
281
|
:query_params => query_params,
|
@@ -185,36 +284,32 @@ module SquareConnect
|
|
185
284
|
:auth_names => auth_names,
|
186
285
|
:return_type => 'ListCustomersResponse')
|
187
286
|
if @api_client.config.debugging
|
188
|
-
@api_client.config.logger.debug "API called:
|
287
|
+
@api_client.config.logger.debug "API called: CustomersApi#list_customers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
189
288
|
end
|
190
289
|
return data, status_code, headers
|
191
290
|
end
|
192
291
|
|
193
292
|
# RetrieveCustomer
|
194
293
|
# Returns details for a single customer.
|
195
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
196
294
|
# @param customer_id The ID of the customer to retrieve.
|
197
295
|
# @param [Hash] opts the optional parameters
|
198
296
|
# @return [RetrieveCustomerResponse]
|
199
|
-
def retrieve_customer(
|
200
|
-
data, _status_code, _headers = retrieve_customer_with_http_info(
|
297
|
+
def retrieve_customer(customer_id, opts = {})
|
298
|
+
data, _status_code, _headers = retrieve_customer_with_http_info(customer_id, opts)
|
201
299
|
return data
|
202
300
|
end
|
203
301
|
|
204
302
|
# RetrieveCustomer
|
205
303
|
# Returns details for a single customer.
|
206
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
207
304
|
# @param customer_id The ID of the customer to retrieve.
|
208
305
|
# @param [Hash] opts the optional parameters
|
209
306
|
# @return [Array<(RetrieveCustomerResponse, Fixnum, Hash)>] RetrieveCustomerResponse data, response status code and response headers
|
210
|
-
def retrieve_customer_with_http_info(
|
307
|
+
def retrieve_customer_with_http_info(customer_id, opts = {})
|
211
308
|
if @api_client.config.debugging
|
212
|
-
@api_client.config.logger.debug "Calling API:
|
309
|
+
@api_client.config.logger.debug "Calling API: CustomersApi.retrieve_customer ..."
|
213
310
|
end
|
214
|
-
# verify the required parameter 'authorization' is set
|
215
|
-
fail ArgumentError, "Missing the required parameter 'authorization' when calling CustomerApi.retrieve_customer" if authorization.nil?
|
216
311
|
# verify the required parameter 'customer_id' is set
|
217
|
-
fail ArgumentError, "Missing the required parameter 'customer_id' when calling
|
312
|
+
fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.retrieve_customer" if customer_id.nil?
|
218
313
|
# resource path
|
219
314
|
local_var_path = "/v2/customers/{customer_id}".sub('{format}','json').sub('{' + 'customer_id' + '}', customer_id.to_s)
|
220
315
|
|
@@ -227,14 +322,13 @@ module SquareConnect
|
|
227
322
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
228
323
|
# HTTP header 'Content-Type'
|
229
324
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
230
|
-
header_params[:'Authorization'] = authorization
|
231
325
|
|
232
326
|
# form parameters
|
233
327
|
form_params = {}
|
234
328
|
|
235
329
|
# http body (model)
|
236
330
|
post_body = nil
|
237
|
-
auth_names = []
|
331
|
+
auth_names = ['oauth2']
|
238
332
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
239
333
|
:header_params => header_params,
|
240
334
|
:query_params => query_params,
|
@@ -243,40 +337,36 @@ module SquareConnect
|
|
243
337
|
:auth_names => auth_names,
|
244
338
|
:return_type => 'RetrieveCustomerResponse')
|
245
339
|
if @api_client.config.debugging
|
246
|
-
@api_client.config.logger.debug "API called:
|
340
|
+
@api_client.config.logger.debug "API called: CustomersApi#retrieve_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
247
341
|
end
|
248
342
|
return data, status_code, headers
|
249
343
|
end
|
250
344
|
|
251
345
|
# UpdateCustomer
|
252
346
|
# Updates the details of an existing customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint.
|
253
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
254
347
|
# @param customer_id The ID of the customer to update.
|
255
348
|
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
256
349
|
# @param [Hash] opts the optional parameters
|
257
350
|
# @return [UpdateCustomerResponse]
|
258
|
-
def update_customer(
|
259
|
-
data, _status_code, _headers = update_customer_with_http_info(
|
351
|
+
def update_customer(customer_id, body, opts = {})
|
352
|
+
data, _status_code, _headers = update_customer_with_http_info(customer_id, body, opts)
|
260
353
|
return data
|
261
354
|
end
|
262
355
|
|
263
356
|
# UpdateCustomer
|
264
357
|
# Updates the details of an existing customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint.
|
265
|
-
# @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
|
266
358
|
# @param customer_id The ID of the customer to update.
|
267
359
|
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
268
360
|
# @param [Hash] opts the optional parameters
|
269
361
|
# @return [Array<(UpdateCustomerResponse, Fixnum, Hash)>] UpdateCustomerResponse data, response status code and response headers
|
270
|
-
def update_customer_with_http_info(
|
362
|
+
def update_customer_with_http_info(customer_id, body, opts = {})
|
271
363
|
if @api_client.config.debugging
|
272
|
-
@api_client.config.logger.debug "Calling API:
|
364
|
+
@api_client.config.logger.debug "Calling API: CustomersApi.update_customer ..."
|
273
365
|
end
|
274
|
-
# verify the required parameter 'authorization' is set
|
275
|
-
fail ArgumentError, "Missing the required parameter 'authorization' when calling CustomerApi.update_customer" if authorization.nil?
|
276
366
|
# verify the required parameter 'customer_id' is set
|
277
|
-
fail ArgumentError, "Missing the required parameter 'customer_id' when calling
|
367
|
+
fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.update_customer" if customer_id.nil?
|
278
368
|
# verify the required parameter 'body' is set
|
279
|
-
fail ArgumentError, "Missing the required parameter 'body' when calling
|
369
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling CustomersApi.update_customer" if body.nil?
|
280
370
|
# resource path
|
281
371
|
local_var_path = "/v2/customers/{customer_id}".sub('{format}','json').sub('{' + 'customer_id' + '}', customer_id.to_s)
|
282
372
|
|
@@ -289,14 +379,13 @@ module SquareConnect
|
|
289
379
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
290
380
|
# HTTP header 'Content-Type'
|
291
381
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
292
|
-
header_params[:'Authorization'] = authorization
|
293
382
|
|
294
383
|
# form parameters
|
295
384
|
form_params = {}
|
296
385
|
|
297
386
|
# http body (model)
|
298
387
|
post_body = @api_client.object_to_http_body(body)
|
299
|
-
auth_names = []
|
388
|
+
auth_names = ['oauth2']
|
300
389
|
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
301
390
|
:header_params => header_params,
|
302
391
|
:query_params => query_params,
|
@@ -305,7 +394,7 @@ module SquareConnect
|
|
305
394
|
:auth_names => auth_names,
|
306
395
|
:return_type => 'UpdateCustomerResponse')
|
307
396
|
if @api_client.config.debugging
|
308
|
-
@api_client.config.logger.debug "API called:
|
397
|
+
@api_client.config.logger.debug "API called: CustomersApi#update_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
309
398
|
end
|
310
399
|
return data, status_code, headers
|
311
400
|
end
|