smartpay 0.2.7 → 0.2.8

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
  SHA256:
3
- metadata.gz: 56d3e609ce7f1842742670dff4b7eac351f6e653e199362cdd75b6715ec60501
4
- data.tar.gz: 35b80a47568eee0755b4335d3aa68922b5b68767ed8e2371c7a45949783b3269
3
+ metadata.gz: b690d134a39f8c15358fddf3366232d36007e243d0f815d9f5c5b8a0d7c5ba97
4
+ data.tar.gz: 65826519cd1b6eaf41b35b81da6ace598d51e9bfec6188a1e4a8ff5dd0c1c69c
5
5
  SHA512:
6
- metadata.gz: 32ce2b368f3a40956d8fea8929fcf54f3a442688bdc5cb49d3fcb5d1a5b81bb5ba43adcaebd30c0dd1d004fdefa56aeb7e38687bb9912d23157f5d3ead0a33d7
7
- data.tar.gz: db3ed60db92f3246636eb173025aefc1aa0f3153e38f67a3a690e4ad381183f6b916d59cc0f88871d0c69544c2f479a85da9eba9d04d06124e9acc1a32b98434
6
+ metadata.gz: 760b95974a074df025f9d12bdd07477d16395deff65d7322ea35f0473e8aefe0a3055be7c741e6a0417aa9a13fe682b3fec21f41cf6f3968310892402e8ee066
7
+ data.tar.gz: 803cb1451a936e3def75c46a6e7c4c702c070ea473066c68edc1a1b7163109d36062a6b579267c47b4fb0da075f34ae3a459d172801b28a13125c3c39eb01dd7
@@ -166,7 +166,7 @@ module Smartpay
166
166
  if currency.nil?
167
167
  items = payload.dig(:orderData, :lineItemData, :priceData) || payload.dig(:items)
168
168
  if !items.nil? && items.count > 0
169
- currency = items.first.dig(:currency)
169
+ currency = items.first.dig(:currency) || item.first.dig('currency')
170
170
  end
171
171
  end
172
172
  currency
@@ -177,7 +177,7 @@ module Smartpay
177
177
  if total_amount.nil?
178
178
  items = payload.dig(:orderData, :lineItemData, :priceData) || payload.dig(:items)
179
179
  if !items.nil? && items.count > 0
180
- total_amount = items.inject(0) { |sum, item| sum + (item[:amount] || 0) }
180
+ total_amount = items.inject(0) { |sum, item| sum + (item[:amount] || item['amount'] || 0) }
181
181
  end
182
182
  end
183
183
  total_amount
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Smartpay
4
- VERSION = "0.2.7"
4
+ VERSION = "0.2.8"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartpay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Smartpay