solidus_nexio 0.4.4 → 0.4.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4f32f942482ab71b677fe06a8c00e9c464ea74e9e83ec92958d40a4eb0ba7ce
|
4
|
+
data.tar.gz: fec0dcf3f189afb377b5caf19299c34e30d4c7c79258ae86ece6719bdfebdca4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 867b62c3d119bf846226c4e0bd4c1e32dc5250239645763f339a7b9e61e38f65216101f140f6a8e5d85889cb5c14d88db3287e8f20d21c025d2c4e17ca9e1a87
|
7
|
+
data.tar.gz: 859a74fe74eb4a88b78f557c13349864510abfc8f5aca95213ad2ef989d337f42d109b1a4367baf9226dd04d144af3b32360ff21b3ce40f26ce2a6cc3f5a493e
|
@@ -82,6 +82,17 @@ module SolidusNexio
|
|
82
82
|
gateway.store(card, options.except(:card, :one_time_token))
|
83
83
|
end
|
84
84
|
|
85
|
+
def cancel(id)
|
86
|
+
transaction = gateway.get_transaction(id)
|
87
|
+
return unless transaction
|
88
|
+
|
89
|
+
if transaction['transactionStatus'] == 20
|
90
|
+
credit(transaction['amount'].to_money.cents, id)
|
91
|
+
else
|
92
|
+
void(id)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
85
96
|
protected
|
86
97
|
|
87
98
|
def gateway_class
|
@@ -89,9 +100,10 @@ module SolidusNexio
|
|
89
100
|
end
|
90
101
|
|
91
102
|
def add_transaction_options(options)
|
92
|
-
result = %i(currency billing_address
|
103
|
+
result = %i(currency billing_address).each_with_object({}) do |key, acc|
|
93
104
|
acc[key] = options[key] if options[key].present?
|
94
105
|
end
|
106
|
+
result[:address] = options[:shipping_address] if options[:shipping_address].present?
|
95
107
|
if options[:originator].is_a?(::Spree::Payment) && options[:originator].order
|
96
108
|
payment = options[:originator]
|
97
109
|
result.merge!(SolidusNexio::NexioData.purchase(payment.order))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_nexio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Whitespectre
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|