-
Notifications
You must be signed in to change notification settings - Fork 1
/
test
83 lines (70 loc) · 3.87 KB
/
test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!-- Load Stripe.js on your website. -->
<script src="https://js.stripe.com/v3"></script>
<!-- Create a button that your customers click to complete their purchase. Customize the styling to suit your branding. -->
<button
style="background-color:#6772E5;color:#FFF;padding:8px 12px;border:0;border-radius:4px;font-size:1em"
id="checkout-button-plan_F3BMYOA8oqXtWG"
role="link"
>
TEST Checkout
</button>
<!-- Live Button! -->
<button
style="background-color:#6772E5;color:#FFF;padding:8px 12px;border:0;border-radius:4px;font-size:1em"
id="checkout-button-plan_F3BniqoWKkEScc"
role="link"
>
Live Checkout (click here to pay)
</button>
<div id="error-message"></div>
<script>
var stripe = Stripe('pk_test_Llnv3emOhx6kls4GSRDqLxVr009Mw1CZE9');
var checkoutButton = document.getElementById('checkout-button-plan_F3BMYOA8oqXtWG');
checkoutButton.addEventListener('click', function () {
// When the customer clicks on the button, redirect
// them to Checkout.
stripe.redirectToCheckout({
items: [{plan: 'plan_F3BMYOA8oqXtWG', quantity: 1}],
// Note that it is not guaranteed your customers will be redirected to this
// URL *100%* of the time, it's possible that they could e.g. close the
// tab between form submission and the redirect.
successUrl: window.location.protocol '//prova.energiaemobilitasostenibile.org/success',
cancelUrl: window.location.protocol '//prova.energiaemobilitasostenibile.org/canceled',
})
.then(function (result) {
if (result.error) {
// If `redirectToCheckout` fails due to a browser or network
// error, display the localized error message to your customer.
var displayError = document.getElementById('error-message');
displayError.textContent = result.error.message;
}
});
});
</script>
<script>
var stripe = Stripe('pk_live_JGqQsMsj90FCfe9rmpGoJwmk002dwohNL9');
var checkoutButton = document.getElementById('checkout-button-plan_F3BniqoWKkEScc');
checkoutButton.addEventListener('click', function () {
// When the customer clicks on the button, redirect
// them to Checkout.
stripe.redirectToCheckout({
items: [{plan: 'plan_F3BniqoWKkEScc', quantity: 1}],
// Note that it is not guaranteed your customers will be redirected to this
// URL *100%* of the time, it's possible that they could e.g. close the
// tab between form submission and the redirect.
successUrl: window.location.protocol '//www.energiaemobilitasostenibile.org/success',
cancelUrl: window.location.protocol '//www.energiaemobilitasostenibile.org/canceled',
})
.then(function (result) {
if (result.error) {
// If `redirectToCheckout` fails due to a browser or network
// error, display the localized error message to your customer.
var displayError = document.getElementById('error-message');
displayError.textContent = result.error.message;
}
});
});
</script>
<section id="h.p_hTnpKAClqd6i" class="yaqOZd" style=""><div class="yaqOZd IFuOkc"></div><div class="mYVXT"><div class="LS81yb VICjCf" tabindex="-1"><div class="hJDwNd-AhqUyc-uQSCkd purZT-AhqUyc-II5mzb pSzOP-AhqUyc-qWD73c JNdkSc">prova<div class="JNdkSc-SmKAyb" jscontroller="wKydJb" jsaction="v9U29b:zTPCnb;" jsname="F57UId"><div class="oKdM2c"><div id="h.p_XecJTCZYqd6E" class="hJDwNd-AhqUyc-uQSCkd jXK9ad D2fZ2 OjCsFc wHaque GNzUNc"><div class="jXK9ad-SmKAyb"><div class="tyJCtd mGzaTb baZpAe"><p id="h.p_ykOL9h3cqd6a" class="zfr3Q"><br></p><p id="h.p_518zqtQ_qfNe" class="zfr3Q"><br></p><p id="h.p_bEAUq4yDqfP0" class="zfr3Q"><br></p><p id="h.p_R_WTy7ICqfSa" class="zfr3Q"><br></p><p id="h.p_rXMnNx54qfVD" class="zfr3Q"><br></p><p id="h.p_T2KdCj0VqfWx" class="zfr3Q"><br></p><p id="h.p_J84CEvCmqfZB" class="zfr3Q"><br></p><p id="h.p_r6cJlZoyqfbZ" class="zfr3Q"><br></p>
</div></div></div></div></div></div></div></div>
</section>