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 +4 -4
- data/lib/nitro_pay/hash.rb +8 -0
- data/lib/nitro_pay/transaction.rb +1 -1
- data/lib/nitro_pay/version.rb +1 -1
- data/spec/nitro_pay/transaction_spec.rb +2 -2
- 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: d7ce146fea575ed2a981da7597abc035d0eb7ff9
|
4
|
+
data.tar.gz: bba8929dd88b6fab8cbe85acd2cc0e144acf8fa4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2914e48e47c3a71806a4085790cc4508b92f1df7d748af6b5b11a4406320dd9e48c6f398a35ccf25021e2a347859a8e915815ccfbb6788104c6c12dc3529416
|
7
|
+
data.tar.gz: 949624f582ff654192b04f0ef155ffe36c328dd9d7395c278189c9b99381966b9b7ae87713e98d487aa58062151741891ada15a56ce7edaf3bc4b56a0b3e6b3a
|
data/lib/nitro_pay/hash.rb
CHANGED
@@ -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
|
data/lib/nitro_pay/version.rb
CHANGED
@@ -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]
|
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
|
+
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-
|
11
|
+
date: 2016-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|