portmone 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/portmone/responses/order_status.rb +13 -5
- data/lib/portmone/version.rb +1 -1
- 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: 32ea5452ae05d3b3b3a00e6518eb33cf42b735d2
|
4
|
+
data.tar.gz: '0194704ea315d16f9b9f157282fa6832f84784c6'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02aa2a81d5cd8fa7f1a3786eca77af2fdbb3d4be02ac1333657380621cefa275cac2b24e9121dd93e7253205a4068fb7966240c8d47179149f752776eaa37680
|
7
|
+
data.tar.gz: aca79768b2dccf7d1ab8730e46ef371f5379bd8b72a0b72bb24a1ab813d92b4f85e14c4a0fa0d1c1bb5854c46562a7ca1ba38e714449697dd954da835324aa3d
|
data/Gemfile.lock
CHANGED
@@ -55,23 +55,31 @@ class Portmone::Responses::OrderStatus < Portmone::Responses::BaseResponse
|
|
55
55
|
|
56
56
|
def transactions
|
57
57
|
@transactions ||= begin
|
58
|
-
data
|
59
|
-
|
58
|
+
if data
|
59
|
+
data.map do |h|
|
60
|
+
Portmone::Transaction.new(h.merge(timezone: @timezone, currency: @currency))
|
61
|
+
end
|
62
|
+
else
|
63
|
+
[]
|
60
64
|
end
|
61
65
|
end
|
62
66
|
end
|
63
67
|
|
64
68
|
def order
|
65
69
|
@order ||= begin
|
66
|
-
|
70
|
+
if data
|
71
|
+
Portmone::Transaction.new(data.first.merge(data.last).merge(timezone: @timezone, currency: @currency))
|
72
|
+
else
|
73
|
+
Portmone::Transaction.new({})
|
74
|
+
end
|
67
75
|
end
|
68
76
|
end
|
69
77
|
|
70
78
|
private
|
71
79
|
|
72
80
|
def data
|
73
|
-
data = @xml_data.dig('portmoneresult', 'orders', 'order') || @xml_data.dig('portmoneresult', 'order')
|
74
|
-
data = [data]
|
81
|
+
data = @xml_data.dig('portmoneresult', 'orders', 'order') || @xml_data.dig('portmoneresult', 'order')
|
82
|
+
data = [data] if data.is_a?(Hash) # cannot use Array() on Hash
|
75
83
|
data
|
76
84
|
end
|
77
85
|
end
|
data/lib/portmone/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: portmone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Sviridov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|