#matthias-adenin-purse_api
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/1341780023224565864
๐ 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.
- matthias-adenin-purse_best-practices, 2 days ago, 7 messages
- matthias-adenin-purse_valut-forward-raw-pans, 5 days ago, 17 messages
Hi there ๐ by "Hosted Checkout" are you referring to using our Checkout Sessions? Because if so, you shouldn't be creating the Payment Intent yourself, the Checkout Session will handle that automatically as part of its lifecycle.
By hosted checkout I meant this
const elements = stripe.elements();
const card = elements.create('card', {style, hidePostalCode: true});
// Mount the Card Element on the page.
card.mount('#card-element');
// Monitor change events on the Card Element to display any errors.
card.on('change', ({error}) => {
const cardErrors = document.getElementById('card-errors');
if (error) {
cardErrors.textContent = error.message;
cardErrors.classList.add('visible');
} else {
cardErrors.classList.remove('visible');
}
// Re-enable the Pay button.
submitButton.disabled = false;
});
That we are using in our local developments
Am I misunderstanding something ?
Yup, that's not what most people are referring to when they mention using our hosted checkout, they're usually talking about this:
https://docs.stripe.com/checkout/quickstart
So this is a Card Element integration instead. Is this a new integration you're working on building? Typically I'd recommend using the Payment Element rather than the Card Element these days.
https://docs.stripe.com/payments/payment-card-element-comparison
For a Card Element integration, you don't want to confirm the Payment Intent when it's first created. Instead you confirm it client-side, so the Card Element can pass the card details it collected to the intent, and trigger customer authentication flows if the issuer requires 3DS be completed for the transaction to succeed.
For the Card Element, you'd use this confirmCardPayment function within stripe.js:
https://docs.stripe.com/js/payment_intents/confirm_card_payment
passing it the instance of the Card Element that you created, to accomplish that.
Circling back, did that help? I see the thread has been quiet for a while and was getting ready to close it, but wanted to see if you had any other questions first.
Thank you for your answer toby, I was actually reading the documentation you gave me.
Happy to help! Just wanted to make sure there weren't any lingering questions. If there are, and if the thread is closed at that point, you can always open a new thread to ask those questions.
Thank you toby, you can close the topic its ok for me