square_connect 2.1.1.99 → 2.1.1.106
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/spec/api/checkout_api_spec.rb +114 -16
- metadata +2 -4
- data/spec/models/create_order_request_order_spec.rb +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bb1e68687abe1be0510709f4b331c13e53b9248
|
4
|
+
data.tar.gz: da99adcd07f8124ad0f31fcfb3b92a71ebc7acb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a92e8fc80a3154f1cedde275ede340b0c6cf4aa12e11b2fabd5f35d7c23b3f7bcace37a64779afd3a28e1c862c9e4cbd24a96d86f217343d07b366892d14e14e
|
7
|
+
data.tar.gz: c820dbff99c8bdfc25c1159aa7f102ebab0d406b744671bb365edffafddf2f8bf661231c57b49dd403361bdee24f39fe52dce7b268adee7c1e6759186277e83a
|
@@ -9,36 +9,134 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
9
|
|
10
10
|
require 'spec_helper'
|
11
11
|
require 'json'
|
12
|
+
require 'securerandom'
|
12
13
|
|
13
14
|
# Unit tests for SquareConnect::CheckoutApi
|
14
15
|
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
15
16
|
# Please update as you see appropriate
|
16
17
|
describe 'CheckoutApi' do
|
17
|
-
before do
|
18
|
-
# run before each test
|
19
|
-
@instance = SquareConnect::CheckoutApi.new
|
20
|
-
end
|
21
18
|
|
22
|
-
|
23
|
-
|
19
|
+
let(:accounts) { load_accounts() }
|
20
|
+
let(:account) { accounts['US-Prod-Sandbox'] }
|
21
|
+
let(:location_id) { account['location_id'] }
|
22
|
+
let(:instance) do
|
23
|
+
configuration = SquareConnect::Configuration.new do |config|
|
24
|
+
config.access_token = account['access_token']
|
25
|
+
end
|
26
|
+
client = SquareConnect::ApiClient.new(configuration)
|
27
|
+
|
28
|
+
SquareConnect::CheckoutApi.new(client)
|
24
29
|
end
|
25
30
|
|
31
|
+
|
26
32
|
describe 'test an instance of CheckoutApi' do
|
27
33
|
it 'should create an instact of CheckoutApi' do
|
28
|
-
expect(
|
34
|
+
expect(instance).to be_instance_of(SquareConnect::CheckoutApi)
|
29
35
|
end
|
30
36
|
end
|
31
37
|
|
32
|
-
# unit tests for create_checkout
|
33
|
-
# CreateCheckout
|
34
|
-
# 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.
|
35
|
-
# @param location_id The ID of the business location to associate the checkout with.
|
36
|
-
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
37
|
-
# @param [Hash] opts the optional parameters
|
38
|
-
# @return [CreateCheckoutResponse]
|
39
38
|
describe 'create_checkout test' do
|
40
|
-
|
41
|
-
|
39
|
+
|
40
|
+
let(:request) do
|
41
|
+
{
|
42
|
+
idempotency_key: SecureRandom.uuid,
|
43
|
+
order: {
|
44
|
+
reference_id: 'reference_id',
|
45
|
+
line_items: [
|
46
|
+
{
|
47
|
+
name: 'Printed T Shirt',
|
48
|
+
quantity: '2',
|
49
|
+
base_price_money: {
|
50
|
+
amount: 1500,
|
51
|
+
currency: 'USD'
|
52
|
+
},
|
53
|
+
discounts: [
|
54
|
+
{
|
55
|
+
name: '7% off previous season item',
|
56
|
+
percentage: '7'
|
57
|
+
},
|
58
|
+
{
|
59
|
+
name: '$3 off Customer Discount',
|
60
|
+
amount_money: {
|
61
|
+
amount: 300,
|
62
|
+
currency: 'USD'
|
63
|
+
}
|
64
|
+
}
|
65
|
+
]
|
66
|
+
},
|
67
|
+
{
|
68
|
+
name: 'Slim Jeans',
|
69
|
+
quantity: '1',
|
70
|
+
base_price_money: {
|
71
|
+
amount: 2500,
|
72
|
+
currency: 'USD'
|
73
|
+
}
|
74
|
+
},
|
75
|
+
{
|
76
|
+
name: 'Woven Sweater',
|
77
|
+
quantity: '3',
|
78
|
+
base_price_money: {
|
79
|
+
amount: 3500,
|
80
|
+
currency: 'USD'
|
81
|
+
},
|
82
|
+
discounts: [
|
83
|
+
{
|
84
|
+
name: '$11 off Customer Discount',
|
85
|
+
amount_money: {
|
86
|
+
amount: 1100,
|
87
|
+
currency: 'USD'
|
88
|
+
}
|
89
|
+
}
|
90
|
+
],
|
91
|
+
taxes: [
|
92
|
+
{
|
93
|
+
name: 'Fair Trade Tax',
|
94
|
+
percentage: '5'
|
95
|
+
}
|
96
|
+
]
|
97
|
+
}
|
98
|
+
],
|
99
|
+
discounts: [
|
100
|
+
{
|
101
|
+
name: "Father's day 12% OFF",
|
102
|
+
percentage: '12'
|
103
|
+
},
|
104
|
+
{
|
105
|
+
name: "Global Sales $55 OFF",
|
106
|
+
amount_money: {
|
107
|
+
amount: 5500,
|
108
|
+
currency: 'USD'
|
109
|
+
}
|
110
|
+
}
|
111
|
+
],
|
112
|
+
taxes: [
|
113
|
+
{
|
114
|
+
name: 'Sales Tax',
|
115
|
+
percentage: '8.5'
|
116
|
+
}
|
117
|
+
]
|
118
|
+
},
|
119
|
+
ask_for_shipping_address: true,
|
120
|
+
merchant_support_email: 'merchant+support@website.com',
|
121
|
+
pre_populate_buyer_email: 'example@email.com',
|
122
|
+
pre_populate_shipping_address: {
|
123
|
+
address_line_1: '1455 Market St.',
|
124
|
+
address_line_2: 'Suite 600',
|
125
|
+
locality: 'San Francisco',
|
126
|
+
administrative_district_level_1: 'CA',
|
127
|
+
postal_code: '94103',
|
128
|
+
country: 'US',
|
129
|
+
first_name: 'Jane',
|
130
|
+
last_name: 'Doe'
|
131
|
+
},
|
132
|
+
redirect_url: 'https://merchant.website.com/order-confirm'
|
133
|
+
}
|
134
|
+
end
|
135
|
+
it "should create a checkout object" do
|
136
|
+
response = instance.create_checkout(location_id, request)
|
137
|
+
|
138
|
+
expect(response.errors).to be_nil
|
139
|
+
expect(response.checkout.checkout_page_url).to start_with("https://connect.")
|
42
140
|
end
|
43
141
|
end
|
44
142
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: square_connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.1.
|
4
|
+
version: 2.1.1.106
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Square, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -596,7 +596,6 @@ files:
|
|
596
596
|
- spec/models/create_customer_request_spec.rb
|
597
597
|
- spec/models/create_customer_response_spec.rb
|
598
598
|
- spec/models/create_order_request_line_item_spec.rb
|
599
|
-
- spec/models/create_order_request_order_spec.rb
|
600
599
|
- spec/models/create_refund_request_spec.rb
|
601
600
|
- spec/models/create_refund_response_spec.rb
|
602
601
|
- spec/models/currency_spec.rb
|
@@ -789,7 +788,6 @@ test_files:
|
|
789
788
|
- spec/models/create_customer_request_spec.rb
|
790
789
|
- spec/models/create_customer_response_spec.rb
|
791
790
|
- spec/models/create_order_request_line_item_spec.rb
|
792
|
-
- spec/models/create_order_request_order_spec.rb
|
793
791
|
- spec/models/create_refund_request_spec.rb
|
794
792
|
- spec/models/create_refund_response_spec.rb
|
795
793
|
- spec/models/currency_spec.rb
|
@@ -1,45 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Square Connect API
|
3
|
-
|
4
|
-
OpenAPI spec version: 2.0
|
5
|
-
Contact: developers@squareup.com
|
6
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
7
|
-
|
8
|
-
=end
|
9
|
-
|
10
|
-
require 'spec_helper'
|
11
|
-
require 'json'
|
12
|
-
require 'date'
|
13
|
-
|
14
|
-
# Unit tests for SquareConnect::CreateOrderRequestOrder
|
15
|
-
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
16
|
-
# Please update as you see appropriate
|
17
|
-
describe 'CreateOrderRequestOrder' do
|
18
|
-
before do
|
19
|
-
# run before each test
|
20
|
-
@instance = SquareConnect::CreateOrderRequestOrder.new
|
21
|
-
end
|
22
|
-
|
23
|
-
after do
|
24
|
-
# run after each test
|
25
|
-
end
|
26
|
-
|
27
|
-
describe 'test an instance of CreateOrderRequestOrder' do
|
28
|
-
it 'should create an instact of CreateOrderRequestOrder' do
|
29
|
-
expect(@instance).to be_instance_of(SquareConnect::CreateOrderRequestOrder)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
describe 'test attribute "reference_id"' do
|
33
|
-
it 'should work' do
|
34
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
describe 'test attribute "line_items"' do
|
39
|
-
it 'should work' do
|
40
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|
45
|
-
|