quicktravel_client 3.8.0 → 3.8.1
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/CHANGELOG.md +4 -0
- data/lib/quick_travel/checkout.rb +0 -1
- data/lib/quick_travel/version.rb +1 -1
- data/spec/checkout_spec.rb +0 -182
- data/spec/support/coverage_loader.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b571276490332c20a8f3590a5fd8db3b1829c4ee997abd52637f16fd60faf08f
|
4
|
+
data.tar.gz: a113d127a0b9e43284651a6c655d09f6580be932dc95f155abddaaf589a609e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56e1275a4222457a5de43a9894680c5c9e949cb83fd9b160c4c4db3f5d40c008741dc6ed5ee75f4a613cbea5dd03dc169c83bf69e272cd9162c9cf62f32fbd72
|
7
|
+
data.tar.gz: 2889b499da18348ca09d8474434cefbb8d4cfd3ad5f1ae110aa1417bd1dc9b7c929564545b18f6fdbac14dd48c19ff990d19c18188edb3289b0d51626352b0a4
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
This changelog adheres to [Keep a CHANGELOG](http://keepachangelog.com/).
|
5
5
|
|
6
|
+
## [3.8.1]
|
7
|
+
### Changed
|
8
|
+
- [DC-3033] Reverse changes in checkout class to fix polipay redirection in EcomEngine
|
9
|
+
|
6
10
|
## [3.8.0]
|
7
11
|
### Added
|
8
12
|
- [DC-1794] Update httparty to allow caching the whole response, also add namespace to cache key
|
@@ -47,7 +47,6 @@ module QuickTravel
|
|
47
47
|
def self.attributes_for
|
48
48
|
attrs = yield
|
49
49
|
attrs[:completed] = attrs['progress'] == 'completed'
|
50
|
-
attrs[:completed] = attrs['successful'] if attrs['successful'].present?
|
51
50
|
attrs[:successful] = attrs[:completed]
|
52
51
|
attrs
|
53
52
|
rescue AdapterError => e
|
data/lib/quick_travel/version.rb
CHANGED
data/spec/checkout_spec.rb
CHANGED
@@ -12,186 +12,4 @@ describe QuickTravel::Checkout do
|
|
12
12
|
expect(token.keys).to eq [:client_token]
|
13
13
|
expect(token[:client_token]).to match /^[0-9A-Za-z\=]+$/
|
14
14
|
end
|
15
|
-
|
16
|
-
context 'Modern Opal Pay' do
|
17
|
-
context 'failed payment' do
|
18
|
-
let!(:booking) {
|
19
|
-
VCR.use_cassette('opal_modern_pay_failed_booking') do
|
20
|
-
QuickTravel.config.version = 4
|
21
|
-
QuickTravel::Booking.create
|
22
|
-
end
|
23
|
-
}
|
24
|
-
let(:create_payment_request) {
|
25
|
-
{
|
26
|
-
booking_id: booking.id,
|
27
|
-
payment: {
|
28
|
-
payment_type_id: 10,
|
29
|
-
amount_in_cents: 10,
|
30
|
-
uid: 'modern-opal-failed-uid',
|
31
|
-
comment: 'Test Opal Payment'
|
32
|
-
}
|
33
|
-
}
|
34
|
-
}
|
35
|
-
|
36
|
-
let!(:create_payment_response) {
|
37
|
-
VCR.use_cassette('opal_modern_pay_failed_create') do
|
38
|
-
QuickTravel::Checkout.create(create_payment_request)
|
39
|
-
end
|
40
|
-
}
|
41
|
-
|
42
|
-
let(:update_payment_request) {
|
43
|
-
{
|
44
|
-
gateway_response: {
|
45
|
-
raw_response: '{
|
46
|
-
"CardNumber": 3085227007682330,
|
47
|
-
"CardBalance": 6546,
|
48
|
-
"CardSequenceNumber": 55,
|
49
|
-
"CILAmount": 0,
|
50
|
-
"AuthorizedAmount": 890,
|
51
|
-
"SalesReferenceNumber": 53183943,
|
52
|
-
"TransactionDTM": "2018-01-04T09:00:43.106",
|
53
|
-
"VoidTransactionReferenceNumber": 1271099697,
|
54
|
-
"CardBlockState": false,
|
55
|
-
"AutoloadAmount": 0
|
56
|
-
}',
|
57
|
-
meta_data: {
|
58
|
-
applicationInstanceId: 101166,
|
59
|
-
operatorId: 'an_operator'
|
60
|
-
},
|
61
|
-
success: false
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
65
|
-
|
66
|
-
let(:update_payment_response) {
|
67
|
-
VCR.use_cassette('opal_modern_pay_failed_update') do
|
68
|
-
QuickTravel::Checkout.update(create_payment_response.id, update_payment_request)
|
69
|
-
end
|
70
|
-
}
|
71
|
-
|
72
|
-
let(:expected_create_attributes) { { completable: false } }
|
73
|
-
let(:expected_update_attributes) { { successful: false } }
|
74
|
-
it 'should update correctly' do
|
75
|
-
expect(create_payment_response).to have_attributes(expected_create_attributes)
|
76
|
-
expect(update_payment_response).to have_attributes(expected_update_attributes)
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
context 'successful payment' do
|
81
|
-
let!(:booking) {
|
82
|
-
VCR.use_cassette('opal_modern_pay_successful_booking') do
|
83
|
-
QuickTravel.config.version = 4
|
84
|
-
QuickTravel::Booking.create
|
85
|
-
end
|
86
|
-
}
|
87
|
-
let(:payment_create_request) {
|
88
|
-
{
|
89
|
-
booking_id: booking.id,
|
90
|
-
payment: {
|
91
|
-
payment_type_id: 10,
|
92
|
-
amount_in_cents: 10,
|
93
|
-
uid: 'modern-opal-uid',
|
94
|
-
comment: 'Test Opal Payment'
|
95
|
-
}
|
96
|
-
}
|
97
|
-
}
|
98
|
-
|
99
|
-
let!(:create_payment_response) {
|
100
|
-
VCR.use_cassette('opal_modern_pay_successful_response') do
|
101
|
-
QuickTravel::Checkout.create(payment_create_request)
|
102
|
-
end
|
103
|
-
}
|
104
|
-
|
105
|
-
let(:update_payment_request) {
|
106
|
-
{
|
107
|
-
gateway_response: {
|
108
|
-
raw_response: '{
|
109
|
-
"CardNumber": 3085227007682330,
|
110
|
-
"CardBalance": 6546,
|
111
|
-
"CardSequenceNumber": 55,
|
112
|
-
"CILAmount": 0,
|
113
|
-
"AuthorizedAmount": 890,
|
114
|
-
"SalesReferenceNumber": 53183943,
|
115
|
-
"TransactionDTM": "2018-01-04T09:00:43.106",
|
116
|
-
"TransactionReferenceNumber": 1271099697,
|
117
|
-
"CardBlockState": false,
|
118
|
-
"AutoloadAmount": 0
|
119
|
-
}',
|
120
|
-
meta_data: {
|
121
|
-
applicationInstanceId: 101166,
|
122
|
-
operatorId: 'an_operator'
|
123
|
-
},
|
124
|
-
success: true
|
125
|
-
}
|
126
|
-
}
|
127
|
-
}
|
128
|
-
|
129
|
-
let(:update_payment_response) {
|
130
|
-
VCR.use_cassette('opal_modern_pay_successful_update_response') do
|
131
|
-
QuickTravel::Checkout.update(create_payment_response.id, update_payment_request)
|
132
|
-
end
|
133
|
-
}
|
134
|
-
|
135
|
-
let(:expected_create_attributes) { { completable: false } }
|
136
|
-
let(:expected_update_attributes) { { successful: true } }
|
137
|
-
it 'should update correctly' do
|
138
|
-
expect(create_payment_response).to have_attributes(expected_create_attributes)
|
139
|
-
expect(update_payment_response).to have_attributes(expected_update_attributes)
|
140
|
-
end
|
141
|
-
end
|
142
|
-
end
|
143
|
-
|
144
|
-
context 'Opal Pay' do
|
145
|
-
let(:booking) {
|
146
|
-
VCR.use_cassette('opal_pay_booking') do
|
147
|
-
QuickTravel.config.version = 4
|
148
|
-
QuickTravel::Booking.create
|
149
|
-
end
|
150
|
-
}
|
151
|
-
|
152
|
-
let(:payment_create_request) {
|
153
|
-
{
|
154
|
-
booking_id: booking.id,
|
155
|
-
payment: {
|
156
|
-
gateway_response: '{
|
157
|
-
"CardNumber": 3085227007682330,
|
158
|
-
"CardBalance": 6546,
|
159
|
-
"CardSequenceNumber": 55,
|
160
|
-
"CILAmount": 0,
|
161
|
-
"AuthorizedAmount": 890,
|
162
|
-
"SalesReferenceNumber": 53183943,
|
163
|
-
"TransactionDTM": "2018-01-04T09:00:43.106",
|
164
|
-
"TransactionReferenceNumber": 1271099697,
|
165
|
-
"CardBlockState": false,
|
166
|
-
"AutoloadAmount": 0
|
167
|
-
}',
|
168
|
-
meta_data: {
|
169
|
-
applicationInstanceId: 101166,
|
170
|
-
operatorId: 'an_operator'
|
171
|
-
},
|
172
|
-
payment_type_id: 10,
|
173
|
-
amount_in_cents: 10,
|
174
|
-
uid: 'opal-uid',
|
175
|
-
comment: 'Test Opal Payment'
|
176
|
-
}
|
177
|
-
}
|
178
|
-
}
|
179
|
-
|
180
|
-
subject(:response) {
|
181
|
-
VCR.use_cassette('opal_pay') do
|
182
|
-
QuickTravel::Checkout.create(payment_create_request)
|
183
|
-
end
|
184
|
-
}
|
185
|
-
|
186
|
-
let(:expected_attributes) {
|
187
|
-
{
|
188
|
-
completable: true,
|
189
|
-
completed: true,
|
190
|
-
progress: 'completed',
|
191
|
-
successful: true
|
192
|
-
}
|
193
|
-
}
|
194
|
-
|
195
|
-
it { is_expected.to have_attributes(expected_attributes) }
|
196
|
-
end
|
197
15
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quicktravel_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.8.
|
4
|
+
version: 3.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Noack
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2020-01-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|