portmone 0.0.5 → 0.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/Gemfile.lock +1 -1
- data/lib/portmone/responses/order_status.rb +2 -2
- data/lib/portmone/transaction.rb +3 -3
- 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: 04dadd59d3e9aad76804e56529058ca14ef764c5
|
4
|
+
data.tar.gz: bb169993f06d91f10ce4e4ea2820961bb9c85aa4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13c4d5ae5bdc764e1db8d34661f08e9bf210162675378ca7f4e866e21a4198c205ca1e59527daa032ea9d1dc6db1854fd043f5fa40d79878d507d97c95de5782
|
7
|
+
data.tar.gz: 89859891b8fd046a5f994f371072c4aeacf8b0edb502eb4a0a16853bd4ba9cef0d7316719dad1b5275cb1e5cc3ddc091bb8a8e2a311cc94647c612b339b9095d
|
data/Gemfile.lock
CHANGED
@@ -27,7 +27,7 @@ class Portmone::Responses::OrderStatus < Portmone::Responses::BaseResponse
|
|
27
27
|
def amount
|
28
28
|
transactions.select(&:paid?)
|
29
29
|
.map { |t| t.bill_amount }
|
30
|
-
.inject(:+) || transactions.first
|
30
|
+
.inject(:+) || transactions.first&.bill_amount
|
31
31
|
end
|
32
32
|
|
33
33
|
def reversed_amount
|
@@ -70,7 +70,7 @@ class Portmone::Responses::OrderStatus < Portmone::Responses::BaseResponse
|
|
70
70
|
if data
|
71
71
|
Portmone::Transaction.new(data.first.merge(data.last).merge(timezone: @timezone, currency: @currency))
|
72
72
|
else
|
73
|
-
Portmone::Transaction.new(
|
73
|
+
Portmone::Transaction.new(timezone: @timezone, currency: @currency)
|
74
74
|
end
|
75
75
|
end
|
76
76
|
end
|
data/lib/portmone/transaction.rb
CHANGED
@@ -11,15 +11,15 @@ module Portmone
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def bill_date
|
14
|
-
Date.parse(data['bill_date'])
|
14
|
+
data['bill_date'] && Date.parse(data['bill_date'])
|
15
15
|
end
|
16
16
|
|
17
17
|
def pay_time
|
18
|
-
ActiveSupport::TimeZone[@timezone].parse(data['pay_date'])
|
18
|
+
data['pay_date'] && ActiveSupport::TimeZone[@timezone].parse(data['pay_date'])
|
19
19
|
end
|
20
20
|
|
21
21
|
def pay_order_time
|
22
|
-
ActiveSupport::TimeZone[@timezone].parse(data['pay_order_date'])
|
22
|
+
data['pay_order_date'] && ActiveSupport::TimeZone[@timezone].parse(data['pay_order_date'])
|
23
23
|
end
|
24
24
|
|
25
25
|
def bill_amount
|
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.6
|
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-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|