itunes_receipt_decoder 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/itunes_receipt_decoder.rb +4 -2
- data/lib/itunes_receipt_decoder/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f91cdd0877d05e706d5620f7bf29f871ab656f3
|
4
|
+
data.tar.gz: ce718feed167486e498dcbc417a410058505c6c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 269eb5b5315bf31c5318ab7f7236972e81d4dc76f826d1aebdad422355468a104ca1f2b72c5ea7c26688c90d0ed81619354fe30bd7ddd7e7399c585b5d6f3118
|
7
|
+
data.tar.gz: b1cdc45f24929b77c82e75bbfaf068797df9ef46de591795a4f08e0b00f5c92486a29e6e4564a37aaeb312811da23f5b3784db71066657b98f4777f66a1a70e7
|
@@ -12,6 +12,8 @@ require 'itunes_receipt_decoder/decode/unified_receipt'
|
|
12
12
|
module ItunesReceiptDecoder
|
13
13
|
class DecodingError < StandardError; end
|
14
14
|
|
15
|
+
PLIST_REGEX = /(\{(?=.+?\bsignature\b.+?)(?=.+?\bpurchase-info\b.+?).+?\})/m
|
16
|
+
|
15
17
|
##
|
16
18
|
# Initializes either ItunesReceiptDecoder::Decode::Transaction or
|
17
19
|
# ItunesReceiptDecoder::Decode::Unified with the base64 encoded receipt
|
@@ -24,8 +26,8 @@ module ItunesReceiptDecoder
|
|
24
26
|
rescue ArgumentError => e
|
25
27
|
raise DecodingError, e.message
|
26
28
|
else
|
27
|
-
if
|
28
|
-
Decode::TransactionReceipt.new(
|
29
|
+
if (match = raw_receipt.match(PLIST_REGEX))
|
30
|
+
Decode::TransactionReceipt.new(match[0], options)
|
29
31
|
else
|
30
32
|
Decode::UnifiedReceipt.new(raw_receipt, options)
|
31
33
|
end
|