gyftwrapper 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gyftwrapper/api.rb +8 -1
- data/lib/gyftwrapper/version.rb +1 -1
- data/spec/cassettes/Gyftwrapper_API/with_configs/_purchase_card/for_invalid_params/shop_card_id/returns_error.yml +12 -11
- data/spec/cassettes/Gyftwrapper_API/with_configs/_purchase_card/for_invalid_params/shop_card_id/returns_unsuccessful_result.yml +10 -9
- data/spec/cassettes/Gyftwrapper_API/with_configs/_purchase_card/for_invalid_params/to_email/returns_error.yml +6 -6
- data/spec/cassettes/Gyftwrapper_API/with_configs/_purchase_card/for_invalid_params/to_email/returns_unsuccessful_result.yml +8 -8
- data/spec/cassettes/Gyftwrapper_API/with_configs/_purchase_card/for_valid_params/returns_response.yml +9 -9
- data/spec/cassettes/Gyftwrapper_API/with_configs/_purchase_card/for_valid_params/returns_successful_result.yml +9 -9
- data/spec/config/gyftwrapper.yml +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddb57cbe8712bfc61d33311366949034ec0cb6d4
|
4
|
+
data.tar.gz: 3931e17052a7e6447e5e58a80da4b76bc64fcca6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 147ae44a310c2be9ad8b9cfb58f971923073c45fb6bc0b8a699168b4074d785bc6112eb9c243811d94fe5017141e7a59c5f049ea621042b7141872a300ad2fad
|
7
|
+
data.tar.gz: 15d45e2128916ed78f49fb71d955c749cca4eeaf23c75c737af378189dbc63f3b27e49e5bcfa7cb6a0a2091bdf0c7c497d5f6d44cd38c9d82a85c72e23fc1562
|
data/lib/gyftwrapper/api.rb
CHANGED
@@ -23,7 +23,7 @@ module Gyftwrapper
|
|
23
23
|
|
24
24
|
def purchase_card(params)
|
25
25
|
send_request do
|
26
|
-
RestClient.post(url_for(:purchase_card), params, 'x-sig-timestamp' => timestamp)
|
26
|
+
RestClient.post(url_for(:purchase_card), params.merge(default_params), 'x-sig-timestamp' => timestamp)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -63,5 +63,12 @@ module Gyftwrapper
|
|
63
63
|
|
64
64
|
data ? OpenStruct.new(data) : data
|
65
65
|
end
|
66
|
+
|
67
|
+
def default_params
|
68
|
+
{
|
69
|
+
return_direct_link: true,
|
70
|
+
whitelabel: true
|
71
|
+
}
|
72
|
+
end
|
66
73
|
end
|
67
74
|
end
|
data/lib/gyftwrapper/version.rb
CHANGED
@@ -2,19 +2,19 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://apitest.gyft.com/mashery/v1/reseller/purchase/card?api_key=
|
5
|
+
uri: https://apitest.gyft.com/mashery/v1/reseller/purchase/card?api_key=qfztjgd4rmtpeb9a9eb7nu3x&sig=305ab2becf7a646086276f68e629f6cc0756f7a2999fcdd5a673a302bb198741
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
|
-
string: shop_card_id=111
|
8
|
+
string: shop_card_id=111&return_direct_link=true&whitelabel=true
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- "*/*; q=0.5, application/xml"
|
12
12
|
Accept-Encoding:
|
13
13
|
- gzip, deflate
|
14
14
|
X-Sig-Timestamp:
|
15
|
-
- '
|
15
|
+
- '1434559250'
|
16
16
|
Content-Length:
|
17
|
-
- '
|
17
|
+
- '56'
|
18
18
|
Content-Type:
|
19
19
|
- application/x-www-form-urlencoded
|
20
20
|
User-Agent:
|
@@ -29,7 +29,7 @@ http_interactions:
|
|
29
29
|
Content-Type:
|
30
30
|
- application/json
|
31
31
|
Date:
|
32
|
-
-
|
32
|
+
- Wed, 17 Jun 2015 16:40:50 GMT
|
33
33
|
Expires:
|
34
34
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
35
35
|
Pragma:
|
@@ -40,15 +40,16 @@ http_interactions:
|
|
40
40
|
- max-age=15768000
|
41
41
|
Vary:
|
42
42
|
- Accept-Encoding
|
43
|
-
|
44
|
-
-
|
43
|
+
Transfer-Encoding:
|
44
|
+
- chunked
|
45
45
|
Connection:
|
46
46
|
- keep-alive
|
47
47
|
body:
|
48
48
|
encoding: UTF-8
|
49
|
-
string: "[ServiceException] Cannot find shop card for purchase:
|
50
|
-
ResellerPurchaseCardRequest{shop_card_id=111, reseller_reference=null,
|
51
|
-
return_direct_link=
|
49
|
+
string: "[ServiceException] Cannot find shop card for purchase: qfztjgd4rmtpeb9a9eb7nu3x,
|
50
|
+
ResellerPurchaseCardRequest{shop_card_id=111, reseller_reference=null, notes=null,
|
51
|
+
to_email=null, return_direct_link=true, first_name=null, last_name=null, gender=null,
|
52
|
+
birthday=null}"
|
52
53
|
http_version:
|
53
|
-
recorded_at:
|
54
|
+
recorded_at: Wed, 17 Jun 2015 16:40:51 GMT
|
54
55
|
recorded_with: VCR 2.9.3
|
@@ -2,19 +2,19 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://apitest.gyft.com/mashery/v1/reseller/purchase/card?api_key=
|
5
|
+
uri: https://apitest.gyft.com/mashery/v1/reseller/purchase/card?api_key=qfztjgd4rmtpeb9a9eb7nu3x&sig=9c9ab3a1d2ae6f76812686eb7e203580a4cc71232d58755b124d9818b40a5419
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
|
-
string: shop_card_id=111
|
8
|
+
string: shop_card_id=111&return_direct_link=true&whitelabel=true
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- "*/*; q=0.5, application/xml"
|
12
12
|
Accept-Encoding:
|
13
13
|
- gzip, deflate
|
14
14
|
X-Sig-Timestamp:
|
15
|
-
- '
|
15
|
+
- '1434559249'
|
16
16
|
Content-Length:
|
17
|
-
- '
|
17
|
+
- '56'
|
18
18
|
Content-Type:
|
19
19
|
- application/x-www-form-urlencoded
|
20
20
|
User-Agent:
|
@@ -29,7 +29,7 @@ http_interactions:
|
|
29
29
|
Content-Type:
|
30
30
|
- application/json
|
31
31
|
Date:
|
32
|
-
-
|
32
|
+
- Wed, 17 Jun 2015 16:40:50 GMT
|
33
33
|
Expires:
|
34
34
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
35
35
|
Pragma:
|
@@ -46,9 +46,10 @@ http_interactions:
|
|
46
46
|
- keep-alive
|
47
47
|
body:
|
48
48
|
encoding: UTF-8
|
49
|
-
string: "[ServiceException] Cannot find shop card for purchase:
|
50
|
-
ResellerPurchaseCardRequest{shop_card_id=111, reseller_reference=null,
|
51
|
-
return_direct_link=
|
49
|
+
string: "[ServiceException] Cannot find shop card for purchase: qfztjgd4rmtpeb9a9eb7nu3x,
|
50
|
+
ResellerPurchaseCardRequest{shop_card_id=111, reseller_reference=null, notes=null,
|
51
|
+
to_email=null, return_direct_link=true, first_name=null, last_name=null, gender=null,
|
52
|
+
birthday=null}"
|
52
53
|
http_version:
|
53
|
-
recorded_at:
|
54
|
+
recorded_at: Wed, 17 Jun 2015 16:40:50 GMT
|
54
55
|
recorded_with: VCR 2.9.3
|
@@ -2,19 +2,19 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://apitest.gyft.com/mashery/v1/reseller/purchase/card?api_key=
|
5
|
+
uri: https://apitest.gyft.com/mashery/v1/reseller/purchase/card?api_key=qfztjgd4rmtpeb9a9eb7nu3x&sig=e948f9800a9b856b95758eea3bb5612a92e76e6548923600994616770ed8289e
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
|
-
string: shop_card_id=3266&to_email=123
|
8
|
+
string: shop_card_id=3266&to_email=123&return_direct_link=true&whitelabel=true
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- "*/*; q=0.5, application/xml"
|
12
12
|
Accept-Encoding:
|
13
13
|
- gzip, deflate
|
14
14
|
X-Sig-Timestamp:
|
15
|
-
- '
|
15
|
+
- '1434559251'
|
16
16
|
Content-Length:
|
17
|
-
- '
|
17
|
+
- '70'
|
18
18
|
Content-Type:
|
19
19
|
- application/x-www-form-urlencoded
|
20
20
|
User-Agent:
|
@@ -29,7 +29,7 @@ http_interactions:
|
|
29
29
|
Content-Type:
|
30
30
|
- application/json
|
31
31
|
Date:
|
32
|
-
-
|
32
|
+
- Wed, 17 Jun 2015 16:40:52 GMT
|
33
33
|
Expires:
|
34
34
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
35
35
|
Pragma:
|
@@ -48,5 +48,5 @@ http_interactions:
|
|
48
48
|
encoding: UTF-8
|
49
49
|
string: "[ServiceException] Email address is not valid: 123"
|
50
50
|
http_version:
|
51
|
-
recorded_at:
|
51
|
+
recorded_at: Wed, 17 Jun 2015 16:40:52 GMT
|
52
52
|
recorded_with: VCR 2.9.3
|
@@ -2,19 +2,19 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://apitest.gyft.com/mashery/v1/reseller/purchase/card?api_key=
|
5
|
+
uri: https://apitest.gyft.com/mashery/v1/reseller/purchase/card?api_key=qfztjgd4rmtpeb9a9eb7nu3x&sig=e948f9800a9b856b95758eea3bb5612a92e76e6548923600994616770ed8289e
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
|
-
string: shop_card_id=3266&to_email=123
|
8
|
+
string: shop_card_id=3266&to_email=123&return_direct_link=true&whitelabel=true
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- "*/*; q=0.5, application/xml"
|
12
12
|
Accept-Encoding:
|
13
13
|
- gzip, deflate
|
14
14
|
X-Sig-Timestamp:
|
15
|
-
- '
|
15
|
+
- '1434559251'
|
16
16
|
Content-Length:
|
17
|
-
- '
|
17
|
+
- '70'
|
18
18
|
Content-Type:
|
19
19
|
- application/x-www-form-urlencoded
|
20
20
|
User-Agent:
|
@@ -29,7 +29,7 @@ http_interactions:
|
|
29
29
|
Content-Type:
|
30
30
|
- application/json
|
31
31
|
Date:
|
32
|
-
-
|
32
|
+
- Wed, 17 Jun 2015 16:40:51 GMT
|
33
33
|
Expires:
|
34
34
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
35
35
|
Pragma:
|
@@ -40,13 +40,13 @@ http_interactions:
|
|
40
40
|
- max-age=15768000
|
41
41
|
Vary:
|
42
42
|
- Accept-Encoding
|
43
|
-
|
44
|
-
-
|
43
|
+
Transfer-Encoding:
|
44
|
+
- chunked
|
45
45
|
Connection:
|
46
46
|
- keep-alive
|
47
47
|
body:
|
48
48
|
encoding: UTF-8
|
49
49
|
string: "[ServiceException] Email address is not valid: 123"
|
50
50
|
http_version:
|
51
|
-
recorded_at:
|
51
|
+
recorded_at: Wed, 17 Jun 2015 16:40:51 GMT
|
52
52
|
recorded_with: VCR 2.9.3
|
@@ -2,19 +2,19 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://apitest.gyft.com/mashery/v1/reseller/purchase/card?api_key=
|
5
|
+
uri: https://apitest.gyft.com/mashery/v1/reseller/purchase/card?api_key=qfztjgd4rmtpeb9a9eb7nu3x&sig=9c9ab3a1d2ae6f76812686eb7e203580a4cc71232d58755b124d9818b40a5419
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
|
-
string: shop_card_id=3266&to_email=rpmilevskiy%40gmail.com
|
8
|
+
string: shop_card_id=3266&to_email=rpmilevskiy%40gmail.com&return_direct_link=true&whitelabel=true
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- "*/*; q=0.5, application/xml"
|
12
12
|
Accept-Encoding:
|
13
13
|
- gzip, deflate
|
14
14
|
X-Sig-Timestamp:
|
15
|
-
- '
|
15
|
+
- '1434559249'
|
16
16
|
Content-Length:
|
17
|
-
- '
|
17
|
+
- '90'
|
18
18
|
Content-Type:
|
19
19
|
- application/x-www-form-urlencoded
|
20
20
|
User-Agent:
|
@@ -29,7 +29,7 @@ http_interactions:
|
|
29
29
|
Content-Type:
|
30
30
|
- application/json
|
31
31
|
Date:
|
32
|
-
-
|
32
|
+
- Wed, 17 Jun 2015 16:40:49 GMT
|
33
33
|
Expires:
|
34
34
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
35
35
|
Pragma:
|
@@ -40,13 +40,13 @@ http_interactions:
|
|
40
40
|
- max-age=15768000
|
41
41
|
Vary:
|
42
42
|
- Accept-Encoding
|
43
|
-
|
44
|
-
-
|
43
|
+
Transfer-Encoding:
|
44
|
+
- chunked
|
45
45
|
Connection:
|
46
46
|
- keep-alive
|
47
47
|
body:
|
48
48
|
encoding: UTF-8
|
49
|
-
string: '{"id":
|
49
|
+
string: '{"id":25639,"url":"https://apptest.gyft.com/gyfted_cards/by_card/?whitelabel=true#MGYyY2JiMzcyZTQ0NGY5NDlkZjZlNGMxYTg1OGUyNmI2YTYzMmY4MmZmMmM0NDcyODMyYmUwODk3ZjFlMzc0NUx3"}'
|
50
50
|
http_version:
|
51
|
-
recorded_at:
|
51
|
+
recorded_at: Wed, 17 Jun 2015 16:40:49 GMT
|
52
52
|
recorded_with: VCR 2.9.3
|
@@ -2,19 +2,19 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://apitest.gyft.com/mashery/v1/reseller/purchase/card?api_key=
|
5
|
+
uri: https://apitest.gyft.com/mashery/v1/reseller/purchase/card?api_key=qfztjgd4rmtpeb9a9eb7nu3x&sig=3a1c997648da5935b65ef2c4afae7a86754f5263ea9a3246c4393685eb0c450c
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
|
-
string: shop_card_id=3266&to_email=rpmilevskiy%40gmail.com
|
8
|
+
string: shop_card_id=3266&to_email=rpmilevskiy%40gmail.com&return_direct_link=true&whitelabel=true
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- "*/*; q=0.5, application/xml"
|
12
12
|
Accept-Encoding:
|
13
13
|
- gzip, deflate
|
14
14
|
X-Sig-Timestamp:
|
15
|
-
- '
|
15
|
+
- '1434559248'
|
16
16
|
Content-Length:
|
17
|
-
- '
|
17
|
+
- '90'
|
18
18
|
Content-Type:
|
19
19
|
- application/x-www-form-urlencoded
|
20
20
|
User-Agent:
|
@@ -29,7 +29,7 @@ http_interactions:
|
|
29
29
|
Content-Type:
|
30
30
|
- application/json
|
31
31
|
Date:
|
32
|
-
-
|
32
|
+
- Wed, 17 Jun 2015 16:40:49 GMT
|
33
33
|
Expires:
|
34
34
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
35
35
|
Pragma:
|
@@ -40,13 +40,13 @@ http_interactions:
|
|
40
40
|
- max-age=15768000
|
41
41
|
Vary:
|
42
42
|
- Accept-Encoding
|
43
|
-
|
44
|
-
-
|
43
|
+
Transfer-Encoding:
|
44
|
+
- chunked
|
45
45
|
Connection:
|
46
46
|
- keep-alive
|
47
47
|
body:
|
48
48
|
encoding: UTF-8
|
49
|
-
string: '{"id":
|
49
|
+
string: '{"id":25638,"url":"https://apptest.gyft.com/gyfted_cards/by_card/?whitelabel=true#NmU1OTU5MGE4ZjZlNDIwNjgyNjQwNGVhMjcyNGY1ZTE0Y2NlNzMyOWI2ZmM0YmUxODEyNDg0ZDQxYWIyM2Q2NW02"}'
|
50
50
|
http_version:
|
51
|
-
recorded_at:
|
51
|
+
recorded_at: Wed, 17 Jun 2015 16:40:49 GMT
|
52
52
|
recorded_with: VCR 2.9.3
|
data/spec/config/gyftwrapper.yml
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gyftwrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ruslan Milevskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|