spree_vpago 2.0.9.pre.beta3 → 2.0.9.pre.beta4

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: f296be84aaf9c992751edaa2755f496ed70899de40b876afeb7013457cf6297a
4
- data.tar.gz: 8d586c4b779e6d6e29a60ae07bd941e920132635ec2b870e360763ad65d93caa
3
+ metadata.gz: 1bff3c94ecaa21b9dcfb67138aa888435953948b8f609b4b46a319885bc7c3e3
4
+ data.tar.gz: 83402df2fba6406190658cd7d0bc62b6b1ce285da70e96881414b86f786e3955
5
5
  SHA512:
6
- metadata.gz: 6891950168f31b3df2f32b39791c8ba902ae19279886dacbfc60265802674007e2a8ff7437f9ee854f6e796a4061ef00dac7d23b98e043f62d64f0b8195c8368
7
- data.tar.gz: a1bcc701762f41001a1327ae1d0609f9b3a0b542a8a24428712eabfee28e200ec357fd946e87586f33bcbaa2ac481403619f5e8325cd286d061097e72e8a571f
6
+ metadata.gz: c1cc295fb06c4d804eda035280028f91e3fcbbff4f22956d7892f5b1bcf931bf1bff9e2bba2124227ec12f57712003d10d235aed015d5fed8cdf10cc64d278c2
7
+ data.tar.gz: bca976171a7475b6c05791a99c5087e5769b092e935a9f5f13bb7f0470cfde4a5613ed2f5bd11b98acdbc38410ca770991157837116ba8093f9c0e7eca0bdb3b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spree_vpago (2.0.9.pre.beta3)
4
+ spree_vpago (2.0.9.pre.beta4)
5
5
  faraday
6
6
  google-cloud-firestore
7
7
  spree_api (>= 4.5)
@@ -3,6 +3,12 @@
3
3
  <%= redirect_urls %>
4
4
  <% @payment.user_informer.payment_is_processing(processing: true) %>
5
5
 
6
+ <dialog id="custom-dialog" style="padding: 1.5em; border-radius: 8px; border: 1px solid #ccc; max-width: 300px;">
7
+ <p style="margin-bottom: 1em;">Do you want to open the app?</p>
8
+ <button id="dialog-confirm" style="margin-right: 1em; padding: 0.5em 1em;">Yes</button>
9
+ <button id="dialog-cancel" style="padding: 0.5em 1em;">No</button>
10
+ </dialog>
11
+
6
12
  <script>
7
13
  document.addEventListener("DOMContentLoaded", () => {
8
14
  const platform = "<%= params[:platform] %>";
@@ -12,23 +18,48 @@
12
18
  const docRefPath = "<%= @payment.user_informer.document_reference_path %>";
13
19
  const successUrl = "<%= @payment.success_url %>";
14
20
 
21
+ function showDialog(onConfirm) {
22
+ const dialog = document.getElementById('custom-dialog');
23
+ const confirmAction = document.getElementById('dialog-confirm');
24
+ const cancelAction = document.getElementById('dialog-cancel');
25
+
26
+ // Clean up old listeners to avoid duplicates
27
+ confirmAction.onclick = null;
28
+ cancelAction.onclick = null;
29
+
30
+ confirmAction.onclick = () => {
31
+ dialog.close();
32
+ onConfirm(true);
33
+ };
34
+ cancelAction.onclick = () => {
35
+ dialog.close();
36
+ onConfirm(false);
37
+ };
38
+
39
+ dialog.showModal();
40
+ }
41
+
15
42
  function setupConfirmPaymentButton() {
16
43
  if (platform === "app") {
17
- window.location.href = redirectUrls.deeplink;
18
- window.location.href = redirectUrls.webview;
44
+ showDialog((proceed) => {
45
+ if (proceed) {
46
+ window.location.href = redirectUrls.deeplink;
47
+ }
48
+ window.location.href = redirectUrls.webview;
49
+ });
19
50
 
20
51
  } else if (confirmButton) {
21
52
  confirmButton.addEventListener("click", () => {
22
- const proceed = confirm("Do you want to open the app?");
23
- if (proceed) {
24
- window.location.href = redirectUrls.deeplink;
25
- }
26
- window.open(redirectUrls.webview, "_blank");
53
+ showDialog((proceed) => {
54
+ if (proceed) {
55
+ window.location.href = redirectUrls.deeplink;
56
+ }
57
+ window.open(redirectUrls.webview, "_blank");
58
+ });
27
59
  });
28
60
  }
29
61
  }
30
62
 
31
-
32
63
  function setupPaymentProcessingListener() {
33
64
  if (window.initPaymentProcessingListener) {
34
65
  window.initPaymentProcessingListener(firebaseConfigs, docRefPath, successUrl);
@@ -1,7 +1,7 @@
1
1
  module SpreeVpago
2
2
  module_function
3
3
 
4
- VERSION = '2.0.9-beta3'.freeze
4
+ VERSION = '2.0.9-beta4'.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.0.9.pre.beta3
4
+ version: 2.0.9.pre.beta4
5
5
  platform: ruby
6
6
  authors:
7
7
  - You