solidus_nexio 0.4.0 → 0.4.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c824e5f041c3632fed6eee4f0b6b16a87edbc939e4ce4b4a022cfad1099c7355
|
4
|
+
data.tar.gz: bb652b85568a70d550fdaab690a61f2ef103d5eaec22fdd11d53e49a22778a19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '084bc6e66e4e6690b2932280af94932bbe80fe2f7eee9d9150660e01052897ddab09d647bcfc07f5a463a57c6db5817e4e0a5dfe6d6affef2bd8113f41b29fc1'
|
7
|
+
data.tar.gz: 5f90d10aa5c547180d5c6d204dd7cc5fbf041c1709ca0ff9fd980fde43d635f9563abcc435095f66234785887cd5bd5e20fe532d4df514b26830858f736e4837
|
@@ -8,9 +8,13 @@ module SolidusNexio
|
|
8
8
|
|
9
9
|
def capture
|
10
10
|
payment_method = PaymentMethod.find(params[:payment_method_id])
|
11
|
-
payment = payment_method.payments.
|
12
|
-
|
13
|
-
|
11
|
+
payment = payment_method.payments.find_by(number: params[:payment_id])
|
12
|
+
if payment
|
13
|
+
@result = payment_method.capture_order_payment(payment, params[:id], params[:status])
|
14
|
+
render :capture, layout: false
|
15
|
+
else
|
16
|
+
head 404
|
17
|
+
end
|
14
18
|
end
|
15
19
|
end
|
16
20
|
end
|
@@ -4,7 +4,7 @@ module SolidusNexio
|
|
4
4
|
if update_order
|
5
5
|
payment_method = PaymentMethod.find(params[:payment_method_id])
|
6
6
|
result = payment_method.process_order_payment(@order) do |payment|
|
7
|
-
capture_payment_method_payment_state_url(payment_method, payment)
|
7
|
+
capture_payment_method_payment_state_url(payment_method, payment.number)
|
8
8
|
end
|
9
9
|
render json: result
|
10
10
|
else
|
@@ -41,7 +41,7 @@ module SolidusNexio
|
|
41
41
|
def capture_order_payment(payment, id, status)
|
42
42
|
return ProcessResult.new(:invalid, nil) unless payment.checkout?
|
43
43
|
|
44
|
-
if
|
44
|
+
if id.present? && %w[pending authOnly].include?(status)
|
45
45
|
payment.response_code = id
|
46
46
|
auto_capture? ? payment.complete! : payment.pend!
|
47
47
|
ProcessResult.new(:success, nil)
|
@@ -113,14 +113,5 @@ module SolidusNexio
|
|
113
113
|
|
114
114
|
resp.params['redirectUrl'] if resp.params['status'] == 'redirect'
|
115
115
|
end
|
116
|
-
|
117
|
-
def success_payment_status?(payment, id, status)
|
118
|
-
return false unless id.present? && %w[pending authOnly].include?(status)
|
119
|
-
|
120
|
-
data = gateway.get_transaction(id)
|
121
|
-
return false unless data
|
122
|
-
|
123
|
-
data.fetch('plugin', {})['orderNumber'] == payment.order.number
|
124
|
-
end
|
125
116
|
end
|
126
117
|
end
|