#sarthak17_error
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1280854487757623389
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- sarthak17_error, 53 minutes ago, 15 messages
Also In certain application I am using standard checkout. Howto store cards for that.
Well your fetchClientSecret function returns an empty string. It actually expects a client_secret from the Checkout Session your server generates: https://docs.stripe.com/js/embedded_checkout/init#embedded_checkout_init-options-fetchClientSecret
I was sending session client secret a string but i removed it while sharing
It's fine to share really, nothing secret about it. Please share the exact code you're using and the error you're seeing. Hard to help without specific details!
<script>
const stripe = Stripe("pk_test_t36Iz19QEIDboHSCYfumx2ks",{stripeAccount: 'acct_1PKwmJCdnxoFimfq'});
initialize();
// Create a Checkout Session
async function initialize() {
const fetchClientSecret = async () => {
return "cs_test_a1vL5o0HXkA4kwLocHSH31SxCioRcMycGwvzZdEFeilUro2YhRbieXn2yU_secret_fidwbEhqYWAnPydgaGdgYWFgYScpJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ3dgYWx3YGZxSmtGamh1aWBxbGprJz8nZGlyZHx2J3gl";
};
const checkout = await stripe.initEmbeddedCheckout({
fetchClientSecret,
});
// Mount Checkout
checkout.mount('#checkout');
}
</script>
<div id="checkout">
<!-- Checkout will insert the payment form here -->
</div>
this is the code
OK, and what's the exact issue?
IntegrationError: Invalid initEmbeddedCheckout(options) parameter: fnFetchClientSecret is not an accepted parameter.
I am getting this error
FWIW, if you already have a client secret you can just pass it via clientSecret directly
let me check with that
Otherwise I suspect it's because your fetchClientSecret is a function, not a const/variable and you're not invoking it correctly
<script>
const stripe = Stripe("pk_test_t36Iz19QEIDboHSCYfumx2ks",{stripeAccount: 'acct_1PKwmJCdnxoFimfq'});
initialize();
// Create a Checkout Session
async function initialize() {
const fetchClientSecret = async () => {
return ""
};
const checkout = await stripe.initEmbeddedCheckout("cs_test_a1vL5o0HXkA4kwLocHSH31SxCioRcMycGwvzZdEFeilUro2YhRbieXn2yU_secret_fidwbEhqYWAnPydgaGdgYWFgYScpJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ3dgYWx3YGZxSmtGamh1aWBxbGprJz8nZGlyZHx2J3gl");
// Mount Checkout
checkout.mount('#checkout');
}
</script>
<div id="checkout">
<!-- Checkout will insert the payment form here -->
</div>
this is the updated code
IntegrationError: Invalid value for initEmbeddedCheckout(options): value should be an object. You specified: cs_test_a1vL5o0HXkA4kwLocHSH31SxCioRcMycGwvzZdEFeilUro2YhRbieXn2yU_secret_fidwbEhqYWAnPydgaGdgYWFgYScpJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ3dgYWx3YGZxSmtGamh1aWBxbGprJz8nZGlyZHx2J3gl.
Please tell me the exact format on initEmbeddedCheckout
stripe.initEmbeddedCheckout({
clientSecret: 'your_secret'
})
okay let me check
thats work thanks
How to save cards for stripe standard checkouts because there some application which are old and they are asking for that.
What do you mean by "standard checkouts" exactly?
This is a Split Card Element, right?
There's a guide for Payment Element, which has a similar flow: https://docs.stripe.com/payments/save-and-reuse?platform=web&ui=elements
No this was a old tech before hosted pages and scheckout
I know. The guide I shared is not for hosted checkout surfaces.