square_connect 2.0.0 → 2.0.2.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +7 -0
- data/README.md +151 -9
- data/Rakefile +8 -0
- data/docs/Address.md +26 -0
- data/docs/CaptureTransactionRequest.md +11 -0
- data/docs/CaptureTransactionResponse.md +12 -0
- data/docs/Card.md +18 -0
- data/docs/CardBrand.md +20 -0
- data/docs/ChargeRequest.md +22 -0
- data/docs/ChargeResponse.md +13 -0
- data/docs/Checkout.md +20 -0
- data/docs/CheckoutApi.md +62 -0
- data/docs/Country.md +261 -0
- data/docs/CreateCheckoutRequest.md +18 -0
- data/docs/CreateCheckoutResponse.md +13 -0
- data/docs/CreateCustomerCardRequest.md +14 -0
- data/docs/CreateCustomerCardResponse.md +13 -0
- data/docs/CreateCustomerRequest.md +20 -0
- data/docs/CreateCustomerResponse.md +13 -0
- data/docs/CreateOrderRequest.md +13 -0
- data/docs/CreateOrderRequestLineItem.md +14 -0
- data/docs/CreateOrderRequestOrder.md +13 -0
- data/docs/CreateRefundRequest.md +15 -0
- data/docs/CreateRefundResponse.md +13 -0
- data/docs/Currency.md +191 -0
- data/docs/Customer.md +26 -0
- data/docs/CustomerApi.md +267 -0
- data/docs/CustomerCardApi.md +116 -0
- data/docs/CustomerGroupInfo.md +13 -0
- data/docs/CustomerPreferences.md +12 -0
- data/docs/DeleteCustomerCardRequest.md +11 -0
- data/docs/DeleteCustomerCardResponse.md +12 -0
- data/docs/DeleteCustomerRequest.md +11 -0
- data/docs/DeleteCustomerResponse.md +12 -0
- data/docs/Error.md +15 -0
- data/docs/ErrorCategory.md +17 -0
- data/docs/ErrorCode.md +83 -0
- data/docs/ListCustomersRequest.md +12 -0
- data/docs/ListCustomersResponse.md +14 -0
- data/docs/ListLocationsRequest.md +11 -0
- data/docs/ListLocationsResponse.md +13 -0
- data/docs/ListRefundsRequest.md +15 -0
- data/docs/ListRefundsResponse.md +14 -0
- data/docs/ListTransactionsRequest.md +15 -0
- data/docs/ListTransactionsResponse.md +14 -0
- data/docs/Location.md +16 -0
- data/docs/LocationApi.md +56 -0
- data/docs/LocationCapability.md +12 -0
- data/docs/Money.md +13 -0
- data/docs/Order.md +16 -0
- data/docs/OrderLineItem.md +16 -0
- data/docs/Refund.md +20 -0
- data/docs/RefundApi.md +126 -0
- data/docs/RefundStatus.md +15 -0
- data/docs/RetrieveCustomerRequest.md +11 -0
- data/docs/RetrieveCustomerResponse.md +13 -0
- data/docs/RetrieveTransactionRequest.md +11 -0
- data/docs/RetrieveTransactionResponse.md +13 -0
- data/docs/SortOrder.md +13 -0
- data/docs/Tender.md +22 -0
- data/docs/TenderCardDetails.md +14 -0
- data/docs/TenderCardDetailsEntryMethod.md +16 -0
- data/docs/TenderCardDetailsStatus.md +15 -0
- data/docs/TenderCashDetails.md +13 -0
- data/docs/TenderType.md +17 -0
- data/docs/Transaction.md +21 -0
- data/docs/TransactionApi.md +285 -0
- data/docs/TransactionProduct.md +19 -0
- data/docs/UpdateCustomerRequest.md +20 -0
- data/docs/UpdateCustomerResponse.md +13 -0
- data/docs/VoidTransactionRequest.md +11 -0
- data/docs/VoidTransactionResponse.md +12 -0
- data/lib/square_connect.rb +33 -16
- data/lib/square_connect/api/checkout_api.rb +82 -0
- data/lib/square_connect/api/customer_api.rb +121 -162
- data/lib/square_connect/api/customer_card_api.rb +31 -50
- data/lib/square_connect/api/location_api.rb +12 -20
- data/lib/square_connect/api/refund_api.rb +70 -90
- data/lib/square_connect/api/transaction_api.rb +119 -165
- data/lib/square_connect/api_client.rb +64 -17
- data/lib/square_connect/api_error.rb +7 -3
- data/lib/square_connect/configuration.rb +31 -1
- data/lib/square_connect/models/address.rb +149 -78
- data/lib/square_connect/models/capture_transaction_request.rb +176 -0
- data/lib/square_connect/models/capture_transaction_response.rb +54 -26
- data/lib/square_connect/models/card.rb +98 -52
- data/lib/square_connect/models/card_brand.rb +12 -133
- data/lib/square_connect/models/charge_request.rb +106 -67
- data/lib/square_connect/models/charge_response.rb +57 -30
- data/lib/square_connect/models/checkout.rb +266 -0
- data/lib/square_connect/models/country.rb +253 -133
- data/lib/square_connect/models/create_checkout_request.rb +316 -0
- data/lib/square_connect/models/create_checkout_response.rb +198 -0
- data/lib/square_connect/models/create_customer_card_request.rb +66 -35
- data/lib/square_connect/models/create_customer_card_response.rb +58 -31
- data/lib/square_connect/models/create_customer_request.rb +79 -59
- data/lib/square_connect/models/create_customer_response.rb +58 -31
- data/lib/square_connect/models/create_order_request.rb +234 -0
- data/lib/square_connect/models/create_order_request_line_item.rb +268 -0
- data/lib/square_connect/models/create_order_request_order.rb +219 -0
- data/lib/square_connect/models/create_refund_request.rb +79 -39
- data/lib/square_connect/models/create_refund_response.rb +57 -30
- data/lib/square_connect/models/currency.rb +183 -133
- data/lib/square_connect/models/customer.rb +130 -77
- data/lib/square_connect/models/customer_group_info.rb +206 -0
- data/lib/square_connect/models/customer_preferences.rb +186 -0
- data/lib/square_connect/models/delete_customer_card_request.rb +176 -0
- data/lib/square_connect/models/delete_customer_card_response.rb +55 -27
- data/lib/square_connect/models/delete_customer_request.rb +176 -0
- data/lib/square_connect/models/delete_customer_response.rb +55 -27
- data/lib/square_connect/models/error.rb +107 -45
- data/lib/square_connect/models/error_category.rb +9 -133
- data/lib/square_connect/models/error_code.rb +75 -133
- data/lib/square_connect/models/list_customers_request.rb +55 -27
- data/lib/square_connect/models/list_customers_response.rb +61 -35
- data/lib/square_connect/models/list_locations_request.rb +176 -0
- data/lib/square_connect/models/list_locations_response.rb +57 -30
- data/lib/square_connect/models/list_refunds_request.rb +91 -42
- data/lib/square_connect/models/list_refunds_response.rb +59 -33
- data/lib/square_connect/models/list_transactions_request.rb +91 -42
- data/lib/square_connect/models/list_transactions_response.rb +59 -33
- data/lib/square_connect/models/location.rb +86 -41
- data/lib/square_connect/models/location_capability.rb +4 -133
- data/lib/square_connect/models/money.rb +85 -34
- data/lib/square_connect/models/order.rb +228 -0
- data/lib/square_connect/models/order_line_item.rb +226 -0
- data/lib/square_connect/models/refund.rb +138 -59
- data/lib/square_connect/models/refund_status.rb +7 -133
- data/lib/square_connect/models/retrieve_customer_request.rb +176 -0
- data/lib/square_connect/models/retrieve_customer_response.rb +58 -31
- data/lib/square_connect/models/retrieve_transaction_request.rb +176 -0
- data/lib/square_connect/models/retrieve_transaction_response.rb +57 -30
- data/lib/square_connect/models/sort_order.rb +5 -133
- data/lib/square_connect/models/tender.rb +112 -65
- data/lib/square_connect/models/tender_card_details.rb +93 -40
- data/lib/square_connect/models/tender_card_details_entry_method.rb +8 -133
- data/lib/square_connect/models/tender_card_details_status.rb +7 -133
- data/lib/square_connect/models/tender_cash_details.rb +58 -31
- data/lib/square_connect/models/tender_type.rb +9 -133
- data/lib/square_connect/models/transaction.rb +132 -56
- data/lib/square_connect/models/transaction_product.rb +11 -133
- data/lib/square_connect/models/update_customer_request.rb +79 -59
- data/lib/square_connect/models/update_customer_response.rb +58 -31
- data/lib/square_connect/models/void_transaction_request.rb +176 -0
- data/lib/square_connect/models/void_transaction_response.rb +54 -26
- data/lib/square_connect/version.rb +2 -3
- data/spec/api/checkout_api_spec.rb +53 -0
- data/spec/api/customer_api_spec.rb +121 -0
- data/spec/api/customer_card_api_spec.rb +71 -0
- data/spec/api/location_api_spec.rb +58 -0
- data/spec/api/refund_api_spec.rb +75 -0
- data/spec/api/transaction_api_spec.rb +128 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/address_spec.rb +186 -0
- data/spec/models/capture_transaction_request_spec.rb +36 -0
- data/spec/models/capture_transaction_response_spec.rb +46 -0
- data/spec/models/card_brand_spec.rb +36 -0
- data/spec/models/card_spec.rb +106 -0
- data/spec/models/charge_request_spec.rb +146 -0
- data/spec/models/charge_response_spec.rb +56 -0
- data/spec/models/checkout_spec.rb +126 -0
- data/spec/models/country_spec.rb +36 -0
- data/spec/models/create_checkout_request_spec.rb +106 -0
- data/spec/models/create_checkout_response_spec.rb +56 -0
- data/spec/models/create_customer_card_request_spec.rb +66 -0
- data/spec/models/create_customer_card_response_spec.rb +56 -0
- data/spec/models/create_customer_request_spec.rb +126 -0
- data/spec/models/create_customer_response_spec.rb +56 -0
- data/spec/models/create_order_request_line_item_spec.rb +66 -0
- data/spec/models/create_order_request_order_spec.rb +56 -0
- data/spec/models/create_order_request_spec.rb +56 -0
- data/spec/models/create_refund_request_spec.rb +76 -0
- data/spec/models/create_refund_response_spec.rb +56 -0
- data/spec/models/currency_spec.rb +36 -0
- data/spec/models/customer_group_info_spec.rb +56 -0
- data/spec/models/customer_preferences_spec.rb +46 -0
- data/spec/models/customer_spec.rb +186 -0
- data/spec/models/delete_customer_card_request_spec.rb +36 -0
- data/spec/models/delete_customer_card_response_spec.rb +46 -0
- data/spec/models/delete_customer_request_spec.rb +36 -0
- data/spec/models/delete_customer_response_spec.rb +46 -0
- data/spec/models/error_category_spec.rb +36 -0
- data/spec/models/error_code_spec.rb +36 -0
- data/spec/models/error_spec.rb +76 -0
- data/spec/models/list_customers_request_spec.rb +46 -0
- data/spec/models/list_customers_response_spec.rb +66 -0
- data/spec/models/list_locations_request_spec.rb +36 -0
- data/spec/models/list_locations_response_spec.rb +56 -0
- data/spec/models/list_refunds_request_spec.rb +76 -0
- data/spec/models/list_refunds_response_spec.rb +66 -0
- data/spec/models/list_transactions_request_spec.rb +76 -0
- data/spec/models/list_transactions_response_spec.rb +66 -0
- data/spec/models/location_capability_spec.rb +36 -0
- data/spec/models/location_spec.rb +86 -0
- data/spec/models/money_spec.rb +56 -0
- data/spec/models/order_line_item_spec.rb +86 -0
- data/spec/models/order_spec.rb +86 -0
- data/spec/models/refund_spec.rb +126 -0
- data/spec/models/refund_status_spec.rb +36 -0
- data/spec/models/retrieve_customer_request_spec.rb +36 -0
- data/spec/models/retrieve_customer_response_spec.rb +56 -0
- data/spec/models/retrieve_transaction_request_spec.rb +36 -0
- data/spec/models/retrieve_transaction_response_spec.rb +56 -0
- data/spec/models/sort_order_spec.rb +36 -0
- data/spec/models/tender_card_details_entry_method_spec.rb +36 -0
- data/spec/models/tender_card_details_spec.rb +66 -0
- data/spec/models/tender_card_details_status_spec.rb +36 -0
- data/spec/models/tender_cash_details_spec.rb +56 -0
- data/spec/models/tender_spec.rb +146 -0
- data/spec/models/tender_type_spec.rb +36 -0
- data/spec/models/transaction_product_spec.rb +36 -0
- data/spec/models/transaction_spec.rb +136 -0
- data/spec/models/update_customer_request_spec.rb +126 -0
- data/spec/models/update_customer_response_spec.rb +56 -0
- data/spec/models/void_transaction_request_spec.rb +36 -0
- data/spec/models/void_transaction_response_spec.rb +46 -0
- data/spec/spec_helper.rb +115 -0
- data/square_connect.gemspec +22 -11
- data/travis-ci/accounts.enc +0 -0
- metadata +264 -31
@@ -1,147 +1,267 @@
|
|
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 Country
|
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
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
14
|
+
|
15
|
+
ZZ = "ZZ".freeze
|
16
|
+
AD = "AD".freeze
|
17
|
+
AE = "AE".freeze
|
18
|
+
AF = "AF".freeze
|
19
|
+
AG = "AG".freeze
|
20
|
+
AI = "AI".freeze
|
21
|
+
AL = "AL".freeze
|
22
|
+
AM = "AM".freeze
|
23
|
+
AO = "AO".freeze
|
24
|
+
AQ = "AQ".freeze
|
25
|
+
AR = "AR".freeze
|
26
|
+
AS = "AS".freeze
|
27
|
+
AT = "AT".freeze
|
28
|
+
AU = "AU".freeze
|
29
|
+
AW = "AW".freeze
|
30
|
+
AX = "AX".freeze
|
31
|
+
AZ = "AZ".freeze
|
32
|
+
BA = "BA".freeze
|
33
|
+
BB = "BB".freeze
|
34
|
+
BD = "BD".freeze
|
35
|
+
BE = "BE".freeze
|
36
|
+
BF = "BF".freeze
|
37
|
+
BG = "BG".freeze
|
38
|
+
BH = "BH".freeze
|
39
|
+
BI = "BI".freeze
|
40
|
+
BJ = "BJ".freeze
|
41
|
+
BL = "BL".freeze
|
42
|
+
BM = "BM".freeze
|
43
|
+
BN = "BN".freeze
|
44
|
+
BO = "BO".freeze
|
45
|
+
BQ = "BQ".freeze
|
46
|
+
BR = "BR".freeze
|
47
|
+
BS = "BS".freeze
|
48
|
+
BT = "BT".freeze
|
49
|
+
BV = "BV".freeze
|
50
|
+
BW = "BW".freeze
|
51
|
+
BY = "BY".freeze
|
52
|
+
BZ = "BZ".freeze
|
53
|
+
CA = "CA".freeze
|
54
|
+
CC = "CC".freeze
|
55
|
+
CD = "CD".freeze
|
56
|
+
CF = "CF".freeze
|
57
|
+
CG = "CG".freeze
|
58
|
+
CH = "CH".freeze
|
59
|
+
CI = "CI".freeze
|
60
|
+
CK = "CK".freeze
|
61
|
+
CL = "CL".freeze
|
62
|
+
CM = "CM".freeze
|
63
|
+
CN = "CN".freeze
|
64
|
+
CO = "CO".freeze
|
65
|
+
CR = "CR".freeze
|
66
|
+
CU = "CU".freeze
|
67
|
+
CV = "CV".freeze
|
68
|
+
CW = "CW".freeze
|
69
|
+
CX = "CX".freeze
|
70
|
+
CY = "CY".freeze
|
71
|
+
CZ = "CZ".freeze
|
72
|
+
DE = "DE".freeze
|
73
|
+
DJ = "DJ".freeze
|
74
|
+
DK = "DK".freeze
|
75
|
+
DM = "DM".freeze
|
76
|
+
DO = "DO".freeze
|
77
|
+
DZ = "DZ".freeze
|
78
|
+
EC = "EC".freeze
|
79
|
+
EE = "EE".freeze
|
80
|
+
EG = "EG".freeze
|
81
|
+
EH = "EH".freeze
|
82
|
+
ER = "ER".freeze
|
83
|
+
ES = "ES".freeze
|
84
|
+
ET = "ET".freeze
|
85
|
+
FI = "FI".freeze
|
86
|
+
FJ = "FJ".freeze
|
87
|
+
FK = "FK".freeze
|
88
|
+
FM = "FM".freeze
|
89
|
+
FO = "FO".freeze
|
90
|
+
FR = "FR".freeze
|
91
|
+
GA = "GA".freeze
|
92
|
+
GB = "GB".freeze
|
93
|
+
GD = "GD".freeze
|
94
|
+
GE = "GE".freeze
|
95
|
+
GF = "GF".freeze
|
96
|
+
GG = "GG".freeze
|
97
|
+
GH = "GH".freeze
|
98
|
+
GI = "GI".freeze
|
99
|
+
GL = "GL".freeze
|
100
|
+
GM = "GM".freeze
|
101
|
+
GN = "GN".freeze
|
102
|
+
GP = "GP".freeze
|
103
|
+
GQ = "GQ".freeze
|
104
|
+
GR = "GR".freeze
|
105
|
+
GS = "GS".freeze
|
106
|
+
GT = "GT".freeze
|
107
|
+
GU = "GU".freeze
|
108
|
+
GW = "GW".freeze
|
109
|
+
GY = "GY".freeze
|
110
|
+
HK = "HK".freeze
|
111
|
+
HM = "HM".freeze
|
112
|
+
HN = "HN".freeze
|
113
|
+
HR = "HR".freeze
|
114
|
+
HT = "HT".freeze
|
115
|
+
HU = "HU".freeze
|
116
|
+
ID = "ID".freeze
|
117
|
+
IE = "IE".freeze
|
118
|
+
IL = "IL".freeze
|
119
|
+
IM = "IM".freeze
|
120
|
+
IN = "IN".freeze
|
121
|
+
IO = "IO".freeze
|
122
|
+
IQ = "IQ".freeze
|
123
|
+
IR = "IR".freeze
|
124
|
+
IS = "IS".freeze
|
125
|
+
IT = "IT".freeze
|
126
|
+
JE = "JE".freeze
|
127
|
+
JM = "JM".freeze
|
128
|
+
JO = "JO".freeze
|
129
|
+
JP = "JP".freeze
|
130
|
+
KE = "KE".freeze
|
131
|
+
KG = "KG".freeze
|
132
|
+
KH = "KH".freeze
|
133
|
+
KI = "KI".freeze
|
134
|
+
KM = "KM".freeze
|
135
|
+
KN = "KN".freeze
|
136
|
+
KP = "KP".freeze
|
137
|
+
KR = "KR".freeze
|
138
|
+
KW = "KW".freeze
|
139
|
+
KY = "KY".freeze
|
140
|
+
KZ = "KZ".freeze
|
141
|
+
LA = "LA".freeze
|
142
|
+
LB = "LB".freeze
|
143
|
+
LC = "LC".freeze
|
144
|
+
LI = "LI".freeze
|
145
|
+
LK = "LK".freeze
|
146
|
+
LR = "LR".freeze
|
147
|
+
LS = "LS".freeze
|
148
|
+
LT = "LT".freeze
|
149
|
+
LU = "LU".freeze
|
150
|
+
LV = "LV".freeze
|
151
|
+
LY = "LY".freeze
|
152
|
+
MA = "MA".freeze
|
153
|
+
MC = "MC".freeze
|
154
|
+
MD = "MD".freeze
|
155
|
+
ME = "ME".freeze
|
156
|
+
MF = "MF".freeze
|
157
|
+
MG = "MG".freeze
|
158
|
+
MH = "MH".freeze
|
159
|
+
MK = "MK".freeze
|
160
|
+
ML = "ML".freeze
|
161
|
+
MM = "MM".freeze
|
162
|
+
MN = "MN".freeze
|
163
|
+
MO = "MO".freeze
|
164
|
+
MP = "MP".freeze
|
165
|
+
MQ = "MQ".freeze
|
166
|
+
MR = "MR".freeze
|
167
|
+
MS = "MS".freeze
|
168
|
+
MT = "MT".freeze
|
169
|
+
MU = "MU".freeze
|
170
|
+
MV = "MV".freeze
|
171
|
+
MW = "MW".freeze
|
172
|
+
MX = "MX".freeze
|
173
|
+
MY = "MY".freeze
|
174
|
+
MZ = "MZ".freeze
|
175
|
+
NA = "NA".freeze
|
176
|
+
NC = "NC".freeze
|
177
|
+
NE = "NE".freeze
|
178
|
+
NF = "NF".freeze
|
179
|
+
NG = "NG".freeze
|
180
|
+
NI = "NI".freeze
|
181
|
+
NL = "NL".freeze
|
182
|
+
NO = "NO".freeze
|
183
|
+
NP = "NP".freeze
|
184
|
+
NR = "NR".freeze
|
185
|
+
NU = "NU".freeze
|
186
|
+
NZ = "NZ".freeze
|
187
|
+
OM = "OM".freeze
|
188
|
+
PA = "PA".freeze
|
189
|
+
PE = "PE".freeze
|
190
|
+
PF = "PF".freeze
|
191
|
+
PG = "PG".freeze
|
192
|
+
PH = "PH".freeze
|
193
|
+
PK = "PK".freeze
|
194
|
+
PL = "PL".freeze
|
195
|
+
PM = "PM".freeze
|
196
|
+
PN = "PN".freeze
|
197
|
+
PR = "PR".freeze
|
198
|
+
PS = "PS".freeze
|
199
|
+
PT = "PT".freeze
|
200
|
+
PW = "PW".freeze
|
201
|
+
PY = "PY".freeze
|
202
|
+
QA = "QA".freeze
|
203
|
+
RE = "RE".freeze
|
204
|
+
RO = "RO".freeze
|
205
|
+
RS = "RS".freeze
|
206
|
+
RU = "RU".freeze
|
207
|
+
RW = "RW".freeze
|
208
|
+
SA = "SA".freeze
|
209
|
+
SB = "SB".freeze
|
210
|
+
SC = "SC".freeze
|
211
|
+
SD = "SD".freeze
|
212
|
+
SE = "SE".freeze
|
213
|
+
SG = "SG".freeze
|
214
|
+
SH = "SH".freeze
|
215
|
+
SI = "SI".freeze
|
216
|
+
SJ = "SJ".freeze
|
217
|
+
SK = "SK".freeze
|
218
|
+
SL = "SL".freeze
|
219
|
+
SM = "SM".freeze
|
220
|
+
SN = "SN".freeze
|
221
|
+
SO = "SO".freeze
|
222
|
+
SR = "SR".freeze
|
223
|
+
SS = "SS".freeze
|
224
|
+
ST = "ST".freeze
|
225
|
+
SV = "SV".freeze
|
226
|
+
SX = "SX".freeze
|
227
|
+
SY = "SY".freeze
|
228
|
+
SZ = "SZ".freeze
|
229
|
+
TC = "TC".freeze
|
230
|
+
TD = "TD".freeze
|
231
|
+
TF = "TF".freeze
|
232
|
+
TG = "TG".freeze
|
233
|
+
TH = "TH".freeze
|
234
|
+
TJ = "TJ".freeze
|
235
|
+
TK = "TK".freeze
|
236
|
+
TL = "TL".freeze
|
237
|
+
TM = "TM".freeze
|
238
|
+
TN = "TN".freeze
|
239
|
+
TO = "TO".freeze
|
240
|
+
TR = "TR".freeze
|
241
|
+
TT = "TT".freeze
|
242
|
+
TV = "TV".freeze
|
243
|
+
TW = "TW".freeze
|
244
|
+
TZ = "TZ".freeze
|
245
|
+
UA = "UA".freeze
|
246
|
+
UG = "UG".freeze
|
247
|
+
UM = "UM".freeze
|
248
|
+
US = "US".freeze
|
249
|
+
UY = "UY".freeze
|
250
|
+
UZ = "UZ".freeze
|
251
|
+
VA = "VA".freeze
|
252
|
+
VC = "VC".freeze
|
253
|
+
VE = "VE".freeze
|
254
|
+
VG = "VG".freeze
|
255
|
+
VI = "VI".freeze
|
256
|
+
VN = "VN".freeze
|
257
|
+
VU = "VU".freeze
|
258
|
+
WF = "WF".freeze
|
259
|
+
WS = "WS".freeze
|
260
|
+
YE = "YE".freeze
|
261
|
+
YT = "YT".freeze
|
262
|
+
ZA = "ZA".freeze
|
263
|
+
ZM = "ZM".freeze
|
264
|
+
ZW = "ZW".freeze
|
146
265
|
end
|
266
|
+
|
147
267
|
end
|
@@ -0,0 +1,316 @@
|
|
1
|
+
=begin
|
2
|
+
#Square Connect API
|
3
|
+
|
4
|
+
OpenAPI spec version: 2.0
|
5
|
+
|
6
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
7
|
+
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'date'
|
11
|
+
|
12
|
+
module SquareConnect
|
13
|
+
# Defines the parameters that can be included in the body of a request to the [CreateCheckout](#endpoint-createcheckout) endpoint.
|
14
|
+
class CreateCheckoutRequest
|
15
|
+
# A unique string that identifies this checkout among others you've created. It can be any valid string but must be unique for every order sent to Square Checkout for a given location ID. The idempotency key is used to avoid processing the same order more than once. If you're unsure whether a particular checkout was created successfully, you can reattempt it with the same idempotency key and all the same other parameters without worrying about creating duplicates. We recommend using a random number/string generator native to the language you are working in to generate strings for your idempotency keys. See [Idempotency keys](#idempotencykeys) for more information.
|
16
|
+
attr_accessor :idempotency_key
|
17
|
+
|
18
|
+
# The order including line items to be checked out.
|
19
|
+
attr_accessor :order
|
20
|
+
|
21
|
+
# If `true`, Square Checkout will collect shipping information on your behalf and store that information with the transaction information in your Square Dashboard. Default is `false`.
|
22
|
+
attr_accessor :ask_for_shipping_address
|
23
|
+
|
24
|
+
# The email address to display on the Square Checkout confirmation page and confirmation email that the buyer can use to contact the merchant. If this value is not set, the confirmation page and email will display the primary email address associated with the merchant's Square account. Default is unset.
|
25
|
+
attr_accessor :merchant_support_email
|
26
|
+
|
27
|
+
# If provided, the buyer's email is pre-populated on the checkout page as an editable text field. Default is unset.
|
28
|
+
attr_accessor :pre_populate_buyer_email
|
29
|
+
|
30
|
+
# If provided, the buyer's shipping info is pre-populated on the checkout page as editable text fields. Default is unset.
|
31
|
+
attr_accessor :pre_populate_shipping_address
|
32
|
+
|
33
|
+
# The URL to redirect to after checkout is completed with `checkoutId`, Square's `orderId`, `transactionId`, and `referenceId` appended as URL parameters. For example, if the provided redirect_url is `http://www.example.com/order-complete`, a successful transaction redirects the customer to: `http://www.example.com/order-complete?checkoutId=xxxxxx&orderId=xxxxxx&referenceId=xxxxxx&transactionId=xxxxxx` If you do not provide a redirect URL, Square Checkout will display an order confirmation page on your behalf; however Square strongly recommends that you provide a redirect URL so you can verify the transaction results and finalize the order through your existing/normal confirmation workflow. Default is unset.
|
34
|
+
attr_accessor :redirect_url
|
35
|
+
|
36
|
+
|
37
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
38
|
+
def self.attribute_map
|
39
|
+
{
|
40
|
+
:'idempotency_key' => :'idempotency_key',
|
41
|
+
:'order' => :'order',
|
42
|
+
:'ask_for_shipping_address' => :'ask_for_shipping_address',
|
43
|
+
:'merchant_support_email' => :'merchant_support_email',
|
44
|
+
:'pre_populate_buyer_email' => :'pre_populate_buyer_email',
|
45
|
+
:'pre_populate_shipping_address' => :'pre_populate_shipping_address',
|
46
|
+
:'redirect_url' => :'redirect_url'
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# Attribute type mapping.
|
51
|
+
def self.swagger_types
|
52
|
+
{
|
53
|
+
:'idempotency_key' => :'String',
|
54
|
+
:'order' => :'CreateOrderRequestOrder',
|
55
|
+
:'ask_for_shipping_address' => :'BOOLEAN',
|
56
|
+
:'merchant_support_email' => :'String',
|
57
|
+
:'pre_populate_buyer_email' => :'String',
|
58
|
+
:'pre_populate_shipping_address' => :'Address',
|
59
|
+
:'redirect_url' => :'String'
|
60
|
+
}
|
61
|
+
end
|
62
|
+
|
63
|
+
# Initializes the object
|
64
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
65
|
+
def initialize(attributes = {})
|
66
|
+
return unless attributes.is_a?(Hash)
|
67
|
+
|
68
|
+
# convert string to symbol for hash key
|
69
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
70
|
+
|
71
|
+
if attributes.has_key?(:'idempotency_key')
|
72
|
+
self.idempotency_key = attributes[:'idempotency_key']
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.has_key?(:'order')
|
76
|
+
self.order = attributes[:'order']
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.has_key?(:'ask_for_shipping_address')
|
80
|
+
self.ask_for_shipping_address = attributes[:'ask_for_shipping_address']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.has_key?(:'merchant_support_email')
|
84
|
+
self.merchant_support_email = attributes[:'merchant_support_email']
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.has_key?(:'pre_populate_buyer_email')
|
88
|
+
self.pre_populate_buyer_email = attributes[:'pre_populate_buyer_email']
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.has_key?(:'pre_populate_shipping_address')
|
92
|
+
self.pre_populate_shipping_address = attributes[:'pre_populate_shipping_address']
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.has_key?(:'redirect_url')
|
96
|
+
self.redirect_url = attributes[:'redirect_url']
|
97
|
+
end
|
98
|
+
|
99
|
+
end
|
100
|
+
|
101
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
102
|
+
# @return Array for valid properies with the reasons
|
103
|
+
def list_invalid_properties
|
104
|
+
invalid_properties = Array.new
|
105
|
+
if @idempotency_key.nil?
|
106
|
+
invalid_properties.push("invalid value for 'idempotency_key', idempotency_key cannot be nil.")
|
107
|
+
end
|
108
|
+
|
109
|
+
if @idempotency_key.to_s.length > 192
|
110
|
+
invalid_properties.push("invalid value for 'idempotency_key', the character length must be smaller than or equal to 192.")
|
111
|
+
end
|
112
|
+
|
113
|
+
if @idempotency_key.to_s.length < 1
|
114
|
+
invalid_properties.push("invalid value for 'idempotency_key', the character length must be great than or equal to 1.")
|
115
|
+
end
|
116
|
+
|
117
|
+
if @order.nil?
|
118
|
+
invalid_properties.push("invalid value for 'order', order cannot be nil.")
|
119
|
+
end
|
120
|
+
|
121
|
+
if !@merchant_support_email.nil? && @merchant_support_email.to_s.length > 254
|
122
|
+
invalid_properties.push("invalid value for 'merchant_support_email', the character length must be smaller than or equal to 254.")
|
123
|
+
end
|
124
|
+
|
125
|
+
if !@pre_populate_buyer_email.nil? && @pre_populate_buyer_email.to_s.length > 254
|
126
|
+
invalid_properties.push("invalid value for 'pre_populate_buyer_email', the character length must be smaller than or equal to 254.")
|
127
|
+
end
|
128
|
+
|
129
|
+
return invalid_properties
|
130
|
+
end
|
131
|
+
|
132
|
+
# Check to see if the all the properties in the model are valid
|
133
|
+
# @return true if the model is valid
|
134
|
+
def valid?
|
135
|
+
return false if @idempotency_key.nil?
|
136
|
+
return false if @idempotency_key.to_s.length > 192
|
137
|
+
return false if @idempotency_key.to_s.length < 1
|
138
|
+
return false if @order.nil?
|
139
|
+
return false if !@merchant_support_email.nil? && @merchant_support_email.to_s.length > 254
|
140
|
+
return false if !@pre_populate_buyer_email.nil? && @pre_populate_buyer_email.to_s.length > 254
|
141
|
+
return true
|
142
|
+
end
|
143
|
+
|
144
|
+
# Custom attribute writer method with validation
|
145
|
+
# @param [Object] idempotency_key Value to be assigned
|
146
|
+
def idempotency_key=(idempotency_key)
|
147
|
+
if idempotency_key.nil?
|
148
|
+
fail ArgumentError, "idempotency_key cannot be nil"
|
149
|
+
end
|
150
|
+
|
151
|
+
if idempotency_key.to_s.length > 192
|
152
|
+
fail ArgumentError, "invalid value for 'idempotency_key', the character length must be smaller than or equal to 192."
|
153
|
+
end
|
154
|
+
|
155
|
+
if idempotency_key.to_s.length < 1
|
156
|
+
fail ArgumentError, "invalid value for 'idempotency_key', the character length must be great than or equal to 1."
|
157
|
+
end
|
158
|
+
|
159
|
+
@idempotency_key = idempotency_key
|
160
|
+
end
|
161
|
+
|
162
|
+
# Custom attribute writer method with validation
|
163
|
+
# @param [Object] merchant_support_email Value to be assigned
|
164
|
+
def merchant_support_email=(merchant_support_email)
|
165
|
+
|
166
|
+
if !merchant_support_email.nil? && merchant_support_email.to_s.length > 254
|
167
|
+
fail ArgumentError, "invalid value for 'merchant_support_email', the character length must be smaller than or equal to 254."
|
168
|
+
end
|
169
|
+
|
170
|
+
@merchant_support_email = merchant_support_email
|
171
|
+
end
|
172
|
+
|
173
|
+
# Custom attribute writer method with validation
|
174
|
+
# @param [Object] pre_populate_buyer_email Value to be assigned
|
175
|
+
def pre_populate_buyer_email=(pre_populate_buyer_email)
|
176
|
+
|
177
|
+
if !pre_populate_buyer_email.nil? && pre_populate_buyer_email.to_s.length > 254
|
178
|
+
fail ArgumentError, "invalid value for 'pre_populate_buyer_email', the character length must be smaller than or equal to 254."
|
179
|
+
end
|
180
|
+
|
181
|
+
@pre_populate_buyer_email = pre_populate_buyer_email
|
182
|
+
end
|
183
|
+
|
184
|
+
# Checks equality by comparing each attribute.
|
185
|
+
# @param [Object] Object to be compared
|
186
|
+
def ==(o)
|
187
|
+
return true if self.equal?(o)
|
188
|
+
self.class == o.class &&
|
189
|
+
idempotency_key == o.idempotency_key &&
|
190
|
+
order == o.order &&
|
191
|
+
ask_for_shipping_address == o.ask_for_shipping_address &&
|
192
|
+
merchant_support_email == o.merchant_support_email &&
|
193
|
+
pre_populate_buyer_email == o.pre_populate_buyer_email &&
|
194
|
+
pre_populate_shipping_address == o.pre_populate_shipping_address &&
|
195
|
+
redirect_url == o.redirect_url
|
196
|
+
end
|
197
|
+
|
198
|
+
# @see the `==` method
|
199
|
+
# @param [Object] Object to be compared
|
200
|
+
def eql?(o)
|
201
|
+
self == o
|
202
|
+
end
|
203
|
+
|
204
|
+
# Calculates hash code according to all attributes.
|
205
|
+
# @return [Fixnum] Hash code
|
206
|
+
def hash
|
207
|
+
[idempotency_key, order, ask_for_shipping_address, merchant_support_email, pre_populate_buyer_email, pre_populate_shipping_address, redirect_url].hash
|
208
|
+
end
|
209
|
+
|
210
|
+
# Builds the object from hash
|
211
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
212
|
+
# @return [Object] Returns the model itself
|
213
|
+
def build_from_hash(attributes)
|
214
|
+
return nil unless attributes.is_a?(Hash)
|
215
|
+
self.class.swagger_types.each_pair do |key, type|
|
216
|
+
if type =~ /\AArray<(.*)>/i
|
217
|
+
# check to ensure the input is an array given that the the attribute
|
218
|
+
# is documented as an array but the input is not
|
219
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
220
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
221
|
+
end
|
222
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
223
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
224
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
225
|
+
end
|
226
|
+
|
227
|
+
self
|
228
|
+
end
|
229
|
+
|
230
|
+
# Deserializes the data based on type
|
231
|
+
# @param string type Data type
|
232
|
+
# @param string value Value to be deserialized
|
233
|
+
# @return [Object] Deserialized data
|
234
|
+
def _deserialize(type, value)
|
235
|
+
case type.to_sym
|
236
|
+
when :DateTime
|
237
|
+
DateTime.parse(value)
|
238
|
+
when :Date
|
239
|
+
Date.parse(value)
|
240
|
+
when :String
|
241
|
+
value.to_s
|
242
|
+
when :Integer
|
243
|
+
value.to_i
|
244
|
+
when :Float
|
245
|
+
value.to_f
|
246
|
+
when :BOOLEAN
|
247
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
248
|
+
true
|
249
|
+
else
|
250
|
+
false
|
251
|
+
end
|
252
|
+
when :Object
|
253
|
+
# generic object (usually a Hash), return directly
|
254
|
+
value
|
255
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
256
|
+
inner_type = Regexp.last_match[:inner_type]
|
257
|
+
value.map { |v| _deserialize(inner_type, v) }
|
258
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
259
|
+
k_type = Regexp.last_match[:k_type]
|
260
|
+
v_type = Regexp.last_match[:v_type]
|
261
|
+
{}.tap do |hash|
|
262
|
+
value.each do |k, v|
|
263
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
264
|
+
end
|
265
|
+
end
|
266
|
+
else # model
|
267
|
+
temp_model = SquareConnect.const_get(type).new
|
268
|
+
temp_model.build_from_hash(value)
|
269
|
+
end
|
270
|
+
end
|
271
|
+
|
272
|
+
# Returns the string representation of the object
|
273
|
+
# @return [String] String presentation of the object
|
274
|
+
def to_s
|
275
|
+
to_hash.to_s
|
276
|
+
end
|
277
|
+
|
278
|
+
# to_body is an alias to to_hash (backward compatibility)
|
279
|
+
# @return [Hash] Returns the object in the form of hash
|
280
|
+
def to_body
|
281
|
+
to_hash
|
282
|
+
end
|
283
|
+
|
284
|
+
# Returns the object in the form of hash
|
285
|
+
# @return [Hash] Returns the object in the form of hash
|
286
|
+
def to_hash
|
287
|
+
hash = {}
|
288
|
+
self.class.attribute_map.each_pair do |attr, param|
|
289
|
+
value = self.send(attr)
|
290
|
+
next if value.nil?
|
291
|
+
hash[param] = _to_hash(value)
|
292
|
+
end
|
293
|
+
hash
|
294
|
+
end
|
295
|
+
|
296
|
+
# Outputs non-array value in the form of hash
|
297
|
+
# For object, use to_hash. Otherwise, just return the value
|
298
|
+
# @param [Object] value Any valid value
|
299
|
+
# @return [Hash] Returns the value in the form of hash
|
300
|
+
def _to_hash(value)
|
301
|
+
if value.is_a?(Array)
|
302
|
+
value.compact.map{ |v| _to_hash(v) }
|
303
|
+
elsif value.is_a?(Hash)
|
304
|
+
{}.tap do |hash|
|
305
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
306
|
+
end
|
307
|
+
elsif value.respond_to? :to_hash
|
308
|
+
value.to_hash
|
309
|
+
else
|
310
|
+
value
|
311
|
+
end
|
312
|
+
end
|
313
|
+
|
314
|
+
end
|
315
|
+
|
316
|
+
end
|