nitro_pay 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7fe0d4e10546037f44d6780c56032fe5d655cfdd
4
- data.tar.gz: 6ed64e3547108ab95604f08c59cd8c95cd45b8b8
3
+ metadata.gz: d7ce146fea575ed2a981da7597abc035d0eb7ff9
4
+ data.tar.gz: bba8929dd88b6fab8cbe85acd2cc0e144acf8fa4
5
5
  SHA512:
6
- metadata.gz: 6f155218389c29123b07c069fa57bcd4a9e45527ff6326477c8d1819e1851a86863a673781768694210d7daf9764af69acc69cbca24a26c554d8a81ca0232a0e
7
- data.tar.gz: 5d365352db8367ad52e1f5e2c7e355281d010ad9113310b6bc1317c9d0c8e0384fab37c8680a748ed2f98ecbe3a389686d3d800796e6d81b72a1e34a87c986b4
6
+ metadata.gz: c2914e48e47c3a71806a4085790cc4508b92f1df7d748af6b5b11a4406320dd9e48c6f398a35ccf25021e2a347859a8e915815ccfbb6788104c6c12dc3529416
7
+ data.tar.gz: 949624f582ff654192b04f0ef155ffe36c328dd9d7395c278189c9b99381966b9b7ae87713e98d487aa58062151741891ada15a56ce7edaf3bc4b56a0b3e6b3a
@@ -7,6 +7,14 @@ class Hash
7
7
  def it_keys_to_sym
8
8
  self.keys.each do |key|
9
9
  self[key].it_keys_to_sym if self[key].is_a?(Hash)
10
+
11
+ if self[key].is_a?(Array)
12
+ hashes = self[key]
13
+ hashes.each do |current_hash|
14
+ current_hash.it_keys_to_sym
15
+ end
16
+ end
17
+
10
18
  self[(key.to_sym rescue key) || key] = self.delete(key)
11
19
  end
12
20
 
@@ -21,7 +21,7 @@ module NitroPay
21
21
  # GET /api/transactions/:tid by it attr
22
22
  def verify
23
23
  auth_hash = {}
24
- tid = self.resp[:tid]
24
+ !self.tid.nil? ? tid = self.tid : tid = self.resp[:tid]
25
25
  auth_hash[:auth] = self.request_params[:auth]
26
26
  if tid.nil? then return {error:'TID not received'} else self.path = "transactions/#{tid}#{auth_hash.it_keys_to_get_param}" end
27
27
  return self.get_json_request
@@ -1,6 +1,6 @@
1
1
  module NitroPay
2
2
  MAJOR = 1
3
3
  MINOR = 0
4
- PATCH = 4
4
+ PATCH = 6
5
5
  VERSION = "#{MAJOR}.#{MINOR}.#{PATCH}"
6
6
  end
@@ -165,12 +165,12 @@ describe NitroPay::Transaction do
165
165
 
166
166
  context 'verifiable trasaction' do
167
167
  before(:all) do
168
+ @store_transaction = NitroPay::Transaction.new tid: @resp[:tid]
168
169
  @verified = @store_transaction.verify
169
170
  end
170
171
 
171
172
  it 'resp must be a charged status' do
172
- expect(@verified[:status][:code]).to eq(6)
173
- expect(@verified[:status][:name]).to eq('charged')
173
+ expect(@verified[:status]).to eq('charged')
174
174
  end
175
175
 
176
176
  it 'resp must have an array of sold_items' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nitro_pay
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilton Garcia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-14 00:00:00.000000000 Z
11
+ date: 2016-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler