helu 0.4 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/project/helu.rb +14 -8
- 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: 479a6c67dade5a2f04d2f1f37c3ec9716317cd53
|
4
|
+
data.tar.gz: c4c3b119ad109f3f00afb10b2ea013e0464d9d1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 071d7ecd6e3bab16b8ed8d144da28c7d6dd3f28a92060bf36a2c7445967f7c39e198b63d0b08cc047b780a99f2a402d5dcc6b33ee7c9e9896a50a455e0a07942
|
7
|
+
data.tar.gz: 4412caaa34e3440cbd1b5fc6b5c99e1833f4e345b8033a44d1b2b7cfd60d37ad7c0f6767f973d82f89d0e7d7a2b2fbcb7a7768e4f870e37317f616f9185e52cf
|
data/README.md
CHANGED
@@ -36,6 +36,11 @@ The transaction object on the lambda is the one we get from Apple; Therefore, it
|
|
36
36
|
@helu.buy
|
37
37
|
|
38
38
|
|
39
|
+
Make sure that if your code ever throws out the Helu object, it better also close the store before doing so.
|
40
|
+
|
41
|
+
@helu.close_the_store
|
42
|
+
|
43
|
+
|
39
44
|
## Example App:
|
40
45
|
|
41
46
|
[You can find an example app here](https://github.com/ivanacostarubio/helu-example). Remember that for this to work properly, you must add your app identifier to the Rakefile.
|
data/lib/project/helu.rb
CHANGED
@@ -7,6 +7,10 @@ class Helu
|
|
7
7
|
SKPaymentQueue.defaultQueue.addTransactionObserver(self)
|
8
8
|
end
|
9
9
|
|
10
|
+
def close_the_store
|
11
|
+
SKPaymentQueue.defaultQueue.removeTransactionObserver(self)
|
12
|
+
end
|
13
|
+
|
10
14
|
def fail=(fail_block)
|
11
15
|
@fail = fail_block
|
12
16
|
end
|
@@ -52,14 +56,16 @@ class Helu
|
|
52
56
|
|
53
57
|
def paymentQueue(queue,updatedTransactions:transactions)
|
54
58
|
transactions.each do |transaction|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
59
|
+
if transaction.payment.productIdentifier == @product_id
|
60
|
+
case transaction.transactionState
|
61
|
+
when SKPaymentTransactionStatePurchased
|
62
|
+
completeTransaction(transaction)
|
63
|
+
when SKPaymentTransactionStateFailed
|
64
|
+
failedTransaction(transaction)
|
65
|
+
when SKPaymentTransactionStateRestored
|
66
|
+
restoreTransaction(transaction)
|
67
|
+
else
|
68
|
+
end
|
63
69
|
end
|
64
70
|
end
|
65
71
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: helu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Acosta-Rubio
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|