-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
75 lines (65 loc) · 1.89 KB
/
Copy pathscript.js
File metadata and controls
75 lines (65 loc) · 1.89 KB
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
const stripe = window.Stripe("pk_test_fEnfqkUj7brxj0AAGO5Ig8rg", {
betas: ["checkout_pm_types"]
});
const $ = document.querySelector.bind(document);
const baseParams = {
successUrl: document.location.href,
cancelUrl: document.location.href
};
$("#checkout-button-one-sku").addEventListener("click", () =>
stripe.redirectToCheckout({
...baseParams,
items: [{ sku: "sku_Ex4IdjQZ98J1Pm", quantity: 1 }]
})
);
$("#checkout-button-two-skus").addEventListener("click", () =>
stripe.redirectToCheckout({
...baseParams,
items: [
{ sku: "sku_Ex4IdjQZ98J1Pm", quantity: 1 },
{ sku: "sku_ErUItdY4PaJtSE", quantity: 1 }
]
})
);
$("#checkout-button-one-sku-billing-address").addEventListener("click", () =>
stripe.redirectToCheckout({
...baseParams,
items: [{ sku: "sku_Ex4IdjQZ98J1Pm", quantity: 1 }],
billingAddressCollection: "required"
})
);
$("#checkout-button-one-plan").addEventListener("click", () =>
stripe.redirectToCheckout({
...baseParams,
items: [{ plan: "plan_Dyp9Xm2TRDp5Rt", quantity: 1 }]
})
);
$("#checkout-button-one-plan-trial").addEventListener("click", () =>
stripe.redirectToCheckout({
...baseParams,
items: [{ plan: "plan_DypBxyTRFfEUvb", quantity: 1 }]
})
);
$("#checkout-button-two-plans").addEventListener("click", () =>
stripe.redirectToCheckout({
...baseParams,
items: [
{ plan: "plan_Dyp9Xm2TRDp5Rt", quantity: 1 },
{ plan: "plan_ELGfwCIygrQlZ8", quantity: 1 }
]
})
);
$("#checkout-button-ideal").addEventListener("click", () =>
stripe.redirectToCheckout({
...baseParams,
items: [{ sku: "sku_EOdmg3sx2P7OLY", quantity: 1 }],
paymentMethodTypes: ["ideal"]
})
);
$("#checkout-button-card-ideal").addEventListener("click", () =>
stripe.redirectToCheckout({
...baseParams,
items: [{ sku: "sku_EOdmg3sx2P7OLY", quantity: 1 }],
paymentMethodTypes: ["card", "ideal"]
})
);