solidus_nexio 0.7.7 → 0.7.9

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: 84d7f24e77ad02681f03100f5ba6a1c5158f2ea1f6896ca86985dc5337b63b7e
4
- data.tar.gz: 8d2835c43a435267a96b47a25b432557ad355dbc23e895c6e94a2870ac74fbb0
3
+ metadata.gz: b8361f30a70f96efe591f9c8eca63cb42e4a68e67ba7b41b206679a709427a4a
4
+ data.tar.gz: 383d7aef60ffdb1d6ddd155f5d44e1b2e90723cb00dcf031f4b6dc26582cbda2
5
5
  SHA512:
6
- metadata.gz: 324f3ce97218b60403bc66d63a5fac9c2d7367fb37afd5d5eb64c134a55382191b12c27d13124bac93e53bb11e3411fc52e7d2cbca507e5eba12c8fc4d2f4117
7
- data.tar.gz: 9479d807c03118b282bce63348a385848a42913624909c45f4a3fb653e27fc6c177f45b8579e72d01b4d2cb4df019b18093072fe42254853306b382ad6e71cbd
6
+ metadata.gz: 7a79da759f9619d873eaf2a9300144bbb4794c653e2fc44461369e333e55d524ddc83dbfc4ada5ad66e7bf71f9cf4640067619657f40be619ea8d65f8034e4c6
7
+ data.tar.gz: 312b0740baf6cf7b42e1e05a73b4cadefb15fb3edbe022a0d0bb1c56dd5dd2e6c60116592328ff3243e4d7e2c7aa1f0fc1d0fb556b4b8ceaefe70c27548545fd
@@ -24,12 +24,7 @@ module SolidusNexio
24
24
  private
25
25
 
26
26
  def current_order_params
27
- {
28
- currency: current_pricing_options.currency,
29
- guest_token: cookies.signed[:guest_token],
30
- store_id: current_store.id,
31
- user_id: try_spree_current_user.try(:id)
32
- }.tap do |order_params|
27
+ super.tap do |order_params|
33
28
  order_params.delete(:user_id) if order_params[:guest_token].present? && order_params[:user_id].blank?
34
29
  end
35
30
  end
@@ -35,6 +35,10 @@ module SolidusNexio
35
35
  ApmSource
36
36
  end
37
37
 
38
+ def try_void(payment)
39
+ cancel(payment.response_code)
40
+ end
41
+
38
42
  private
39
43
 
40
44
  def gateway_class
@@ -12,7 +12,7 @@ module SolidusNexio
12
12
 
13
13
  def cancel(id)
14
14
  transaction = gateway.get_transaction(id)
15
- return unless transaction
15
+ return error_response(id, 'not found') unless transaction
16
16
 
17
17
  if Mappings.settled?(transaction.status)
18
18
  credit(transaction.amount.to_money.cents, id)
@@ -33,5 +33,10 @@ module SolidusNexio
33
33
  end
34
34
  result
35
35
  end
36
+
37
+ def error_response(transaction_id, code)
38
+ error_mess = "The transaction ID:#{transaction_id} is #{code} with Nexio API"
39
+ OpenStruct.new('success?': false, to_yml: error_mess)
40
+ end
36
41
  end
37
42
  end
@@ -74,6 +74,10 @@ module SolidusNexio
74
74
  gateway.store(card, options.except(:card, :one_time_token))
75
75
  end
76
76
 
77
+ def try_void(payment)
78
+ void(payment.response_code)
79
+ end
80
+
77
81
  private
78
82
 
79
83
  def gateway_class
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusNexio
4
- VERSION = '0.7.7'
4
+ VERSION = '0.7.9'
5
5
  end
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.7.7
4
+ version: 0.7.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Whitespectre
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-25 00:00:00.000000000 Z
11
+ date: 2023-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nexio_activemerchant