spree_vpago 2.0.9.pre.beta5 → 2.0.9.pre.beta6

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: 7af7ed97c69c8a8263697826295b12b59d8eabcd50fc6ec83a8be08f474e024e
4
- data.tar.gz: 58bc7620d3cf994a1302f6c972cef6ff6c3611d58f59667235e7c473f8808769
3
+ metadata.gz: 8380da90c967b83dcd7459852f2ca678d7f751020499c11594ec494f934498d6
4
+ data.tar.gz: 1ef45d4a1e95840b4557524ea79b90278ecaa31a3d7a622ce8103a980cee0c27
5
5
  SHA512:
6
- metadata.gz: d3b9a0bc94d9b0baf78a87632c227eca2237928805255e815dcd0afa9919115191755ac7741173d821fc46703b8529186f6eeb3a8dfee1f79235394e20e66929
7
- data.tar.gz: 6f930577991ff8830593fc48d64ec9c6be8b894c73648987caf6f08a103ef2e800e7355a1a57f09f41d6cf2c56a92c818b6e1d5cc64e5e78537484b3e55a227c
6
+ metadata.gz: ae2d1e9fc775dbe421aa11a33e49c62bfffc187d7a20f233afd19dd0e5380cb617143e344512aa5aea20028282b4631430c19f9a36668ad339060442e8519fd4
7
+ data.tar.gz: d31fe7252faed714169788679e06b2d9939a0faa571e8b0dcdfee8c4833bb0f8b884486a41c67e2ab2a65a384805b0fb796de42f9bda9fde3aaee1e56e485e28
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spree_vpago (2.0.9.pre.beta5)
4
+ spree_vpago (2.0.9.pre.beta6)
5
5
  faraday
6
6
  google-cloud-firestore
7
7
  spree_api (>= 4.5)
@@ -5,7 +5,7 @@ module Spree
5
5
 
6
6
  skip_before_action :verify_authenticity_token, only: [:process_payment]
7
7
 
8
- rescue_from ActiveRecord::RecordNotFound, with: :render_not_found
8
+ rescue_from ActiveRecord::RecordNotFound, with: :record_not_found
9
9
  rescue_from CanCan::AccessDenied, with: :access_denied
10
10
 
11
11
  # GET
@@ -1,15 +1,7 @@
1
1
  <% @checkout = ::Vpago::TrueMoney::Checkout.new(@payment) %>
2
2
  <% redirect_urls = @checkout.generate_payment_urls(params[:platform]) %>
3
- <h1><%= params[:platform] %></h1>
4
- <%= redirect_urls %>
5
3
  <% @payment.user_informer.payment_is_processing(processing: true) %>
6
4
 
7
- <dialog id="custom-dialog" style="padding: 1.5em; border-radius: 8px; border: 1px solid #ccc; max-width: 300px;">
8
- <p style="margin-bottom: 1em;">Do you want to open the app?</p>
9
- <button id="dialog-confirm" style="margin-right: 1em; padding: 0.5em 1em;">Yes</button>
10
- <button id="dialog-cancel" style="padding: 0.5em 1em;">No</button>
11
- </dialog>
12
-
13
5
  <script>
14
6
  document.addEventListener("DOMContentLoaded", () => {
15
7
  const platform = "<%= params[:platform] %>";
@@ -19,52 +11,15 @@
19
11
  const docRefPath = "<%= @payment.user_informer.document_reference_path %>";
20
12
  const successUrl = "<%= @payment.success_url %>";
21
13
 
22
- function showDialog(onConfirm) {
23
- const dialog = document.getElementById('custom-dialog');
24
- const confirmAction = document.getElementById('dialog-confirm');
25
- const cancelAction = document.getElementById('dialog-cancel');
26
-
27
- // Clean up old listeners to avoid duplicates
28
- confirmAction.onclick = null;
29
- cancelAction.onclick = null;
30
-
31
- confirmAction.onclick = () => {
32
- dialog.close();
33
- onConfirm(true);
34
- };
35
- cancelAction.onclick = () => {
36
- dialog.close();
37
- onConfirm(false);
38
- };
39
-
40
- dialog.showModal();
41
- }
42
-
43
14
  function setupConfirmPaymentButton() {
44
15
  if (platform === "app") {
45
- showDialog((proceed) => {
46
- if (proceed) {
47
- window.location.href = redirectUrls.deeplink;
48
- setTimeout(() => {
49
- window.location.href = redirectUrls.webview;
50
- }, 1500);
51
- } else {
52
- window.location.href = redirectUrls.webview;
53
- }
54
- });
55
-
16
+ window.location.href = redirectUrls.deeplink;
17
+ setTimeout(() => {
18
+ window.location.href = redirectUrls.webview;
19
+ }, 1500);
56
20
  } else if (confirmButton) {
57
21
  confirmButton.addEventListener("click", () => {
58
- showDialog((proceed) => {
59
- if (proceed) {
60
- window.location.href = redirectUrls.deeplink;
61
- setTimeout(() => {
62
- window.location.href = redirectUrls.webview;
63
- }, 1500); // wait 1.5 seconds before redirecting to webview
64
- } else {
65
- window.location.href = redirectUrls.webview;
66
- }
67
- });
22
+ window.open(redirectUrls.webview, '_blank');
68
23
  });
69
24
  }
70
25
  }
@@ -76,7 +31,6 @@
76
31
  console.warn("initPaymentProcessingListener is not defined");
77
32
  }
78
33
  }
79
-
80
34
  setupConfirmPaymentButton();
81
35
  setupPaymentProcessingListener();
82
36
  });
@@ -1,7 +1,7 @@
1
1
  module SpreeVpago
2
2
  module_function
3
3
 
4
- VERSION = '2.0.9-beta5'.freeze
4
+ VERSION = '2.0.9-beta6'.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.beta5
4
+ version: 2.0.9.pre.beta6
5
5
  platform: ruby
6
6
  authors:
7
7
  - You