spree_vpago 2.2.2.pre.pre30 → 2.2.2.pre.pre31

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: b1da347c462aa29d8e883eac4f4f8fca3c55d0c730cb656cfb6c87b274fa07c0
4
- data.tar.gz: 56989c2482c31abac32a685f29c128a91f08ebe48994abafaf8a05e41756091a
3
+ metadata.gz: 0cac2ef6c704865b5ba2c236353fd764ba0907cff281f19925947b95954fc2b7
4
+ data.tar.gz: 007b70f2dae2a5f2d96bae4b6372ef4f0e671d38a8950111c1e14d49d1904b2f
5
5
  SHA512:
6
- metadata.gz: c0ee2d20c391566c00d55b00f97c390dc4ac443b645df4fa7168e61a79dade2b22843bcc812246bf6baec858302b458ceb929c8e76726e3a887e093a4b335220
7
- data.tar.gz: 3cf60b537f03640238d6b4b3c8bc91a55a27f154dc57dcca9eede815351b247caab82f22aaedcc994ed546a800e5040a868b295090fa731973e96cbc5f8809a1
6
+ metadata.gz: 2188cc7d99fe2b682bb1ad8326ab0558e7630d039c6409cd322249507905cc04ee5a7a20656f4fe33649831e36bd3ed2736017679330c66e4bb12b6ec3460bfa
7
+ data.tar.gz: 279f897282d2479e6eeb17feaf517e792cd0fe1fb66438ac413bfd5eab49d1605a6d9a471d1d35d93bc6a000b6610d74cfc2fe3dc91c9ba34720574c7f12a9da
@@ -66,6 +66,8 @@ jobs:
66
66
  # run: |
67
67
  # bundle exec brakeman
68
68
 
69
+ # Run all tests except for pre-release tags (e.g., *-pre)
70
+ # to keep those builds fast and allow faster deployment to our testing server.
69
71
  - name: Run test
70
72
  if: ${{ !startsWith(github.ref, 'refs/tags/') || !contains(github.ref_name, '-pre') }}
71
73
  env:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spree_vpago (2.2.2.pre.pre30)
4
+ spree_vpago (2.2.2.pre.pre31)
5
5
  faraday
6
6
  google-cloud-firestore
7
7
  spree_api (>= 4.5)
@@ -18,7 +18,7 @@ async function requestProcessPayment({
18
18
  .querySelector('meta[name="csrf-token"]')
19
19
  .getAttribute("content"),
20
20
  },
21
- body: JSON.stringify(params),
21
+ body: JSON.stringify({ ...params, internal_client: "true" }),
22
22
  });
23
23
 
24
24
  if (!response.ok) {
@@ -68,12 +68,13 @@ module Spree
68
68
 
69
69
  # for ABA reviewing mode, we can disable pushback from bank, and only process it from our app UI instead.
70
70
  # This will give ABA team to know that we don't rely on just pushback and have fallback to process payment.
71
- if @payment.payment_method.type_payway_v2? && @payment.payment_method.reviewing_mode? && request_from_bank?
72
- Rails.logger.info("[Vpago] Processing payment in reviewing mode: #{params}")
71
+ if @payment.payment_method.type_payway_v2? && @payment.payment_method.reviewing_mode? && request_from_external_server?
72
+ Rails.logger.info("[Vpago] Received payment notification from bank in reviewing mode, skipping processing: #{params}")
73
73
  return render json: { status: :ok }, status: :ok
74
74
  end
75
75
 
76
76
  unless @payment.order.paid?
77
+ Rails.logger.info("[Vpago] Enqueuing payment processor job for payment #{@payment.number}: #{params}")
77
78
  Vpago::PaymentProcessorJob.perform_later(
78
79
  payment_number: @payment.number
79
80
  )
@@ -123,8 +124,8 @@ module Spree
123
124
  end
124
125
  end
125
126
 
126
- def request_from_bank?
127
- request.headers['X-CSRF-Token'].nil?
127
+ def request_from_external_server?
128
+ params[:internal_client].blank? || params[:internal_client] == 'false'
128
129
  end
129
130
  end
130
131
  end
@@ -19,9 +19,13 @@
19
19
  }
20
20
 
21
21
  function openUrl(url, delay = 0) {
22
- setTimeout(function() {
22
+ if(delay > 0) {
23
+ setTimeout(function() {
24
+ window.location.href = url;
25
+ }, delay);
26
+ } else {
23
27
  window.location.href = url;
24
- }, delay);
28
+ }
25
29
  }
26
30
 
27
31
  function showRedirectContainer(buttonLabel = null, onClick = null) {
@@ -53,6 +57,7 @@
53
57
  return response.json();
54
58
  })
55
59
  .then(function(data) {
60
+ var shouldDelayBeforeOpenCheckoutUrl = false;
56
61
  var shouldShowRedirectContainer = false;
57
62
 
58
63
  console.log("[Vpago] checkout response data:", JSON.stringify(data));
@@ -69,11 +74,12 @@
69
74
 
70
75
  if (data.abapay_deeplink && shouldOpenAbaPayDeeplink) {
71
76
  openDeeplinkUrl(data.abapay_deeplink);
77
+ shouldDelayBeforeOpenCheckoutUrl = true;
72
78
  shouldShowRedirectContainer = true;
73
79
  }
74
80
 
75
81
  if (data.checkout_qr_url && shouldOpenCheckoutUrl) {
76
- openUrl(data.checkout_qr_url);
82
+ openUrl(data.checkout_qr_url, shouldDelayBeforeOpenCheckoutUrl ? 50 : 0);
77
83
  shouldShowRedirectContainer = false;
78
84
  }
79
85
 
@@ -1,7 +1,7 @@
1
1
  module SpreeVpago
2
2
  module_function
3
3
 
4
- VERSION = '2.2.2-pre30'.freeze
4
+ VERSION = '2.2.2-pre31'.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.pre30
4
+ version: 2.2.2.pre.pre31
5
5
  platform: ruby
6
6
  authors:
7
7
  - You