portmone 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 32ea5452ae05d3b3b3a00e6518eb33cf42b735d2
4
- data.tar.gz: '0194704ea315d16f9b9f157282fa6832f84784c6'
3
+ metadata.gz: 04dadd59d3e9aad76804e56529058ca14ef764c5
4
+ data.tar.gz: bb169993f06d91f10ce4e4ea2820961bb9c85aa4
5
5
  SHA512:
6
- metadata.gz: 02aa2a81d5cd8fa7f1a3786eca77af2fdbb3d4be02ac1333657380621cefa275cac2b24e9121dd93e7253205a4068fb7966240c8d47179149f752776eaa37680
7
- data.tar.gz: aca79768b2dccf7d1ab8730e46ef371f5379bd8b72a0b72bb24a1ab813d92b4f85e14c4a0fa0d1c1bb5854c46562a7ca1ba38e714449697dd954da835324aa3d
6
+ metadata.gz: 13c4d5ae5bdc764e1db8d34661f08e9bf210162675378ca7f4e866e21a4198c205ca1e59527daa032ea9d1dc6db1854fd043f5fa40d79878d507d97c95de5782
7
+ data.tar.gz: 89859891b8fd046a5f994f371072c4aeacf8b0edb502eb4a0a16853bd4ba9cef0d7316719dad1b5275cb1e5cc3ddc091bb8a8e2a311cc94647c612b339b9095d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- portmone (0.0.5)
4
+ portmone (0.0.6)
5
5
  activesupport
6
6
  faraday (~> 0.9)
7
7
  money (~> 6.0)
@@ -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.bill_amount
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
@@ -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']) rescue nil
22
+ data['pay_order_date'] && ActiveSupport::TimeZone[@timezone].parse(data['pay_order_date'])
23
23
  end
24
24
 
25
25
  def bill_amount
@@ -1,3 +1,3 @@
1
1
  module Portmone
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
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.5
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-05 00:00:00.000000000 Z
11
+ date: 2018-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport