spree_vpago 2.0.9.pre.beta3 → 2.0.9.pre.beta5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7af7ed97c69c8a8263697826295b12b59d8eabcd50fc6ec83a8be08f474e024e
|
4
|
+
data.tar.gz: 58bc7620d3cf994a1302f6c972cef6ff6c3611d58f59667235e7c473f8808769
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3b9a0bc94d9b0baf78a87632c227eca2237928805255e815dcd0afa9919115191755ac7741173d821fc46703b8529186f6eeb3a8dfee1f79235394e20e66929
|
7
|
+
data.tar.gz: 6f930577991ff8830593fc48d64ec9c6be8b894c73648987caf6f08a103ef2e800e7355a1a57f09f41d6cf2c56a92c818b6e1d5cc64e5e78537484b3e55a227c
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,15 @@
|
|
1
1
|
<% @checkout = ::Vpago::TrueMoney::Checkout.new(@payment) %>
|
2
2
|
<% redirect_urls = @checkout.generate_payment_urls(params[:platform]) %>
|
3
|
+
<h1><%= params[:platform] %></h1>
|
3
4
|
<%= redirect_urls %>
|
4
5
|
<% @payment.user_informer.payment_is_processing(processing: true) %>
|
5
6
|
|
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
|
+
|
6
13
|
<script>
|
7
14
|
document.addEventListener("DOMContentLoaded", () => {
|
8
15
|
const platform = "<%= params[:platform] %>";
|
@@ -12,23 +19,56 @@
|
|
12
19
|
const docRefPath = "<%= @payment.user_informer.document_reference_path %>";
|
13
20
|
const successUrl = "<%= @payment.success_url %>";
|
14
21
|
|
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
|
+
|
15
43
|
function setupConfirmPaymentButton() {
|
16
44
|
if (platform === "app") {
|
17
|
-
|
18
|
-
|
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
|
+
});
|
19
55
|
|
20
56
|
} else if (confirmButton) {
|
21
57
|
confirmButton.addEventListener("click", () => {
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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
|
+
});
|
27
68
|
});
|
28
69
|
}
|
29
70
|
}
|
30
71
|
|
31
|
-
|
32
72
|
function setupPaymentProcessingListener() {
|
33
73
|
if (window.initPaymentProcessingListener) {
|
34
74
|
window.initPaymentProcessingListener(firebaseConfigs, docRefPath, successUrl);
|
data/lib/spree_vpago/version.rb
CHANGED