iap_verifier 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -3
- data/CHANGELOG.md +7 -1
- data/README.md +7 -1
- data/iap_verifier.gemspec +3 -0
- data/lib/iap_verifier.rb +4 -4
- data/lib/iap_verifier/request.rb +12 -22
- data/lib/iap_verifier/version.rb +1 -1
- data/test/fixtures/base64_receipt +1 -1
- data/test/fixtures/vcr_cassettes/valid_receipt.yml +49 -47
- data/test/request_data_test.rb +1 -1
- data/test/request_test.rb +8 -3
- data/test/test_helper.rb +1 -0
- metadata +31 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4951fa0f326439b77257ec09b2cf503bf942f882
|
4
|
+
data.tar.gz: 50009ed0d7179d493c1c85b0406e096ac9978bf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 276482624fe91f3bd69ec260863e33326ffccc0d43214d7554ac2b0a46a8c94865485066d945e3e5036c40eb7d83ef2e7ed97db7d09bbc56b03d9c504e7ec120
|
7
|
+
data.tar.gz: ad8740fe7208e92de618ab536ae08af7c627b3d2c0a274b8c4752211597f7a249a97123c362fc48724030646dbe2bf4fda7fd74422633b5270b2b3d71b44692d
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# IAPVerifier
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/linjunpop/iap_verifier.svg)](https://travis-ci.org/linjunpop/iap_verifier)
|
4
|
+
[![Dependency Status](http://img.shields.io/gemnasium/linjunpop/iap_verifier.svg)](https://gemnasium.com/linjunpop/iap_verifier)
|
5
|
+
[![Code Climate](http://img.shields.io/codeclimate/github/linjunpop/iap_verifier.svg)](https://codeclimate.com/github/linjunpop/iap_verifier)
|
6
|
+
[![Gem Version](http://img.shields.io/gem/v/iap_verifier.svg)](https://rubygems.org/gems/iap_verifier)
|
7
|
+
[![License](http://img.shields.io/:license-mit-blue.svg)](http://linjunpop.mit-license.org)
|
8
|
+
|
3
9
|
In-App Purchase receipt verification.
|
4
10
|
|
5
11
|
## Installation
|
@@ -19,7 +25,7 @@ Or install it yourself as:
|
|
19
25
|
## Usage
|
20
26
|
|
21
27
|
```ruby
|
22
|
-
receipt = IAPVerifier.verify_receipt(
|
28
|
+
receipt = IAPVerifier.verify_receipt('base64_encoded_receipt_string')
|
23
29
|
receipt.original_application_version # 1234
|
24
30
|
receipt.original_purchase_date_pst # 2014-08-31 11:24:13 America/Los_Angeles
|
25
31
|
```
|
data/iap_verifier.gemspec
CHANGED
@@ -18,6 +18,9 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
+
spec.add_runtime_dependency 'curb'
|
22
|
+
spec.add_runtime_dependency 'oj'
|
23
|
+
|
21
24
|
spec.add_development_dependency "bundler", "~> 1.6"
|
22
25
|
spec.add_development_dependency "rake"
|
23
26
|
spec.add_development_dependency "pry"
|
data/lib/iap_verifier.rb
CHANGED
@@ -7,13 +7,13 @@ require 'iap_verifier/receipt'
|
|
7
7
|
|
8
8
|
module IAPVerifier
|
9
9
|
class << self
|
10
|
-
def verify_receipt!(receipt
|
11
|
-
IAPVerifier::Request.new(receipt
|
10
|
+
def verify_receipt!(receipt)
|
11
|
+
IAPVerifier::Request.new(receipt).response.receipt
|
12
12
|
end
|
13
13
|
|
14
|
-
def verify_receipt(receipt
|
14
|
+
def verify_receipt(receipt)
|
15
15
|
begin
|
16
|
-
verify_receipt!(receipt
|
16
|
+
verify_receipt!(receipt)
|
17
17
|
rescue IAPVerifier::Error::Standard
|
18
18
|
return nil
|
19
19
|
end
|
data/lib/iap_verifier/request.rb
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
require 'json'
|
2
|
-
require '
|
3
|
-
require '
|
2
|
+
require 'curb'
|
3
|
+
require 'oj'
|
4
4
|
|
5
5
|
module IAPVerifier
|
6
6
|
class Request
|
7
7
|
PRODUCTION_URL = "https://buy.itunes.apple.com/verifyReceipt"
|
8
8
|
SANDBOX_URL = "https://sandbox.itunes.apple.com/verifyReceipt"
|
9
9
|
|
10
|
-
def initialize(receipt
|
11
|
-
|
12
|
-
unless receipt.length > 0
|
10
|
+
def initialize(receipt)
|
11
|
+
if receipt.nil? || (/\A[[:space:]]*\z/ === receipt)
|
13
12
|
raise Error::EmptyReceipt.new
|
14
13
|
end
|
14
|
+
|
15
|
+
@request_data = RequestData.new(receipt)
|
15
16
|
end
|
16
17
|
|
17
18
|
def response
|
@@ -31,24 +32,13 @@ module IAPVerifier
|
|
31
32
|
end
|
32
33
|
|
33
34
|
def verify(request_data, url)
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
http.use_ssl = true
|
38
|
-
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
39
|
-
|
40
|
-
request = Net::HTTP::Post.new(uri.request_uri)
|
41
|
-
request['Content-Type'] = "application/json"
|
42
|
-
request['Accept'] = "application/json"
|
43
|
-
request.body = request_data.to_json
|
44
|
-
|
45
|
-
response = http.request(request)
|
46
|
-
|
47
|
-
if response.instance_of?(Net::HTTPOK)
|
48
|
-
ResponseData.new(JSON.parse(response.body))
|
49
|
-
else
|
50
|
-
raise Error::NetworkDown.new(response)
|
35
|
+
http = Curl.post(url, request_data.to_json) do |client|
|
36
|
+
client.headers['Content-Type'] = "application/json"
|
37
|
+
client.headers['Accept'] = "application/json"
|
51
38
|
end
|
39
|
+
response = http.body_str
|
40
|
+
|
41
|
+
ResponseData.new(Oj.load(response))
|
52
42
|
end
|
53
43
|
end
|
54
44
|
end
|
data/lib/iap_verifier/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
MIIVNAYJKoZ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nTTt4sjO0ej1W8k4uvRt3DfD0XhJ8rxbXjt57UXF6jcfiI1yiXV2Q/Wa9SiJCMR96Gsj3OBYMYbWwkvkrL4REjwYDieFfU9JmcgijNq9w2Cz97roy/5U2pbZMBjM3f3OgcsVuvaDyEO2rpzGU+12TZ/wYdV2aeZuTJC+9jVcZ5+oVK3G72TQiQSKscPHbZNnF5jyEuAF1CqitXa5PzQCQc3sHV1ITGCAcswggHHAgEBMIGjMIGWMQswCQYDVQQGEwJVUzETMBEGA1UECgwKQXBwbGUgSW5jLjEsMCoGA1UECwwjQXBwbGUgV29ybGR3aWRlIERldmVsb3BlciBSZWxhdGlvbnMxRDBCBgNVBAMMO0FwcGxlIFdvcmxkd2lkZSBEZXZlbG9wZXIgUmVsYXRpb25zIENlcnRpZmljYXRpb24gQXV0aG9yaXR5AggYWUMhcnSc/DAJBgUrDgMCGgUAMA0GCSqGSIb3DQEBAQUABIIBAI3jSNG+zjySDtzFNy3TDadg5rXHnv+HJ+qkP2fU8rsY4HtKGG4m+O4BqRlYboxyE1SkZfkSmx/XVqNbZoSjqBKb/2PWriKk/Q0HU3GTEgF8A2YcLZ/nyq+HJUXCww6jvwiRAZHvzvrD71DDvInuyRtSgS3CVx2VKlh4rbwpm5gy/JeDi0zDVs2Z1oygDv028SH9/56ZgcdzXAcSsPw/04dzqzCbaJH9XcJWnc2M2J/A0z8cma+dD0/uZRKnIFmLz5LyEeL39jfBcBDl73tUooti4+ac9Wp1OmdjQujZ9tC8zLKkSnhYCzb0RZp/c2Wjt/UnexeUOE1G5jbJPhNa7Fg=
|
@@ -5,47 +5,37 @@ http_interactions:
|
|
5
5
|
uri: https://buy.itunes.apple.com/verifyReceipt
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"receipt-data":"
|
8
|
+
string: '{"receipt-data":"MIIVNAYJKoZIhvcNAQcCoIIVJTCCFSECAQExCzAJBgUrDgMCGgUAMIIE5QYJKoZIhvcNAQcBoIIE1gSCBNIxggT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YMYbWwkvkrL4REjwYDieFfU9JmcgijNq9w2Cz97roy/5U2pbZMBjM3f3OgcsVuvaDyEO2rpzGU+12TZ/wYdV2aeZuTJC+9jVcZ5+oVK3G72TQiQSKscPHbZNnF5jyEuAF1CqitXa5PzQCQc3sHV1ITGCAcswggHHAgEBMIGjMIGWMQswCQYDVQQGEwJVUzETMBEGA1UECgwKQXBwbGUgSW5jLjEsMCoGA1UECwwjQXBwbGUgV29ybGR3aWRlIERldmVsb3BlciBSZWxhdGlvbnMxRDBCBgNVBAMMO0FwcGxlIFdvcmxkd2lkZSBEZXZlbG9wZXIgUmVsYXRpb25zIENlcnRpZmljYXRpb24gQXV0aG9yaXR5AggYWUMhcnSc/DAJBgUrDgMCGgUAMA0GCSqGSIb3DQEBAQUABIIBAI3jSNG+zjySDtzFNy3TDadg5rXHnv+HJ+qkP2fU8rsY4HtKGG4m+O4BqRlYboxyE1SkZfkSmx/XVqNbZoSjqBKb/2PWriKk/Q0HU3GTEgF8A2YcLZ/nyq+HJUXCww6jvwiRAZHvzvrD71DDvInuyRtSgS3CVx2VKlh4rbwpm5gy/JeDi0zDVs2Z1oygDv028SH9/56ZgcdzXAcSsPw/04dzqzCbaJH9XcJWnc2M2J/A0z8cma+dD0/uZRKnIFmLz5LyEeL39jfBcBDl73tUooti4+ac9Wp1OmdjQujZ9tC8zLKkSnhYCzb0RZp/c2Wjt/UnexeUOE1G5jbJPhNa7Fg="}'
|
9
9
|
headers:
|
10
|
-
Accept-Encoding:
|
11
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
-
Accept:
|
13
|
-
- application/json
|
14
|
-
User-Agent:
|
15
|
-
- Ruby
|
16
10
|
Content-Type:
|
17
11
|
- application/json
|
12
|
+
Accept:
|
13
|
+
- application/json
|
18
14
|
response:
|
19
15
|
status:
|
20
16
|
code: 200
|
21
17
|
message: Apple WebObjects
|
22
18
|
headers:
|
23
19
|
X-Apple-Jingle-Correlation-Key:
|
24
|
-
-
|
20
|
+
- ZOTO3YOBKT7UO
|
25
21
|
Pod:
|
26
|
-
- '
|
22
|
+
- '30'
|
27
23
|
X-Apple-Translated-Wo-Url:
|
28
24
|
- "/WebObjects/MZFinance.woa/wa/verifyReceipt"
|
29
25
|
X-Apple-Orig-Url:
|
30
26
|
- http://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/verifyReceipt
|
31
27
|
X-Apple-Application-Site:
|
32
|
-
-
|
28
|
+
- NWK
|
33
29
|
Edge-Control:
|
34
30
|
- cache-maxage=0
|
35
31
|
- no-store
|
36
32
|
Date:
|
37
|
-
- Mon,
|
33
|
+
- Mon, 13 Oct 2014 10:58:04 GMT
|
38
34
|
Set-Cookie:
|
39
|
-
-
|
40
|
-
- Pod=53; version="1"; expires=Wed, 01-Oct-2014 23:29:26 GMT; path=/; domain=.apple.com
|
41
|
-
- itspod=53; version="1"; expires=Wed, 01-Oct-2014 23:29:26 GMT; path=/; domain=.apple.com
|
42
|
-
- mzf_dr=0; version="1"; expires=Thu, 01-Jan-1970 00:00:00 GMT; path=/WebObjects;
|
43
|
-
domain=.apple.com
|
44
|
-
- mzf_in=532400; version="1"; path=/WebObjects; domain=.apple.com; secure
|
45
|
-
- ns-mzf-inst=182-247-80-217-23-8155-532400-53-st13; version=1; Max-Age=1800;
|
35
|
+
- ns-mzf-inst=39-90-80-124-128-8166-302303-30-nk11; version=1; Max-Age=1800;
|
46
36
|
path=/; domain=.apple.com; httponly
|
47
37
|
Apple-Timing-App:
|
48
|
-
-
|
38
|
+
- 1790 ms
|
49
39
|
Cache-Control:
|
50
40
|
- max-age=0
|
51
41
|
- must-revalidate
|
@@ -54,48 +44,44 @@ http_interactions:
|
|
54
44
|
- no-transform
|
55
45
|
- private
|
56
46
|
Expires:
|
57
|
-
- Mon,
|
47
|
+
- Mon, 13 Oct 2014 10:58:04 GMT
|
58
48
|
X-Apple-Lokamai-No-Cache:
|
59
49
|
- 'true'
|
60
50
|
X-Apple-Application-Instance:
|
61
|
-
- '
|
51
|
+
- '302303'
|
62
52
|
X-Frame-Options:
|
63
53
|
- SAMEORIGIN
|
64
54
|
Itspod:
|
65
|
-
- '
|
55
|
+
- '30'
|
66
56
|
X-Webobjects-Loadaverage:
|
67
|
-
- '
|
57
|
+
- '30'
|
68
58
|
Connection:
|
69
59
|
- keep-alive
|
70
60
|
Content-Length:
|
71
|
-
- '
|
61
|
+
- '16'
|
72
62
|
body:
|
73
|
-
encoding:
|
63
|
+
encoding: ASCII-8BIT
|
74
64
|
string: '{"status":21007}'
|
75
65
|
http_version:
|
76
|
-
recorded_at: Mon,
|
66
|
+
recorded_at: Mon, 13 Oct 2014 10:58:05 GMT
|
77
67
|
- request:
|
78
68
|
method: post
|
79
69
|
uri: https://sandbox.itunes.apple.com/verifyReceipt
|
80
70
|
body:
|
81
71
|
encoding: UTF-8
|
82
|
-
string: '{"receipt-data":"
|
72
|
+
string: '{"receipt-data":"MIIVNAYJKoZIhvcNAQcCoIIVJTCCFSECAQExCzAJBgUrDgMCGgUAMIIE5QYJKoZIhvcNAQcBoIIE1gSCBNIxggTOMAoCAQgCAQEEAhYAMAoCARQCAQEEAgwAMAsCAQECAQEEAwIBADALAgELAgEBBAMCAQAwCwIBDgIBAQQDAgFZMAsCAQ8CAQEEAwIBADALAgEQAgEBBAMCAQAwCwIBGQIBAQQDAgEDMAwCAQoCAQEEBBYCNCswDQIBDQIBAQQFAgMBOIAwDQIBEwIBAQQFDAMxLjAwDgIBAwIBAQQGDAQxMjQxMA4CAQkCAQEEBgIEUDIzMTAYAgEEAgECBBA333I4ik/3twkl0RwHk8mDMBsCAQACAQEEEwwRUHJvZHVjdGlvblNhbmRib3gwHAIBBQIBAQQU/ReKwsH9zCfv3CvI39VK0idlTy8wHgIBDAIBAQQWFhQyMDE0LTA5LTAyVDAzOjI5OjA2WjAeAgESAgEBBBYWFDIwMTMtMDgtMDFUMDc6MDA6MDBaMB8CAQICAQEEFwwVY29tLnN1bWlhcHAuR3JpZERpYXJ5MEkCAQcCAQE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x/XVqNbZoSjqBKb/2PWriKk/Q0HU3GTEgF8A2YcLZ/nyq+HJUXCww6jvwiRAZHvzvrD71DDvInuyRtSgS3CVx2VKlh4rbwpm5gy/JeDi0zDVs2Z1oygDv028SH9/56ZgcdzXAcSsPw/04dzqzCbaJH9XcJWnc2M2J/A0z8cma+dD0/uZRKnIFmLz5LyEeL39jfBcBDl73tUooti4+ac9Wp1OmdjQujZ9tC8zLKkSnhYCzb0RZp/c2Wjt/UnexeUOE1G5jbJPhNa7Fg="}'
|
83
73
|
headers:
|
84
|
-
Accept-Encoding:
|
85
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
86
|
-
Accept:
|
87
|
-
- application/json
|
88
|
-
User-Agent:
|
89
|
-
- Ruby
|
90
74
|
Content-Type:
|
91
75
|
- application/json
|
76
|
+
Accept:
|
77
|
+
- application/json
|
92
78
|
response:
|
93
79
|
status:
|
94
80
|
code: 200
|
95
81
|
message: Apple WebObjects
|
96
82
|
headers:
|
97
83
|
X-Apple-Jingle-Correlation-Key:
|
98
|
-
-
|
84
|
+
- 6TKXESZFKJHNO
|
99
85
|
Pod:
|
100
86
|
- '100'
|
101
87
|
X-Apple-Translated-Wo-Url:
|
@@ -108,13 +94,13 @@ http_interactions:
|
|
108
94
|
- cache-maxage=0
|
109
95
|
- no-store
|
110
96
|
Set-Cookie:
|
111
|
-
- Pod=100; version="1"; expires=
|
112
|
-
- itspod=100; version="1"; expires=
|
97
|
+
- Pod=100; version="1"; expires=Thu, 13-Nov-2014 11:58:07 GMT; path=/; domain=.apple.com
|
98
|
+
- itspod=100; version="1"; expires=Thu, 13-Nov-2014 11:58:07 GMT; path=/; domain=.apple.com
|
113
99
|
- mzf_dr=0; version="1"; expires=Thu, 01-Jan-1970 00:00:00 GMT; path=/WebObjects;
|
114
100
|
domain=.apple.com
|
115
|
-
- mzf_in=
|
101
|
+
- mzf_in=990200; version="1"; path=/WebObjects; domain=.apple.com; secure
|
116
102
|
Apple-Timing-App:
|
117
|
-
-
|
103
|
+
- 1186 ms
|
118
104
|
Cache-Control:
|
119
105
|
- max-age=0
|
120
106
|
- must-revalidate
|
@@ -123,11 +109,11 @@ http_interactions:
|
|
123
109
|
- no-transform
|
124
110
|
- private
|
125
111
|
Expires:
|
126
|
-
- Mon,
|
112
|
+
- Mon, 13 Oct 2014 10:58:07 GMT
|
127
113
|
X-Apple-Lokamai-No-Cache:
|
128
114
|
- 'true'
|
129
115
|
X-Apple-Application-Instance:
|
130
|
-
- '
|
116
|
+
- '990200'
|
131
117
|
X-Frame-Options:
|
132
118
|
- SAMEORIGIN
|
133
119
|
Itspod:
|
@@ -137,14 +123,30 @@ http_interactions:
|
|
137
123
|
Connection:
|
138
124
|
- keep-alive
|
139
125
|
Content-Length:
|
140
|
-
- '
|
126
|
+
- '1580'
|
141
127
|
Date:
|
142
|
-
- Mon,
|
128
|
+
- Mon, 13 Oct 2014 10:58:07 GMT
|
143
129
|
body:
|
144
|
-
encoding:
|
145
|
-
string:
|
146
|
-
|
147
|
-
"
|
130
|
+
encoding: ASCII-8BIT
|
131
|
+
string: "{\"status\":0, \"environment\":\"Sandbox\", \n\"receipt\":{\"receipt_type\":\"ProductionSandbox\",
|
132
|
+
\"adam_id\":0, \"app_item_id\":0, \"bundle_id\":\"com.sumiapp.GridDiary\",
|
133
|
+
\"application_version\":\"1241\", \"download_id\":0, \"version_external_identifier\":0,
|
134
|
+
\"request_date\":\"2014-10-13 10:58:07 Etc/GMT\", \"request_date_ms\":\"1413197887377\",
|
135
|
+
\"request_date_pst\":\"2014-10-13 03:58:07 America/Los_Angeles\", \"original_purchase_date\":\"2013-08-01
|
136
|
+
07:00:00 Etc/GMT\", \"original_purchase_date_ms\":\"1375340400000\", \"original_purchase_date_pst\":\"2013-08-01
|
137
|
+
00:00:00 America/Los_Angeles\", \"original_application_version\":\"1.0\",
|
138
|
+
\n\"in_app\":[\n{\"quantity\":\"1\", \"product_id\":\"com.sumiapp.GridDiary.pro\",
|
139
|
+
\"transaction_id\":\"1000000118990828\", \"original_transaction_id\":\"1000000118990828\",
|
140
|
+
\"purchase_date\":\"2014-09-02 03:29:06 Etc/GMT\", \"purchase_date_ms\":\"1409628546000\",
|
141
|
+
\"purchase_date_pst\":\"2014-09-01 20:29:06 America/Los_Angeles\", \"original_purchase_date\":\"2014-08-04
|
142
|
+
06:24:51 Etc/GMT\", \"original_purchase_date_ms\":\"1407133491000\", \"original_purchase_date_pst\":\"2014-08-03
|
143
|
+
23:24:51 America/Los_Angeles\", \"is_trial_period\":\"false\"}, \n{\"quantity\":\"1\",
|
144
|
+
\"product_id\":\"com.sumiapp.griddiary.test\", \"transaction_id\":\"1000000122102348\",
|
145
|
+
\"original_transaction_id\":\"1000000122102348\", \"purchase_date\":\"2014-09-02
|
146
|
+
03:29:06 Etc/GMT\", \"purchase_date_ms\":\"1409628546000\", \"purchase_date_pst\":\"2014-09-01
|
147
|
+
20:29:06 America/Los_Angeles\", \"original_purchase_date\":\"2014-09-02 03:29:06
|
148
|
+
Etc/GMT\", \"original_purchase_date_ms\":\"1409628546000\", \"original_purchase_date_pst\":\"2014-09-01
|
149
|
+
20:29:06 America/Los_Angeles\", \"is_trial_period\":\"false\"}]}}"
|
148
150
|
http_version:
|
149
|
-
recorded_at: Mon,
|
151
|
+
recorded_at: Mon, 13 Oct 2014 10:58:07 GMT
|
150
152
|
recorded_with: VCR 2.9.2
|
data/test/request_data_test.rb
CHANGED
@@ -3,7 +3,7 @@ require 'iap_verifier/request_data'
|
|
3
3
|
|
4
4
|
class RequestDataTest < MiniTest::Test
|
5
5
|
def test_base64_receipt
|
6
|
-
receipt = File.read(File.expand_path("../fixtures/base64_receipt", __FILE__))
|
6
|
+
receipt = File.read(File.expand_path("../fixtures/base64_receipt", __FILE__))
|
7
7
|
|
8
8
|
expected = {
|
9
9
|
'receipt-data' => receipt
|
data/test/request_test.rb
CHANGED
@@ -4,14 +4,19 @@ require 'iap_verifier/request'
|
|
4
4
|
class RequestTest < MiniTest::Test
|
5
5
|
def test_empty_receipt
|
6
6
|
assert_raises(IAPVerifier::Error::EmptyReceipt) do
|
7
|
-
IAPVerifier::Request.new(
|
7
|
+
IAPVerifier::Request.new(nil)
|
8
|
+
end
|
9
|
+
|
10
|
+
assert_raises(IAPVerifier::Error::EmptyReceipt) do
|
11
|
+
IAPVerifier::Request.new('')
|
8
12
|
end
|
9
13
|
end
|
10
14
|
|
11
15
|
def test_response
|
12
16
|
VCR.use_cassette('valid_receipt') do
|
13
|
-
receipt = File.read(File.expand_path("../fixtures/base64_receipt", __FILE__))
|
14
|
-
|
17
|
+
receipt = File.read(File.expand_path("../fixtures/base64_receipt", __FILE__))
|
18
|
+
|
19
|
+
response_data = IAPVerifier::Request.new(receipt).response
|
15
20
|
|
16
21
|
assert_equal true, response_data.valid?
|
17
22
|
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iap_verifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jun Lin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: curb
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: oj
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
13
41
|
- !ruby/object:Gem::Dependency
|
14
42
|
name: bundler
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -157,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
185
|
version: '0'
|
158
186
|
requirements: []
|
159
187
|
rubyforge_project:
|
160
|
-
rubygems_version: 2.
|
188
|
+
rubygems_version: 2.4.2
|
161
189
|
signing_key:
|
162
190
|
specification_version: 4
|
163
191
|
summary: In-App Purchase receipt verification.
|