itunes-receipt-mock 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdfacdc47172c0903dee142544f0ed80dd838bed
|
4
|
+
data.tar.gz: 458771f318ad6ede237dd9060005b1b22a8d26c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8290eb01fac562b93968410c17d99248bebd0e5c1d70c75a30331885bc5c3f183842a73a2a1dd7b54a08919356d4848551625ccf27c1fed6c60b89458046e18
|
7
|
+
data.tar.gz: 48730ed21ef83dc111037e39522d0f9db061071f645179f6aafef4926e7a2398871bc7591626c3e738283571ee9569e89005094b5f7a356fcd58c179acd3a564
|
@@ -14,10 +14,10 @@ module ItunesReceiptMock
|
|
14
14
|
|
15
15
|
def date_attrs(prefix, date)
|
16
16
|
{
|
17
|
-
"#{prefix}_date" => date.utc.strftime('%F %T') + ' Etc/GMT',
|
18
|
-
"#{prefix}_date_ms" => date.utc.strftime('%s%L'),
|
19
|
-
"#{prefix}_date_pst" => date.getlocal('-08:00')
|
20
|
-
' America/Los_Angeles'
|
17
|
+
"#{prefix}_date" => date.to_time.utc.strftime('%F %T') + ' Etc/GMT',
|
18
|
+
"#{prefix}_date_ms" => date.to_time.utc.strftime('%s%L'),
|
19
|
+
"#{prefix}_date_pst" => date.to_time.getlocal('-08:00')
|
20
|
+
.strftime('%F %T') + ' America/Los_Angeles'
|
21
21
|
}
|
22
22
|
end
|
23
23
|
end
|
@@ -42,5 +42,17 @@ module ItunesReceiptMock
|
|
42
42
|
.merge(date_attrs('purchase', purchase_date))
|
43
43
|
.merge(date_attrs('original_purchase', original_purchase_date))
|
44
44
|
end
|
45
|
+
|
46
|
+
def to_receipt
|
47
|
+
{
|
48
|
+
'status' => 0,
|
49
|
+
'receipt' => {
|
50
|
+
'bid' => receipt.bundle_id,
|
51
|
+
'app_item_id' => receipt.app_item_id.to_s,
|
52
|
+
'quantity' => quantity.to_s,
|
53
|
+
|
54
|
+
}
|
55
|
+
}
|
56
|
+
end
|
45
57
|
end
|
46
58
|
end
|
@@ -43,12 +43,18 @@ module ItunesReceiptMock
|
|
43
43
|
'latest_receipt_info' => transactions.latest_receipt_info
|
44
44
|
)
|
45
45
|
result.merge!(
|
46
|
-
'latest_receipt' => Base64.strict_encode64(
|
46
|
+
'latest_receipt' => Base64.strict_encode64(
|
47
|
+
JSON.generate(result.as_json)
|
48
|
+
)
|
47
49
|
)
|
48
50
|
end
|
49
51
|
result
|
50
52
|
end
|
51
53
|
|
54
|
+
def to_json
|
55
|
+
JSON.generate(as_json)
|
56
|
+
end
|
57
|
+
|
52
58
|
private
|
53
59
|
|
54
60
|
def inner_json
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itunes-receipt-mock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mbaasy.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|