spree_vpago 2.2.2.pre.pre31 → 2.2.2.pre.pre32
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: 546d5a9a9b9bfdb133bb004ced338d3f7eb25e3d3457be702977c5151fed0a49
|
|
4
|
+
data.tar.gz: af8336e3a285aa72e38c4394949976a02859684726affa6a59613e7b7299472c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d074185532ce26c8eca1b37ac80e1d6d7cbe1d28c315cec00cde0e300a8a2531240bade92f2d3c79cf4b2db8b4e02fe171fba7f8f6d497fc03be6a811ff65723
|
|
7
|
+
data.tar.gz: 864ee972a10daeccbda38a480d77606186e0a517b985bf6d97dc387fe0697c45477d2c70a6f96483f8b580c2858922f68ebd0413e23d0da0c0bf9e8e37cbcbff
|
data/Gemfile.lock
CHANGED
|
@@ -24,6 +24,8 @@ module Spree
|
|
|
24
24
|
raise ActiveRecord::RecordNotFound unless @payment.present?
|
|
25
25
|
|
|
26
26
|
@order = @payment.order
|
|
27
|
+
|
|
28
|
+
Rails.logger.info("[Vpago] Showing processing page for payment #{@payment.number} for order #{@order.number}")
|
|
27
29
|
end
|
|
28
30
|
|
|
29
31
|
# GET
|
|
@@ -33,6 +35,8 @@ module Spree
|
|
|
33
35
|
|
|
34
36
|
@order = @payment.order
|
|
35
37
|
raise CanCan::AccessDenied unless @order.completed?
|
|
38
|
+
|
|
39
|
+
Rails.logger.info("[Vpago] Showing success page for payment #{@payment.number} for order #{@order.number}")
|
|
36
40
|
end
|
|
37
41
|
|
|
38
42
|
# GET
|
|
@@ -44,7 +48,9 @@ module Spree
|
|
|
44
48
|
return render json: { status: :failed }, status: :ok if @payment.failed?
|
|
45
49
|
|
|
46
50
|
if @payment.payment_method.support_check_transaction_api?
|
|
51
|
+
Rails.logger.info("[Vpago] Checking transaction for payment #{@payment.number}")
|
|
47
52
|
checker = @payment.payment_method.check_transaction(@payment)
|
|
53
|
+
Rails.logger.info("[Vpago] Check transaction result for payment #{@payment.number} with success: #{checker.success?}, failed: #{checker.try(:failed?)}")
|
|
48
54
|
|
|
49
55
|
if checker.success?
|
|
50
56
|
render json: { status: :success }, status: :ok
|
|
@@ -60,11 +66,18 @@ module Spree
|
|
|
60
66
|
|
|
61
67
|
# POST
|
|
62
68
|
def process_payment
|
|
69
|
+
Rails.logger.info("[Vpago] Received payment notification: method=#{request.method}, params=#{params.to_unsafe_h}")
|
|
63
70
|
return render json: { status: :ok }, status: :ok if request.method != 'POST'
|
|
64
71
|
|
|
65
72
|
return_params = sanitize_return_params
|
|
66
73
|
@payment = Vpago::PaymentFinder.new(return_params).find_and_verify
|
|
67
|
-
|
|
74
|
+
|
|
75
|
+
if @payment.nil?
|
|
76
|
+
Rails.logger.error("[Vpago] Payment not found for params: #{return_params}")
|
|
77
|
+
return render_not_found
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
Rails.logger.info("[Vpago] Payment found: #{@payment&.number}, order: #{@payment&.order&.number}")
|
|
68
81
|
|
|
69
82
|
# for ABA reviewing mode, we can disable pushback from bank, and only process it from our app UI instead.
|
|
70
83
|
# This will give ABA team to know that we don't rely on just pushback and have fallback to process payment.
|
|
@@ -80,6 +93,7 @@ module Spree
|
|
|
80
93
|
)
|
|
81
94
|
end
|
|
82
95
|
|
|
96
|
+
Rails.logger.info("[Vpago] Successfully enqueued payment processor job for payment #{@payment.number}: #{params}")
|
|
83
97
|
render json: { status: :ok }, status: :ok
|
|
84
98
|
rescue StandardError => e
|
|
85
99
|
Rails.logger.error("[Vpago] Failed to enqueue payment processor job: #{params} #{e.message}")
|
|
@@ -94,6 +108,7 @@ module Spree
|
|
|
94
108
|
return render_not_found unless @payment
|
|
95
109
|
|
|
96
110
|
Vpago::PaymentProcessorJob.perform_later(payment_number: @payment.number) unless @payment.order.paid?
|
|
111
|
+
Rails.logger.info("[Vpago] Successfully enqueued payment processor job for payment #{@payment.number}: #{params}")
|
|
97
112
|
|
|
98
113
|
render json: { status: { code: '000001', message: 'success' }, data: nil }, status: :ok
|
|
99
114
|
rescue StandardError => e
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
if (data.checkout_qr_url && shouldOpenCheckoutUrl) {
|
|
82
|
-
openUrl(data.checkout_qr_url, shouldDelayBeforeOpenCheckoutUrl ?
|
|
82
|
+
openUrl(data.checkout_qr_url, shouldDelayBeforeOpenCheckoutUrl ? 500 : 0);
|
|
83
83
|
shouldShowRedirectContainer = false;
|
|
84
84
|
}
|
|
85
85
|
|
data/lib/spree_vpago/version.rb
CHANGED