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: 0cac2ef6c704865b5ba2c236353fd764ba0907cff281f19925947b95954fc2b7
4
- data.tar.gz: 007b70f2dae2a5f2d96bae4b6372ef4f0e671d38a8950111c1e14d49d1904b2f
3
+ metadata.gz: 546d5a9a9b9bfdb133bb004ced338d3f7eb25e3d3457be702977c5151fed0a49
4
+ data.tar.gz: af8336e3a285aa72e38c4394949976a02859684726affa6a59613e7b7299472c
5
5
  SHA512:
6
- metadata.gz: 2188cc7d99fe2b682bb1ad8326ab0558e7630d039c6409cd322249507905cc04ee5a7a20656f4fe33649831e36bd3ed2736017679330c66e4bb12b6ec3460bfa
7
- data.tar.gz: 279f897282d2479e6eeb17feaf517e792cd0fe1fb66438ac413bfd5eab49d1605a6d9a471d1d35d93bc6a000b6610d74cfc2fe3dc91c9ba34720574c7f12a9da
6
+ metadata.gz: d074185532ce26c8eca1b37ac80e1d6d7cbe1d28c315cec00cde0e300a8a2531240bade92f2d3c79cf4b2db8b4e02fe171fba7f8f6d497fc03be6a811ff65723
7
+ data.tar.gz: 864ee972a10daeccbda38a480d77606186e0a517b985bf6d97dc387fe0697c45477d2c70a6f96483f8b580c2858922f68ebd0413e23d0da0c0bf9e8e37cbcbff
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spree_vpago (2.2.2.pre.pre31)
4
+ spree_vpago (2.2.2.pre.pre32)
5
5
  faraday
6
6
  google-cloud-firestore
7
7
  spree_api (>= 4.5)
@@ -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
- return render_not_found unless @payment.present?
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 ? 50 : 0);
82
+ openUrl(data.checkout_qr_url, shouldDelayBeforeOpenCheckoutUrl ? 500 : 0);
83
83
  shouldShowRedirectContainer = false;
84
84
  }
85
85
 
@@ -1,7 +1,7 @@
1
1
  module SpreeVpago
2
2
  module_function
3
3
 
4
- VERSION = '2.2.2-pre31'.freeze
4
+ VERSION = '2.2.2-pre32'.freeze
5
5
 
6
6
  def version
7
7
  Gem::Version.new VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_vpago
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2.pre.pre31
4
+ version: 2.2.2.pre.pre32
5
5
  platform: ruby
6
6
  authors:
7
7
  - You