square_connect 2.0.0 → 2.0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +7 -0
- data/README.md +151 -9
- data/Rakefile +8 -0
- data/docs/Address.md +26 -0
- data/docs/CaptureTransactionRequest.md +11 -0
- data/docs/CaptureTransactionResponse.md +12 -0
- data/docs/Card.md +18 -0
- data/docs/CardBrand.md +20 -0
- data/docs/ChargeRequest.md +22 -0
- data/docs/ChargeResponse.md +13 -0
- data/docs/Checkout.md +20 -0
- data/docs/CheckoutApi.md +62 -0
- data/docs/Country.md +261 -0
- data/docs/CreateCheckoutRequest.md +18 -0
- data/docs/CreateCheckoutResponse.md +13 -0
- data/docs/CreateCustomerCardRequest.md +14 -0
- data/docs/CreateCustomerCardResponse.md +13 -0
- data/docs/CreateCustomerRequest.md +20 -0
- data/docs/CreateCustomerResponse.md +13 -0
- data/docs/CreateOrderRequest.md +13 -0
- data/docs/CreateOrderRequestLineItem.md +14 -0
- data/docs/CreateOrderRequestOrder.md +13 -0
- data/docs/CreateRefundRequest.md +15 -0
- data/docs/CreateRefundResponse.md +13 -0
- data/docs/Currency.md +191 -0
- data/docs/Customer.md +26 -0
- data/docs/CustomerApi.md +267 -0
- data/docs/CustomerCardApi.md +116 -0
- data/docs/CustomerGroupInfo.md +13 -0
- data/docs/CustomerPreferences.md +12 -0
- data/docs/DeleteCustomerCardRequest.md +11 -0
- data/docs/DeleteCustomerCardResponse.md +12 -0
- data/docs/DeleteCustomerRequest.md +11 -0
- data/docs/DeleteCustomerResponse.md +12 -0
- data/docs/Error.md +15 -0
- data/docs/ErrorCategory.md +17 -0
- data/docs/ErrorCode.md +83 -0
- data/docs/ListCustomersRequest.md +12 -0
- data/docs/ListCustomersResponse.md +14 -0
- data/docs/ListLocationsRequest.md +11 -0
- data/docs/ListLocationsResponse.md +13 -0
- data/docs/ListRefundsRequest.md +15 -0
- data/docs/ListRefundsResponse.md +14 -0
- data/docs/ListTransactionsRequest.md +15 -0
- data/docs/ListTransactionsResponse.md +14 -0
- data/docs/Location.md +16 -0
- data/docs/LocationApi.md +56 -0
- data/docs/LocationCapability.md +12 -0
- data/docs/Money.md +13 -0
- data/docs/Order.md +16 -0
- data/docs/OrderLineItem.md +16 -0
- data/docs/Refund.md +20 -0
- data/docs/RefundApi.md +126 -0
- data/docs/RefundStatus.md +15 -0
- data/docs/RetrieveCustomerRequest.md +11 -0
- data/docs/RetrieveCustomerResponse.md +13 -0
- data/docs/RetrieveTransactionRequest.md +11 -0
- data/docs/RetrieveTransactionResponse.md +13 -0
- data/docs/SortOrder.md +13 -0
- data/docs/Tender.md +22 -0
- data/docs/TenderCardDetails.md +14 -0
- data/docs/TenderCardDetailsEntryMethod.md +16 -0
- data/docs/TenderCardDetailsStatus.md +15 -0
- data/docs/TenderCashDetails.md +13 -0
- data/docs/TenderType.md +17 -0
- data/docs/Transaction.md +21 -0
- data/docs/TransactionApi.md +285 -0
- data/docs/TransactionProduct.md +19 -0
- data/docs/UpdateCustomerRequest.md +20 -0
- data/docs/UpdateCustomerResponse.md +13 -0
- data/docs/VoidTransactionRequest.md +11 -0
- data/docs/VoidTransactionResponse.md +12 -0
- data/lib/square_connect.rb +33 -16
- data/lib/square_connect/api/checkout_api.rb +82 -0
- data/lib/square_connect/api/customer_api.rb +121 -162
- data/lib/square_connect/api/customer_card_api.rb +31 -50
- data/lib/square_connect/api/location_api.rb +12 -20
- data/lib/square_connect/api/refund_api.rb +70 -90
- data/lib/square_connect/api/transaction_api.rb +119 -165
- data/lib/square_connect/api_client.rb +64 -17
- data/lib/square_connect/api_error.rb +7 -3
- data/lib/square_connect/configuration.rb +31 -1
- data/lib/square_connect/models/address.rb +149 -78
- data/lib/square_connect/models/capture_transaction_request.rb +176 -0
- data/lib/square_connect/models/capture_transaction_response.rb +54 -26
- data/lib/square_connect/models/card.rb +98 -52
- data/lib/square_connect/models/card_brand.rb +12 -133
- data/lib/square_connect/models/charge_request.rb +106 -67
- data/lib/square_connect/models/charge_response.rb +57 -30
- data/lib/square_connect/models/checkout.rb +266 -0
- data/lib/square_connect/models/country.rb +253 -133
- data/lib/square_connect/models/create_checkout_request.rb +316 -0
- data/lib/square_connect/models/create_checkout_response.rb +198 -0
- data/lib/square_connect/models/create_customer_card_request.rb +66 -35
- data/lib/square_connect/models/create_customer_card_response.rb +58 -31
- data/lib/square_connect/models/create_customer_request.rb +79 -59
- data/lib/square_connect/models/create_customer_response.rb +58 -31
- data/lib/square_connect/models/create_order_request.rb +234 -0
- data/lib/square_connect/models/create_order_request_line_item.rb +268 -0
- data/lib/square_connect/models/create_order_request_order.rb +219 -0
- data/lib/square_connect/models/create_refund_request.rb +79 -39
- data/lib/square_connect/models/create_refund_response.rb +57 -30
- data/lib/square_connect/models/currency.rb +183 -133
- data/lib/square_connect/models/customer.rb +130 -77
- data/lib/square_connect/models/customer_group_info.rb +206 -0
- data/lib/square_connect/models/customer_preferences.rb +186 -0
- data/lib/square_connect/models/delete_customer_card_request.rb +176 -0
- data/lib/square_connect/models/delete_customer_card_response.rb +55 -27
- data/lib/square_connect/models/delete_customer_request.rb +176 -0
- data/lib/square_connect/models/delete_customer_response.rb +55 -27
- data/lib/square_connect/models/error.rb +107 -45
- data/lib/square_connect/models/error_category.rb +9 -133
- data/lib/square_connect/models/error_code.rb +75 -133
- data/lib/square_connect/models/list_customers_request.rb +55 -27
- data/lib/square_connect/models/list_customers_response.rb +61 -35
- data/lib/square_connect/models/list_locations_request.rb +176 -0
- data/lib/square_connect/models/list_locations_response.rb +57 -30
- data/lib/square_connect/models/list_refunds_request.rb +91 -42
- data/lib/square_connect/models/list_refunds_response.rb +59 -33
- data/lib/square_connect/models/list_transactions_request.rb +91 -42
- data/lib/square_connect/models/list_transactions_response.rb +59 -33
- data/lib/square_connect/models/location.rb +86 -41
- data/lib/square_connect/models/location_capability.rb +4 -133
- data/lib/square_connect/models/money.rb +85 -34
- data/lib/square_connect/models/order.rb +228 -0
- data/lib/square_connect/models/order_line_item.rb +226 -0
- data/lib/square_connect/models/refund.rb +138 -59
- data/lib/square_connect/models/refund_status.rb +7 -133
- data/lib/square_connect/models/retrieve_customer_request.rb +176 -0
- data/lib/square_connect/models/retrieve_customer_response.rb +58 -31
- data/lib/square_connect/models/retrieve_transaction_request.rb +176 -0
- data/lib/square_connect/models/retrieve_transaction_response.rb +57 -30
- data/lib/square_connect/models/sort_order.rb +5 -133
- data/lib/square_connect/models/tender.rb +112 -65
- data/lib/square_connect/models/tender_card_details.rb +93 -40
- data/lib/square_connect/models/tender_card_details_entry_method.rb +8 -133
- data/lib/square_connect/models/tender_card_details_status.rb +7 -133
- data/lib/square_connect/models/tender_cash_details.rb +58 -31
- data/lib/square_connect/models/tender_type.rb +9 -133
- data/lib/square_connect/models/transaction.rb +132 -56
- data/lib/square_connect/models/transaction_product.rb +11 -133
- data/lib/square_connect/models/update_customer_request.rb +79 -59
- data/lib/square_connect/models/update_customer_response.rb +58 -31
- data/lib/square_connect/models/void_transaction_request.rb +176 -0
- data/lib/square_connect/models/void_transaction_response.rb +54 -26
- data/lib/square_connect/version.rb +2 -3
- data/spec/api/checkout_api_spec.rb +53 -0
- data/spec/api/customer_api_spec.rb +121 -0
- data/spec/api/customer_card_api_spec.rb +71 -0
- data/spec/api/location_api_spec.rb +58 -0
- data/spec/api/refund_api_spec.rb +75 -0
- data/spec/api/transaction_api_spec.rb +128 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/address_spec.rb +186 -0
- data/spec/models/capture_transaction_request_spec.rb +36 -0
- data/spec/models/capture_transaction_response_spec.rb +46 -0
- data/spec/models/card_brand_spec.rb +36 -0
- data/spec/models/card_spec.rb +106 -0
- data/spec/models/charge_request_spec.rb +146 -0
- data/spec/models/charge_response_spec.rb +56 -0
- data/spec/models/checkout_spec.rb +126 -0
- data/spec/models/country_spec.rb +36 -0
- data/spec/models/create_checkout_request_spec.rb +106 -0
- data/spec/models/create_checkout_response_spec.rb +56 -0
- data/spec/models/create_customer_card_request_spec.rb +66 -0
- data/spec/models/create_customer_card_response_spec.rb +56 -0
- data/spec/models/create_customer_request_spec.rb +126 -0
- data/spec/models/create_customer_response_spec.rb +56 -0
- data/spec/models/create_order_request_line_item_spec.rb +66 -0
- data/spec/models/create_order_request_order_spec.rb +56 -0
- data/spec/models/create_order_request_spec.rb +56 -0
- data/spec/models/create_refund_request_spec.rb +76 -0
- data/spec/models/create_refund_response_spec.rb +56 -0
- data/spec/models/currency_spec.rb +36 -0
- data/spec/models/customer_group_info_spec.rb +56 -0
- data/spec/models/customer_preferences_spec.rb +46 -0
- data/spec/models/customer_spec.rb +186 -0
- data/spec/models/delete_customer_card_request_spec.rb +36 -0
- data/spec/models/delete_customer_card_response_spec.rb +46 -0
- data/spec/models/delete_customer_request_spec.rb +36 -0
- data/spec/models/delete_customer_response_spec.rb +46 -0
- data/spec/models/error_category_spec.rb +36 -0
- data/spec/models/error_code_spec.rb +36 -0
- data/spec/models/error_spec.rb +76 -0
- data/spec/models/list_customers_request_spec.rb +46 -0
- data/spec/models/list_customers_response_spec.rb +66 -0
- data/spec/models/list_locations_request_spec.rb +36 -0
- data/spec/models/list_locations_response_spec.rb +56 -0
- data/spec/models/list_refunds_request_spec.rb +76 -0
- data/spec/models/list_refunds_response_spec.rb +66 -0
- data/spec/models/list_transactions_request_spec.rb +76 -0
- data/spec/models/list_transactions_response_spec.rb +66 -0
- data/spec/models/location_capability_spec.rb +36 -0
- data/spec/models/location_spec.rb +86 -0
- data/spec/models/money_spec.rb +56 -0
- data/spec/models/order_line_item_spec.rb +86 -0
- data/spec/models/order_spec.rb +86 -0
- data/spec/models/refund_spec.rb +126 -0
- data/spec/models/refund_status_spec.rb +36 -0
- data/spec/models/retrieve_customer_request_spec.rb +36 -0
- data/spec/models/retrieve_customer_response_spec.rb +56 -0
- data/spec/models/retrieve_transaction_request_spec.rb +36 -0
- data/spec/models/retrieve_transaction_response_spec.rb +56 -0
- data/spec/models/sort_order_spec.rb +36 -0
- data/spec/models/tender_card_details_entry_method_spec.rb +36 -0
- data/spec/models/tender_card_details_spec.rb +66 -0
- data/spec/models/tender_card_details_status_spec.rb +36 -0
- data/spec/models/tender_cash_details_spec.rb +56 -0
- data/spec/models/tender_spec.rb +146 -0
- data/spec/models/tender_type_spec.rb +36 -0
- data/spec/models/transaction_product_spec.rb +36 -0
- data/spec/models/transaction_spec.rb +136 -0
- data/spec/models/update_customer_request_spec.rb +126 -0
- data/spec/models/update_customer_response_spec.rb +56 -0
- data/spec/models/void_transaction_request_spec.rb +36 -0
- data/spec/models/void_transaction_response_spec.rb +46 -0
- data/spec/spec_helper.rb +115 -0
- data/square_connect.gemspec +22 -11
- data/travis-ci/accounts.enc +0 -0
- metadata +264 -31
@@ -1,147 +1,23 @@
|
|
1
1
|
=begin
|
2
|
-
Square Connect API
|
2
|
+
#Square Connect API
|
3
3
|
|
4
4
|
OpenAPI spec version: 2.0
|
5
5
|
|
6
6
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
7
7
|
|
8
|
-
|
9
8
|
=end
|
10
9
|
|
11
10
|
require 'date'
|
12
11
|
|
13
12
|
module SquareConnect
|
14
|
-
#
|
15
13
|
class ErrorCategory
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
# Attribute type mapping.
|
24
|
-
def self.swagger_types
|
25
|
-
{
|
26
|
-
|
27
|
-
}
|
28
|
-
end
|
29
|
-
|
30
|
-
def initialize(attributes = {})
|
31
|
-
return unless attributes.is_a?(Hash)
|
32
|
-
|
33
|
-
# convert string to symbol for hash key
|
34
|
-
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
35
|
-
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
# Check equality by comparing each attribute.
|
40
|
-
def ==(o)
|
41
|
-
return true if self.equal?(o)
|
42
|
-
self.class == o.class
|
43
|
-
end
|
44
|
-
|
45
|
-
# @see the `==` method
|
46
|
-
def eql?(o)
|
47
|
-
self == o
|
48
|
-
end
|
49
|
-
|
50
|
-
# Calculate hash code according to all attributes.
|
51
|
-
def hash
|
52
|
-
[].hash
|
53
|
-
end
|
54
|
-
|
55
|
-
# build the object from hash
|
56
|
-
def build_from_hash(attributes)
|
57
|
-
return nil unless attributes.is_a?(Hash)
|
58
|
-
self.class.swagger_types.each_pair do |key, type|
|
59
|
-
if type =~ /^Array<(.*)>/i
|
60
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
61
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
62
|
-
else
|
63
|
-
#TODO show warning in debug mode
|
64
|
-
end
|
65
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
66
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
67
|
-
else
|
68
|
-
# data not found in attributes(hash), not an issue as the data can be optional
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
self
|
73
|
-
end
|
74
|
-
|
75
|
-
def _deserialize(type, value)
|
76
|
-
case type.to_sym
|
77
|
-
when :DateTime
|
78
|
-
DateTime.parse(value)
|
79
|
-
when :Date
|
80
|
-
Date.parse(value)
|
81
|
-
when :String
|
82
|
-
value.to_s
|
83
|
-
when :Integer
|
84
|
-
value.to_i
|
85
|
-
when :Float
|
86
|
-
value.to_f
|
87
|
-
when :BOOLEAN
|
88
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
89
|
-
true
|
90
|
-
else
|
91
|
-
false
|
92
|
-
end
|
93
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
94
|
-
inner_type = Regexp.last_match[:inner_type]
|
95
|
-
value.map { |v| _deserialize(inner_type, v) }
|
96
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
97
|
-
k_type = Regexp.last_match[:k_type]
|
98
|
-
v_type = Regexp.last_match[:v_type]
|
99
|
-
{}.tap do |hash|
|
100
|
-
value.each do |k, v|
|
101
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
102
|
-
end
|
103
|
-
end
|
104
|
-
else # model
|
105
|
-
_model = SquareConnect.const_get(type).new
|
106
|
-
_model.build_from_hash(value)
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
def to_s
|
111
|
-
to_hash.to_s
|
112
|
-
end
|
113
|
-
|
114
|
-
# to_body is an alias to to_body (backward compatibility))
|
115
|
-
def to_body
|
116
|
-
to_hash
|
117
|
-
end
|
118
|
-
|
119
|
-
# return the object in the form of hash
|
120
|
-
def to_hash
|
121
|
-
hash = {}
|
122
|
-
self.class.attribute_map.each_pair do |attr, param|
|
123
|
-
value = self.send(attr)
|
124
|
-
next if value.nil?
|
125
|
-
hash[param] = _to_hash(value)
|
126
|
-
end
|
127
|
-
hash
|
128
|
-
end
|
129
|
-
|
130
|
-
# Method to output non-array value in the form of hash
|
131
|
-
# For object, use to_hash. Otherwise, just return the value
|
132
|
-
def _to_hash(value)
|
133
|
-
if value.is_a?(Array)
|
134
|
-
value.compact.map{ |v| _to_hash(v) }
|
135
|
-
elsif value.is_a?(Hash)
|
136
|
-
{}.tap do |hash|
|
137
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
138
|
-
end
|
139
|
-
elsif value.respond_to? :to_hash
|
140
|
-
value.to_hash
|
141
|
-
else
|
142
|
-
value
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
14
|
+
|
15
|
+
API_ERROR = "API_ERROR".freeze
|
16
|
+
AUTHENTICATION_ERROR = "AUTHENTICATION_ERROR".freeze
|
17
|
+
INVALID_REQUEST_ERROR = "INVALID_REQUEST_ERROR".freeze
|
18
|
+
RATE_LIMIT_ERROR = "RATE_LIMIT_ERROR".freeze
|
19
|
+
PAYMENT_METHOD_ERROR = "PAYMENT_METHOD_ERROR".freeze
|
20
|
+
REFUND_ERROR = "REFUND_ERROR".freeze
|
146
21
|
end
|
22
|
+
|
147
23
|
end
|
@@ -1,147 +1,89 @@
|
|
1
1
|
=begin
|
2
|
-
Square Connect API
|
2
|
+
#Square Connect API
|
3
3
|
|
4
4
|
OpenAPI spec version: 2.0
|
5
5
|
|
6
6
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
7
7
|
|
8
|
-
|
9
8
|
=end
|
10
9
|
|
11
10
|
require 'date'
|
12
11
|
|
13
12
|
module SquareConnect
|
14
|
-
#
|
15
13
|
class ErrorCode
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
true
|
90
|
-
else
|
91
|
-
false
|
92
|
-
end
|
93
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
94
|
-
inner_type = Regexp.last_match[:inner_type]
|
95
|
-
value.map { |v| _deserialize(inner_type, v) }
|
96
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
97
|
-
k_type = Regexp.last_match[:k_type]
|
98
|
-
v_type = Regexp.last_match[:v_type]
|
99
|
-
{}.tap do |hash|
|
100
|
-
value.each do |k, v|
|
101
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
102
|
-
end
|
103
|
-
end
|
104
|
-
else # model
|
105
|
-
_model = SquareConnect.const_get(type).new
|
106
|
-
_model.build_from_hash(value)
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
def to_s
|
111
|
-
to_hash.to_s
|
112
|
-
end
|
113
|
-
|
114
|
-
# to_body is an alias to to_body (backward compatibility))
|
115
|
-
def to_body
|
116
|
-
to_hash
|
117
|
-
end
|
118
|
-
|
119
|
-
# return the object in the form of hash
|
120
|
-
def to_hash
|
121
|
-
hash = {}
|
122
|
-
self.class.attribute_map.each_pair do |attr, param|
|
123
|
-
value = self.send(attr)
|
124
|
-
next if value.nil?
|
125
|
-
hash[param] = _to_hash(value)
|
126
|
-
end
|
127
|
-
hash
|
128
|
-
end
|
129
|
-
|
130
|
-
# Method to output non-array value in the form of hash
|
131
|
-
# For object, use to_hash. Otherwise, just return the value
|
132
|
-
def _to_hash(value)
|
133
|
-
if value.is_a?(Array)
|
134
|
-
value.compact.map{ |v| _to_hash(v) }
|
135
|
-
elsif value.is_a?(Hash)
|
136
|
-
{}.tap do |hash|
|
137
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
138
|
-
end
|
139
|
-
elsif value.respond_to? :to_hash
|
140
|
-
value.to_hash
|
141
|
-
else
|
142
|
-
value
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
14
|
+
|
15
|
+
INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR".freeze
|
16
|
+
UNAUTHORIZED = "UNAUTHORIZED".freeze
|
17
|
+
ACCESS_TOKEN_EXPIRED = "ACCESS_TOKEN_EXPIRED".freeze
|
18
|
+
ACCESS_TOKEN_REVOKED = "ACCESS_TOKEN_REVOKED".freeze
|
19
|
+
FORBIDDEN = "FORBIDDEN".freeze
|
20
|
+
INSUFFICIENT_SCOPES = "INSUFFICIENT_SCOPES".freeze
|
21
|
+
APPLICATION_DISABLED = "APPLICATION_DISABLED".freeze
|
22
|
+
V1_APPLICATION = "V1_APPLICATION".freeze
|
23
|
+
V1_ACCESS_TOKEN = "V1_ACCESS_TOKEN".freeze
|
24
|
+
CARD_PROCESSING_NOT_ENABLED = "CARD_PROCESSING_NOT_ENABLED".freeze
|
25
|
+
BAD_REQUEST = "BAD_REQUEST".freeze
|
26
|
+
MISSING_REQUIRED_PARAMETER = "MISSING_REQUIRED_PARAMETER".freeze
|
27
|
+
INCORRECT_TYPE = "INCORRECT_TYPE".freeze
|
28
|
+
INVALID_TIME = "INVALID_TIME".freeze
|
29
|
+
INVALID_TIME_RANGE = "INVALID_TIME_RANGE".freeze
|
30
|
+
INVALID_VALUE = "INVALID_VALUE".freeze
|
31
|
+
INVALID_CURSOR = "INVALID_CURSOR".freeze
|
32
|
+
UNKNOWN_QUERY_PARAMETER = "UNKNOWN_QUERY_PARAMETER".freeze
|
33
|
+
CONFLICTING_PARAMETERS = "CONFLICTING_PARAMETERS".freeze
|
34
|
+
EXPECTED_JSON_BODY = "EXPECTED_JSON_BODY".freeze
|
35
|
+
INVALID_SORT_ORDER = "INVALID_SORT_ORDER".freeze
|
36
|
+
VALUE_REGEX_MISMATCH = "VALUE_REGEX_MISMATCH".freeze
|
37
|
+
VALUE_TOO_SHORT = "VALUE_TOO_SHORT".freeze
|
38
|
+
VALUE_TOO_LONG = "VALUE_TOO_LONG".freeze
|
39
|
+
VALUE_TOO_LOW = "VALUE_TOO_LOW".freeze
|
40
|
+
VALUE_TOO_HIGH = "VALUE_TOO_HIGH".freeze
|
41
|
+
VALUE_EMPTY = "VALUE_EMPTY".freeze
|
42
|
+
ARRAY_EMPTY = "ARRAY_EMPTY".freeze
|
43
|
+
EXPECTED_BOOLEAN = "EXPECTED_BOOLEAN".freeze
|
44
|
+
EXPECTED_INTEGER = "EXPECTED_INTEGER".freeze
|
45
|
+
EXPECTED_FLOAT = "EXPECTED_FLOAT".freeze
|
46
|
+
EXPECTED_STRING = "EXPECTED_STRING".freeze
|
47
|
+
EXPECTED_OBJECT = "EXPECTED_OBJECT".freeze
|
48
|
+
EXPECTED_ARRAY = "EXPECTED_ARRAY".freeze
|
49
|
+
EXPECTED_BASE64_ENCODED_BYTE_ARRAY = "EXPECTED_BASE64_ENCODED_BYTE_ARRAY".freeze
|
50
|
+
INVALID_ARRAY_VALUE = "INVALID_ARRAY_VALUE".freeze
|
51
|
+
INVALID_ENUM_VALUE = "INVALID_ENUM_VALUE".freeze
|
52
|
+
INVALID_CONTENT_TYPE = "INVALID_CONTENT_TYPE".freeze
|
53
|
+
INVALID_FORM_VALUE = "INVALID_FORM_VALUE".freeze
|
54
|
+
ONE_INSTRUMENT_EXPECTED = "ONE_INSTRUMENT_EXPECTED".freeze
|
55
|
+
NO_FIELDS_SET = "NO_FIELDS_SET".freeze
|
56
|
+
CARD_EXPIRED = "CARD_EXPIRED".freeze
|
57
|
+
INVALID_EXPIRATION = "INVALID_EXPIRATION".freeze
|
58
|
+
INVALID_EXPIRATION_YEAR = "INVALID_EXPIRATION_YEAR".freeze
|
59
|
+
INVALID_EXPIRATION_DATE = "INVALID_EXPIRATION_DATE".freeze
|
60
|
+
UNSUPPORTED_CARD_BRAND = "UNSUPPORTED_CARD_BRAND".freeze
|
61
|
+
INVALID_CARD = "INVALID_CARD".freeze
|
62
|
+
DELAYED_TRANSACTION_EXPIRED = "DELAYED_TRANSACTION_EXPIRED".freeze
|
63
|
+
DELAYED_TRANSACTION_CANCELED = "DELAYED_TRANSACTION_CANCELED".freeze
|
64
|
+
DELAYED_TRANSACTION_CAPTURED = "DELAYED_TRANSACTION_CAPTURED".freeze
|
65
|
+
DELAYED_TRANSACTION_FAILED = "DELAYED_TRANSACTION_FAILED".freeze
|
66
|
+
CARD_TOKEN_EXPIRED = "CARD_TOKEN_EXPIRED".freeze
|
67
|
+
CARD_TOKEN_USED = "CARD_TOKEN_USED".freeze
|
68
|
+
AMOUNT_TOO_HIGH = "AMOUNT_TOO_HIGH".freeze
|
69
|
+
UNSUPPORTED_INSTRUMENT_TYPE = "UNSUPPORTED_INSTRUMENT_TYPE".freeze
|
70
|
+
REFUND_AMOUNT_INVALID = "REFUND_AMOUNT_INVALID".freeze
|
71
|
+
REFUND_ALREADY_PENDING = "REFUND_ALREADY_PENDING".freeze
|
72
|
+
PAYMENT_NOT_REFUNDABLE = "PAYMENT_NOT_REFUNDABLE".freeze
|
73
|
+
INVALID_CARD_DATA = "INVALID_CARD_DATA".freeze
|
74
|
+
IDEMPOTENCY_KEY_REUSED = "IDEMPOTENCY_KEY_REUSED".freeze
|
75
|
+
CARD_DECLINED = "CARD_DECLINED".freeze
|
76
|
+
VERIFY_CVV_FAILURE = "VERIFY_CVV_FAILURE".freeze
|
77
|
+
VERIFY_AVS_FAILURE = "VERIFY_AVS_FAILURE".freeze
|
78
|
+
CARD_DECLINED_CALL_ISSUER = "CARD_DECLINED_CALL_ISSUER".freeze
|
79
|
+
NOT_FOUND = "NOT_FOUND".freeze
|
80
|
+
REQUEST_TIMEOUT = "REQUEST_TIMEOUT".freeze
|
81
|
+
CONFLICT = "CONFLICT".freeze
|
82
|
+
REQUEST_ENTITY_TOO_LARGE = "REQUEST_ENTITY_TOO_LARGE".freeze
|
83
|
+
UNSUPPORTED_MEDIA_TYPE = "UNSUPPORTED_MEDIA_TYPE".freeze
|
84
|
+
RATE_LIMITED = "RATE_LIMITED".freeze
|
85
|
+
NOT_IMPLEMENTED = "NOT_IMPLEMENTED".freeze
|
86
|
+
SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE".freeze
|
146
87
|
end
|
88
|
+
|
147
89
|
end
|
@@ -1,27 +1,25 @@
|
|
1
1
|
=begin
|
2
|
-
Square Connect API
|
2
|
+
#Square Connect API
|
3
3
|
|
4
4
|
OpenAPI spec version: 2.0
|
5
5
|
|
6
6
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
7
7
|
|
8
|
-
|
9
8
|
=end
|
10
9
|
|
11
10
|
require 'date'
|
12
11
|
|
13
12
|
module SquareConnect
|
14
|
-
#
|
13
|
+
# Defines the query parameters that can be provided in a request to the [ListCustomers](#endpoint-listcustomers) endpoint.
|
15
14
|
class ListCustomersRequest
|
16
|
-
#
|
15
|
+
# 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.
|
17
16
|
attr_accessor :cursor
|
18
17
|
|
18
|
+
|
19
19
|
# Attribute mapping from ruby-style variable name to JSON key.
|
20
20
|
def self.attribute_map
|
21
21
|
{
|
22
|
-
|
23
22
|
:'cursor' => :'cursor'
|
24
|
-
|
25
23
|
}
|
26
24
|
end
|
27
25
|
|
@@ -29,24 +27,38 @@ module SquareConnect
|
|
29
27
|
def self.swagger_types
|
30
28
|
{
|
31
29
|
:'cursor' => :'String'
|
32
|
-
|
33
30
|
}
|
34
31
|
end
|
35
32
|
|
33
|
+
# Initializes the object
|
34
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
36
35
|
def initialize(attributes = {})
|
37
36
|
return unless attributes.is_a?(Hash)
|
38
37
|
|
39
38
|
# convert string to symbol for hash key
|
40
|
-
attributes = attributes.
|
39
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
41
40
|
|
42
|
-
|
43
|
-
if attributes[:'cursor']
|
41
|
+
if attributes.has_key?(:'cursor')
|
44
42
|
self.cursor = attributes[:'cursor']
|
45
43
|
end
|
46
|
-
|
44
|
+
|
47
45
|
end
|
48
46
|
|
49
|
-
#
|
47
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
48
|
+
# @return Array for valid properies with the reasons
|
49
|
+
def list_invalid_properties
|
50
|
+
invalid_properties = Array.new
|
51
|
+
return invalid_properties
|
52
|
+
end
|
53
|
+
|
54
|
+
# Check to see if the all the properties in the model are valid
|
55
|
+
# @return true if the model is valid
|
56
|
+
def valid?
|
57
|
+
return true
|
58
|
+
end
|
59
|
+
|
60
|
+
# Checks equality by comparing each attribute.
|
61
|
+
# @param [Object] Object to be compared
|
50
62
|
def ==(o)
|
51
63
|
return true if self.equal?(o)
|
52
64
|
self.class == o.class &&
|
@@ -54,35 +66,41 @@ module SquareConnect
|
|
54
66
|
end
|
55
67
|
|
56
68
|
# @see the `==` method
|
69
|
+
# @param [Object] Object to be compared
|
57
70
|
def eql?(o)
|
58
71
|
self == o
|
59
72
|
end
|
60
73
|
|
61
|
-
#
|
74
|
+
# Calculates hash code according to all attributes.
|
75
|
+
# @return [Fixnum] Hash code
|
62
76
|
def hash
|
63
77
|
[cursor].hash
|
64
78
|
end
|
65
79
|
|
66
|
-
#
|
80
|
+
# Builds the object from hash
|
81
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
82
|
+
# @return [Object] Returns the model itself
|
67
83
|
def build_from_hash(attributes)
|
68
84
|
return nil unless attributes.is_a?(Hash)
|
69
85
|
self.class.swagger_types.each_pair do |key, type|
|
70
|
-
if type =~
|
86
|
+
if type =~ /\AArray<(.*)>/i
|
87
|
+
# check to ensure the input is an array given that the the attribute
|
88
|
+
# is documented as an array but the input is not
|
71
89
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
72
90
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
73
|
-
else
|
74
|
-
#TODO show warning in debug mode
|
75
91
|
end
|
76
92
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
77
93
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
78
|
-
else
|
79
|
-
# data not found in attributes(hash), not an issue as the data can be optional
|
80
|
-
end
|
94
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
81
95
|
end
|
82
96
|
|
83
97
|
self
|
84
98
|
end
|
85
99
|
|
100
|
+
# Deserializes the data based on type
|
101
|
+
# @param string type Data type
|
102
|
+
# @param string value Value to be deserialized
|
103
|
+
# @return [Object] Deserialized data
|
86
104
|
def _deserialize(type, value)
|
87
105
|
case type.to_sym
|
88
106
|
when :DateTime
|
@@ -96,15 +114,18 @@ module SquareConnect
|
|
96
114
|
when :Float
|
97
115
|
value.to_f
|
98
116
|
when :BOOLEAN
|
99
|
-
if value.to_s =~
|
117
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
100
118
|
true
|
101
119
|
else
|
102
120
|
false
|
103
121
|
end
|
122
|
+
when :Object
|
123
|
+
# generic object (usually a Hash), return directly
|
124
|
+
value
|
104
125
|
when /\AArray<(?<inner_type>.+)>\z/
|
105
126
|
inner_type = Regexp.last_match[:inner_type]
|
106
127
|
value.map { |v| _deserialize(inner_type, v) }
|
107
|
-
when /\AHash<(?<k_type
|
128
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
108
129
|
k_type = Regexp.last_match[:k_type]
|
109
130
|
v_type = Regexp.last_match[:v_type]
|
110
131
|
{}.tap do |hash|
|
@@ -113,21 +134,25 @@ module SquareConnect
|
|
113
134
|
end
|
114
135
|
end
|
115
136
|
else # model
|
116
|
-
|
117
|
-
|
137
|
+
temp_model = SquareConnect.const_get(type).new
|
138
|
+
temp_model.build_from_hash(value)
|
118
139
|
end
|
119
140
|
end
|
120
141
|
|
142
|
+
# Returns the string representation of the object
|
143
|
+
# @return [String] String presentation of the object
|
121
144
|
def to_s
|
122
145
|
to_hash.to_s
|
123
146
|
end
|
124
147
|
|
125
|
-
# to_body is an alias to
|
148
|
+
# to_body is an alias to to_hash (backward compatibility)
|
149
|
+
# @return [Hash] Returns the object in the form of hash
|
126
150
|
def to_body
|
127
151
|
to_hash
|
128
152
|
end
|
129
153
|
|
130
|
-
#
|
154
|
+
# Returns the object in the form of hash
|
155
|
+
# @return [Hash] Returns the object in the form of hash
|
131
156
|
def to_hash
|
132
157
|
hash = {}
|
133
158
|
self.class.attribute_map.each_pair do |attr, param|
|
@@ -138,8 +163,10 @@ module SquareConnect
|
|
138
163
|
hash
|
139
164
|
end
|
140
165
|
|
141
|
-
#
|
166
|
+
# Outputs non-array value in the form of hash
|
142
167
|
# For object, use to_hash. Otherwise, just return the value
|
168
|
+
# @param [Object] value Any valid value
|
169
|
+
# @return [Hash] Returns the value in the form of hash
|
143
170
|
def _to_hash(value)
|
144
171
|
if value.is_a?(Array)
|
145
172
|
value.compact.map{ |v| _to_hash(v) }
|
@@ -155,4 +182,5 @@ module SquareConnect
|
|
155
182
|
end
|
156
183
|
|
157
184
|
end
|
185
|
+
|
158
186
|
end
|