helu 0.4 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -0
  3. data/lib/project/helu.rb +14 -8
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53f43e31068f822fdd48fcd78683624efc291a8f
4
- data.tar.gz: ac30439197fac333ca4a18711f87d177926726aa
3
+ metadata.gz: 479a6c67dade5a2f04d2f1f37c3ec9716317cd53
4
+ data.tar.gz: c4c3b119ad109f3f00afb10b2ea013e0464d9d1d
5
5
  SHA512:
6
- metadata.gz: 56f60b03239a1888b33bc197a4006a8e8dcba34cd7c656b21d2f27d4c0f46c25868144735c3c39969bc1d8e867084af9e33c800a4c4b0b216dbca9a5c190363b
7
- data.tar.gz: 98d623936e696e6e85682e41d72771dae04bfa6aef6d518f252bc2a1f3029295ce13f7410382ef3e271fe74131522e4143ddb16cda0a88bb08b8c9b97b17e9fb
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.
@@ -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
- case transaction.transactionState
56
- when SKPaymentTransactionStatePurchased
57
- completeTransaction(transaction)
58
- when SKPaymentTransactionStateFailed
59
- failedTransaction(transaction)
60
- when SKPaymentTransactionStateRestored
61
- restoreTransaction(transaction)
62
- else
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: '0.4'
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-05 00:00:00.000000000 Z
11
+ date: 2013-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake