spree_vpago 2.0.8.pre.beta5 → 2.0.8.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d409f9ec377ef642b608cb06e713a66c203c747666483e84659375ac5acde32f
|
4
|
+
data.tar.gz: 20166cc861c7c7a5bbb14df30577710489213c8c93cc865494c59f69db9278a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36ec1da995ad1eaa17a531d6317ce120b5b55618181b8ab783f831250ab95ff5594acdb2bca2bdf06aa3f2d643315e57db792998440c456664dd4e5f715815c2
|
7
|
+
data.tar.gz: 7b1d6d50abcd9856b02b0e035d647514bbe8d8ae7ba7c0e18f98124c05812c28561e0dd60aa6ef1c90bce1c2947e882c326cd1c98d7046e71689afb0d4e2cf22
|
data/Gemfile.lock
CHANGED
@@ -12,7 +12,7 @@ module Vpago
|
|
12
12
|
def checkout_url = "#{base_url}/vpago_payments/checkout?#{query}"
|
13
13
|
def web_checkout_url = "#{base_url}/vpago_payments/checkout?#{query}&platform=web"
|
14
14
|
def processing_url = "#{base_url}/vpago_payments/processing?#{query}"
|
15
|
-
def processing_deeplink_url = "#{@payment.payment_method.preferred_return_url_scheme}/
|
15
|
+
def processing_deeplink_url = "#{@payment.payment_method.preferred_return_url_scheme}book/payment?number=#{order.number}&tk=#{order.token}"
|
16
16
|
def success_url = "#{base_url}/vpago_payments/success?#{query}"
|
17
17
|
def process_payment_url = "#{base_url}/vpago_payments/process_payment?#{query}"
|
18
18
|
|
@@ -2,68 +2,31 @@
|
|
2
2
|
<% redirect_url = @checkout.generate_payment_urls(params[:platform]) %>
|
3
3
|
<% @payment.user_informer.payment_is_processing(processing: true) %>
|
4
4
|
|
5
|
-
<p id="status-message" class="font-bold text-center my-4 text-primary">xcxcx</p>
|
6
|
-
|
7
5
|
<script>
|
8
6
|
document.addEventListener("DOMContentLoaded", () => {
|
9
7
|
|
10
|
-
const
|
11
|
-
|
12
|
-
|
13
|
-
firebaseConfigs: firebaseConfigs,
|
14
|
-
documentReferencePath: "<%= @payment.user_informer.document_reference_path %>",
|
15
|
-
|
16
|
-
onPaymentIsProcessing: function (orderState, paymentState, processing, reasonCode, reasonMessage) {
|
17
|
-
updateStatusMessage("Payment is processing...");
|
18
|
-
},
|
8
|
+
const setupConfirmPaymentButton = () => {
|
9
|
+
const confirmButton = document.getElementById("confirm-payment-button");
|
10
|
+
if (!confirmButton) return;
|
19
11
|
|
20
|
-
|
21
|
-
|
22
|
-
}
|
12
|
+
confirmButton.addEventListener("click", () => {
|
13
|
+
window.open("<%= j redirect_url %>", "_blank");
|
14
|
+
});
|
15
|
+
};
|
23
16
|
|
24
|
-
onOrderIsCompleted: function (orderState, paymentState, processing, reasonCode, reasonMessage) {
|
25
|
-
updateStatusMessage("Order is completed!");
|
26
|
-
},
|
27
17
|
|
28
|
-
|
29
|
-
|
30
|
-
|
18
|
+
setupConfirmPaymentButton();
|
19
|
+
setupPaymentProcessingListener();
|
20
|
+
|
21
|
+
});
|
22
|
+
</script>
|
31
23
|
|
32
|
-
onPaymentIsRefunded: function (orderState, paymentState, processing, reasonCode, reasonMessage) {
|
33
|
-
updateStatusMessage("Payment has been refunded.");
|
34
|
-
},
|
35
24
|
|
36
|
-
onPaymentProcessFailed: function (orderState, paymentState, processing, reasonCode, reasonMessage) {
|
37
|
-
updateStatusMessage("Payment process failed: " + reasonMessage);
|
38
|
-
},
|
39
25
|
|
40
|
-
onCompleted: function (orderState, paymentState, processing, reasonCode, reasonMessage) {
|
41
|
-
updateStatusMessage("Completed — redirecting...");
|
42
|
-
let successPath = "<%= @payment.success_url %>";
|
43
|
-
window.location.href = successPath;
|
44
|
-
},
|
45
|
-
});
|
46
26
|
|
47
|
-
const statusMessageElement = document.getElementById("status-message");
|
48
27
|
|
49
|
-
function updateStatusMessage(message) {
|
50
|
-
if (statusMessageElement) {
|
51
|
-
statusMessageElement.textContent = message;
|
52
|
-
}
|
53
|
-
}
|
54
28
|
|
55
|
-
const setupConfirmPaymentButton = () => {
|
56
|
-
const confirmButton = document.getElementById("confirm-payment-button");
|
57
|
-
if (!confirmButton) return;
|
58
29
|
|
59
|
-
confirmButton.addEventListener("click", () => {
|
60
|
-
window.open("<%= j redirect_url %>", "_blank");
|
61
|
-
updateStatusMessage("Redirected to payment gateway...");
|
62
|
-
});
|
63
|
-
};
|
64
30
|
|
65
|
-
setupConfirmPaymentButton();
|
66
31
|
|
67
32
|
|
68
|
-
});
|
69
|
-
</script>
|
data/lib/spree_vpago/version.rb
CHANGED