spree_vpago 2.3.1.pre.pre1 → 2.3.1.pre.pre3

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: bab3806e6c7ff83a83c403b9e05fc27ec43314e9a23a9856e850cf9235f0b15f
4
- data.tar.gz: 67e45376ac85892bbf43215916bd9fc85994f1d1baa3e871687063cfb9c78446
3
+ metadata.gz: b9f06a7b6b20750f8a0bec1008b87e4149e4f28fb349738a74fc4ab9d1bdefc3
4
+ data.tar.gz: a6f00d08e235027974cbbca511836cc8ad3d4b69f3a6ab56de68d0d778f39cb6
5
5
  SHA512:
6
- metadata.gz: 89fe788fbb4845d4ecfe884043e5e714a11a8f09f3e53b1d1c941960bdbf761cb693da0ea18bf9ca83df222be1c92c08bbfc4392e861f880ba5c6a7b576e3399
7
- data.tar.gz: c0f18dda30ec14cddf791824399634ec3f4c0fed0f796a993134352c20a6f643f009dece8c72295af253cb51e29ae83942422282db4846e7e32172d230857ce1
6
+ metadata.gz: 22d3e2d3e30092217ce4562c8e82444bdbb953b4a45e2e27f2f364c11ea5fc14bd481015db281996d8a319eefe8b781d3e03f2d18a07c8516b92660cf4d97225
7
+ data.tar.gz: 989df66e5941b5e9edd751b2d11ce4b4c54172615af18809b0204c81fe89e85a8f3001565b3e0eb2375c10f660c0469805da8db9560b6ea72addda72fae56bde
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spree_vpago (2.3.1.pre.pre1)
4
+ spree_vpago (2.3.1.pre.pre3)
5
5
  faraday
6
6
  google-cloud-firestore
7
7
  spree_api (>= 4.5)
@@ -17,8 +17,6 @@ module Spree
17
17
 
18
18
  validates :preferred_public_key, presence: true, if: :enable_pre_auth?
19
19
  validates :preferred_abapay_khqr_deeplink_option, inclusion: { in: ABAPAY_KHQR_DEEPLINK_OPTIONS }, if: :abapay_khqr_deeplink?
20
-
21
- # For initial save, there is no preferences yet, so validating them would failed. Only validate along with host or api key.
22
20
  validates :preferred_payment_option, inclusion: { in: PAYMENT_OPTIONS }
23
21
 
24
22
  def reviewing_mode?
@@ -13,6 +13,15 @@
13
13
  </form>
14
14
 
15
15
  <script>
16
+ const abapayKhqrDeeplink = <%= @payment.payment_method.abapay_khqr_deeplink? %>;
17
+ const shouldOpenAbaPayDeeplink = <%= mobile_user_agent? && @payment.payment_method.open_abapay_deeplink? %>;
18
+
19
+ // If the device is not mobile, deeplinks won't work anyway,
20
+ // so we always open the checkout URL (KHQR page) for desktop users.
21
+ //
22
+ // On mobile, only open the checkout URL if explicitly enabled.
23
+ const shouldOpenCheckoutUrl = <%= !mobile_user_agent? && @payment.payment_method.open_checkout_url? %>;
24
+
16
25
  function showRedirectContainer(buttonLabel = null, onClick = null) {
17
26
  const loadingContainer = document.getElementById('vpago_loading_container');
18
27
  const redirectContainer = document.getElementById('vpago_redirect_container');
@@ -34,17 +43,6 @@
34
43
  }
35
44
 
36
45
  function submitFormViaJs(){
37
- const isMobile = <%= mobile_user_agent? %>;
38
-
39
- const abapayKhqrDeeplink = <%= @payment.payment_method.abapay_khqr_deeplink? %>;
40
- const shouldOpenAbaPayDeeplink = isMobile && <%= @payment.payment_method.open_abapay_deeplink? %>;
41
-
42
- // If the device is not mobile, deeplinks won't work anyway,
43
- // so we always open the checkout URL (KHQR page) for desktop users.
44
- //
45
- // On mobile, only open the checkout URL if explicitly enabled.
46
- const shouldOpenCheckoutUrl = !isMobile || <%= @payment.payment_method.open_checkout_url? %>;
47
-
48
46
  var formData = new FormData(document.getElementById("aba_merchant_request"));
49
47
  var checkoutUrl = document.getElementById("aba_merchant_request").action;
50
48
 
@@ -1,7 +1,7 @@
1
1
  module SpreeVpago
2
2
  module_function
3
3
 
4
- VERSION = '2.3.1-pre1'.freeze
4
+ VERSION = '2.3.1-pre3'.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.3.1.pre.pre1
4
+ version: 2.3.1.pre.pre3
5
5
  platform: ruby
6
6
  authors:
7
7
  - You