spree_vpago 2.2.2.pre.pre12 → 2.2.2.pre.pre13
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: 8e1146678e861bc1d84d97e922fb268148a45bb605d9d14414d121428e5c2dc6
|
|
4
|
+
data.tar.gz: fa89bb5e2bfec29f04d4fa31477b6f48d4f8ed0b970faa2bd51d1e828640b87d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bc6d965090f34c46547385cae293652dbc453d2f50524e58d9320aa16bd85b3d8d9cb2e5a8ec8c496867377e133d9dbbbc99b1fa15a988dc6ead8da0a82e08e3
|
|
7
|
+
data.tar.gz: e1c7d30ac4be2adb539b1476c1f1d3aa9fdcd1e3650e09c333f617d463909c3986e2db43f48843e9db5eee17eb464b5a58d2fa68c81d5e0d664bb5ad55cf83e3
|
data/Gemfile.lock
CHANGED
|
@@ -12,101 +12,40 @@
|
|
|
12
12
|
<% end %>
|
|
13
13
|
</form>
|
|
14
14
|
|
|
15
|
-
<!-- WebView Container -->
|
|
16
|
-
<div id="webViewContainer" style="display:none;"></div>
|
|
17
|
-
|
|
18
15
|
<script>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
})
|
|
48
|
-
.then(data => {
|
|
49
|
-
// Validate required fields
|
|
50
|
-
if (!data.checkout_qr_url && !data.abapay_deeplink) {
|
|
51
|
-
throw new Error("Missing checkout_qr_url and abapay_deeplink");
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Setup container as full-screen overlay
|
|
55
|
-
webViewContainer.style.display = "block";
|
|
56
|
-
webViewContainer.style.position = "fixed";
|
|
57
|
-
webViewContainer.style.top = "0";
|
|
58
|
-
webViewContainer.style.left = "0";
|
|
59
|
-
webViewContainer.style.width = "100%";
|
|
60
|
-
webViewContainer.style.height = "100%";
|
|
61
|
-
webViewContainer.style.zIndex = "9999";
|
|
62
|
-
webViewContainer.style.backgroundColor = "#fff";
|
|
63
|
-
|
|
64
|
-
const checkoutIframe = document.createElement("iframe");
|
|
65
|
-
checkoutIframe.src = data.checkout_qr_url;
|
|
66
|
-
checkoutIframe.style.width = "100%";
|
|
67
|
-
checkoutIframe.style.height = "100%";
|
|
68
|
-
checkoutIframe.style.border = "none";
|
|
69
|
-
|
|
70
|
-
webViewContainer.appendChild(checkoutIframe);
|
|
71
|
-
|
|
72
|
-
checkoutIframe.onload = function () {
|
|
73
|
-
if (!data.abapay_deeplink) return;
|
|
74
|
-
|
|
75
|
-
console.log("Checkout loaded, attempting ABA deeplink...");
|
|
76
|
-
|
|
77
|
-
const deeplinkFrame = document.createElement("iframe");
|
|
78
|
-
deeplinkFrame.style.display = "none";
|
|
79
|
-
deeplinkFrame.src = data.abapay_deeplink;
|
|
80
|
-
document.body.appendChild(deeplinkFrame);
|
|
81
|
-
|
|
82
|
-
let appOpened = false;
|
|
83
|
-
|
|
84
|
-
const visibilityHandler = () => {
|
|
85
|
-
appOpened = true;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
document.addEventListener("visibilitychange", visibilityHandler);
|
|
89
|
-
|
|
90
|
-
setTimeout(() => {
|
|
91
|
-
document.removeEventListener("visibilitychange", visibilityHandler);
|
|
92
|
-
|
|
93
|
-
if (!appOpened) {
|
|
94
|
-
console.log("ABA app not installed, staying on checkout page.");
|
|
95
|
-
}
|
|
96
|
-
}, 2000);
|
|
97
|
-
};
|
|
98
|
-
})
|
|
99
|
-
.catch(err => {
|
|
100
|
-
console.error("ABA Deeplink Error:", err);
|
|
101
|
-
console.log("Falling back to regular form submission...");
|
|
102
|
-
|
|
103
|
-
form.style.display = "block";
|
|
104
|
-
form.submit();
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
// CASE 2: Normal ABA KHQR → regular redirect form post
|
|
108
|
-
} else {
|
|
16
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
17
|
+
const form = document.getElementById("aba_merchant_request");
|
|
18
|
+
const paymentOption = form.dataset.paymentOption;
|
|
19
|
+
|
|
20
|
+
if (paymentOption === "abapay_khqr_deeplink") {
|
|
21
|
+
|
|
22
|
+
fetch(form.action, {
|
|
23
|
+
method: "POST",
|
|
24
|
+
body: new FormData(form)
|
|
25
|
+
})
|
|
26
|
+
.then(res => res.json())
|
|
27
|
+
.then(data => {
|
|
28
|
+
|
|
29
|
+
if (!data.checkout_qr_url && !data.abapay_deeplink) {
|
|
30
|
+
throw new Error("Missing payment URLs");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (data.checkout_qr_url) {
|
|
34
|
+
window.open(data.checkout_qr_url, "_blank");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (data.abapay_deeplink) {
|
|
38
|
+
window.location.href = data.abapay_deeplink;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
})
|
|
42
|
+
.catch(err => {
|
|
43
|
+
console.error("Error:", err);
|
|
109
44
|
form.submit();
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
} else {
|
|
48
|
+
form.submit();
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
</script>
|
data/lib/spree_vpago/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spree_vpago
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.2.2.pre.
|
|
4
|
+
version: 2.2.2.pre.pre13
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- You
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-02-
|
|
11
|
+
date: 2026-02-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|