quicktravel_client 2.4.1 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +4 -1
- data/lib/quick_travel/checkout.rb +4 -0
- data/lib/quick_travel/version.rb +1 -1
- data/spec/checkout_spec.rb +15 -0
- data/spec/support/cassettes/checkout_client_token.yml +61 -0
- data/spec/support/coverage_loader.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f81983f10a25aba05f6ffcf08fff4793edd3bb7
|
4
|
+
data.tar.gz: 3d8643c916f6010fd5e7a389320b6d56edc620c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37dbf45b3f41fb3405d220e5ea61ffba373a3476d04523af0d710c596b861e09a918b45456818568728d90b1912d6de6aedd0e0ad775d6d346a3e996c4c5e513
|
7
|
+
data.tar.gz: c1255acb3891ceefb19247c739f0740d556abfb4fc562126c3ecdd5b5aaecc88e2359bae3d5778dd516ab2a1c0e6223b4ee2b417f414ff0f623b66b1e5dae425
|
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
|
+
## [2.5.0]
|
7
|
+
### Added
|
8
|
+
- Add call to get client token
|
9
|
+
|
6
10
|
## [2.4.1]
|
7
11
|
### Changed
|
8
12
|
- Handle nil values for empty lists
|
data/README.md
CHANGED
@@ -20,7 +20,10 @@ gem 'quicktravel_client'
|
|
20
20
|
|
21
21
|
In QuickTravel:
|
22
22
|
mysql quicktravel_test < ../quicktravel_test/bootstrap.sql
|
23
|
-
TIMECOP=1 QUICKTRAVEL_CONFIG_DIR=spec/support/config RAILS_ENV=test bundle exec rails s -p8080
|
23
|
+
TIMECOP=1 WEBMOCK=0 QUICKTRAVEL_CONFIG_DIR=spec/support/config RAILS_ENV=test bundle exec rails s -p8080
|
24
|
+
|
25
|
+
In Payment Service: (if needing to generate checkout cassettes):
|
26
|
+
bundle exec puma -Ilib -p7000
|
24
27
|
|
25
28
|
In QuickTravel Client:
|
26
29
|
rm spec/support/cassettes/ -rf
|
@@ -12,6 +12,10 @@ module QuickTravel
|
|
12
12
|
|
13
13
|
attr_reader :error
|
14
14
|
|
15
|
+
def self.client_token(data)
|
16
|
+
get_and_validate('/api/checkouts/client_token.json', data).symbolize_keys
|
17
|
+
end
|
18
|
+
|
15
19
|
# Create a checkout in QuickTravel
|
16
20
|
def self.create(data)
|
17
21
|
build_checkout_for { post_and_validate('/api/checkouts.json', data) }
|
data/lib/quick_travel/version.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'quick_travel/checkout'
|
3
|
+
|
4
|
+
describe QuickTravel::Checkout do
|
5
|
+
subject(:token) {
|
6
|
+
VCR.use_cassette 'checkout_client_token' do
|
7
|
+
QuickTravel::Checkout.client_token(gateway: 'braintree')
|
8
|
+
end
|
9
|
+
}
|
10
|
+
|
11
|
+
specify do
|
12
|
+
expect(token.keys).to eq [:client_token]
|
13
|
+
expect(token[:client_token]).to match /^[0-9A-Za-z\=]+$/
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://test.qt.sealink.com.au:8080/api/checkouts/client_token.json?gateway=braintree
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: access_key=<QT_KEY>
|
9
|
+
headers:
|
10
|
+
Content-Length:
|
11
|
+
- '0'
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message: 'OK '
|
16
|
+
headers:
|
17
|
+
P3p:
|
18
|
+
- CP="IDC DSP CAO COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
|
19
|
+
Content-Type:
|
20
|
+
- application/json; charset=utf-8
|
21
|
+
X-Ua-Compatible:
|
22
|
+
- IE=Edge,chrome=1
|
23
|
+
Etag:
|
24
|
+
- '"cda6bc3f3414cab26afaeeb1aed78399"'
|
25
|
+
Cache-Control:
|
26
|
+
- max-age=0, private, must-revalidate
|
27
|
+
X-Request-Id:
|
28
|
+
- ec6354ccbc937b85106f6f839bde6e39
|
29
|
+
X-Runtime:
|
30
|
+
- '3.865619'
|
31
|
+
Vary:
|
32
|
+
- Origin
|
33
|
+
Date:
|
34
|
+
- Fri, 01 Jan 2016 02:30:19 GMT
|
35
|
+
X-Rack-Cache:
|
36
|
+
- miss
|
37
|
+
X-Content-Type-Options:
|
38
|
+
- nosniff
|
39
|
+
X-Download-Options:
|
40
|
+
- noopen
|
41
|
+
X-Frame-Options:
|
42
|
+
- sameorigin
|
43
|
+
X-Permitted-Cross-Domain-Policies:
|
44
|
+
- none
|
45
|
+
X-Xss-Protection:
|
46
|
+
- 1; mode=block
|
47
|
+
Server:
|
48
|
+
- WEBrick/1.3.1 (Ruby/2.2.5/2016-04-26)
|
49
|
+
Content-Length:
|
50
|
+
- '1951'
|
51
|
+
Connection:
|
52
|
+
- Keep-Alive
|
53
|
+
Set-Cookie:
|
54
|
+
- _quick_travel_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJTczZTQ0NTQ3MDE0OWJkNDZkMzNhZmU0ZGUwZGE2MWNlBjsAVEkiCXVzZXIGOwBGaQY%3D--0db3ef975d0c7058bd1a7dc8cfd788d3b5a7f56c;
|
55
|
+
path=/; HttpOnly
|
56
|
+
body:
|
57
|
+
encoding: UTF-8
|
58
|
+
string: '{"client_token":"eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiOiJmN2I0NWI1M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20vdG9zIiwiYmFzZVVybCI6Imh0dHBzOi8vYXNzZXRzLmJyYWludHJlZWdhdGV3YXkuY29tIiwiYXNzZXRzVXJsIjoiaHR0cHM6Ly9jaGVja291dC5wYXlwYWwuY29tIiwiZGlyZWN0QmFzZVVybCI6bnVsbCwiYWxsb3dIdHRwIjp0cnVlLCJlbnZpcm9ubWVudE5vTmV0d29yayI6dHJ1ZSwiZW52aXJvbm1lbnQiOiJvZmZsaW5lIiwidW52ZXR0ZWRNZXJjaGFudCI6ZmFsc2UsImJyYWludHJlZUNsaWVudElkIjoibWFzdGVyY2xpZW50MyIsImJpbGxpbmdBZ3JlZW1lbnRzRW5hYmxlZCI6dHJ1ZSwibWVyY2hhbnRBY2NvdW50SWQiOiJiOW5kaDhrcGR6c3N6cm44IiwiY3VycmVuY3lJc29Db2RlIjoiVVNEIn0sImNvaW5iYXNlRW5hYmxlZCI6ZmFsc2UsIm1lcmNoYW50SWQiOiI3ejM4NHdrODRnejliNXZuIiwidmVubW8iOiJvZmYiLCJhcHBsZVBheSI6eyJzdGF0dXMiOiJtb2NrIiwiY291bnRyeUNvZGUiOiJVUyIsImN1cnJlbmN5Q29kZSI6IlVTRCIsIm1lcmNoYW50SWRlbnRpZmllciI6Im1lcmNoYW50LmF1LmNvbS5zZWFsaW5rLnNhbmRib3giLCJzdXBwb3J0ZWROZXR3b3JrcyI6WyJ2aXNhIiwibWFzdGVyY2FyZCIsImFtZXgiLCJkaXNjb3ZlciJdfX0="}'
|
59
|
+
http_version:
|
60
|
+
recorded_at: Fri, 11 Nov 2016 00:36:09 GMT
|
61
|
+
recorded_with: VCR 3.0.3
|
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: 2.
|
4
|
+
version: 2.5.0
|
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: 2016-11-
|
13
|
+
date: 2016-11-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|
@@ -357,6 +357,7 @@ files:
|
|
357
357
|
- quicktravel_client.gemspec
|
358
358
|
- spec/adapter_spec.rb
|
359
359
|
- spec/booking_spec.rb
|
360
|
+
- spec/checkout_spec.rb
|
360
361
|
- spec/country_spec.rb
|
361
362
|
- spec/credit_card_spec.rb
|
362
363
|
- spec/discounts_spec.rb
|
@@ -385,6 +386,7 @@ files:
|
|
385
386
|
- spec/support/cassettes/booking_with_documents.yml
|
386
387
|
- spec/support/cassettes/booking_with_nested_attributes.yml
|
387
388
|
- spec/support/cassettes/booking_with_price_changes.yml
|
389
|
+
- spec/support/cassettes/checkout_client_token.yml
|
388
390
|
- spec/support/cassettes/countries.yml
|
389
391
|
- spec/support/cassettes/country_all.yml
|
390
392
|
- spec/support/cassettes/create_reservation_fail.yml
|
@@ -431,13 +433,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
431
433
|
version: '0'
|
432
434
|
requirements: []
|
433
435
|
rubyforge_project:
|
434
|
-
rubygems_version: 2.4.
|
436
|
+
rubygems_version: 2.4.8
|
435
437
|
signing_key:
|
436
438
|
specification_version: 4
|
437
439
|
summary: Booking process using QuickTravel API
|
438
440
|
test_files:
|
439
441
|
- spec/adapter_spec.rb
|
440
442
|
- spec/booking_spec.rb
|
443
|
+
- spec/checkout_spec.rb
|
441
444
|
- spec/country_spec.rb
|
442
445
|
- spec/credit_card_spec.rb
|
443
446
|
- spec/discounts_spec.rb
|
@@ -466,6 +469,7 @@ test_files:
|
|
466
469
|
- spec/support/cassettes/booking_with_documents.yml
|
467
470
|
- spec/support/cassettes/booking_with_nested_attributes.yml
|
468
471
|
- spec/support/cassettes/booking_with_price_changes.yml
|
472
|
+
- spec/support/cassettes/checkout_client_token.yml
|
469
473
|
- spec/support/cassettes/countries.yml
|
470
474
|
- spec/support/cassettes/country_all.yml
|
471
475
|
- spec/support/cassettes/create_reservation_fail.yml
|