mirror of
https://github.com/itflow-org/itflow
synced 2026-03-09 23:34:50 +00:00
rename /user/ to /agent/ and update links to use agent/ instead
This commit is contained in:
23
agent/js/autopay_setup_stripe.js
Normal file
23
agent/js/autopay_setup_stripe.js
Normal file
@@ -0,0 +1,23 @@
|
||||
// Initialize Stripe.js
|
||||
const stripe = Stripe(document.getElementById("stripe_publishable_key").value);
|
||||
|
||||
initialize();
|
||||
|
||||
// Fetch Checkout Session and retrieve the client secret
|
||||
async function initialize() {
|
||||
const fetchClientSecret = async () => {
|
||||
const response = await fetch("/client/post.php?create_stripe_checkout", {
|
||||
method: "POST",
|
||||
});
|
||||
const { clientSecret } = await response.json();
|
||||
return clientSecret;
|
||||
};
|
||||
|
||||
// Initialize Checkout
|
||||
const checkout = await stripe.initEmbeddedCheckout({
|
||||
fetchClientSecret,
|
||||
});
|
||||
|
||||
// Mount Checkout
|
||||
checkout.mount('#checkout');
|
||||
}
|
||||
Reference in New Issue
Block a user