#mattox_code
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/1468647247683260561
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Are you using the payment element? Can you share a subscription id where this happened?
It's my frontend :
const {error: pmError, paymentMethod} = await stripe.createPaymentMethod({
type: 'card',
card: cardElement,
});
if (pmError) {
throw pmError;
}
const response = await fetch(this.subscribeActionRoute, {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
creator_id: this.creatorId,
payment_method_id: paymentMethod.id,
}),
});
const data = await response.json();
if (!response.ok) {
throw new Error(data.message || data.error || 'Erreur serveur');
}
// Succès — redirection
window.location.href = this.subscribeSuccessRoute;
This subscription id is incomplete : sub_1Sx922RyGULvWCv91KDVnMeN
yes i use the payment element
its works when i use the good card, but don't work with secure 3D :/
Doesn't look like it based on the above code
Looks like you create a payment method from the card element
If doing it this route you need to explicitly handle 3ds
But I cannot recommend you build an integration this way. This is a really old way of doing things
I recommend you do this instead: https://docs.stripe.com/billing/subscriptions/build-subscriptions?payment-ui=elements&api-integration=paymentintents
And 3ds should be handled automatically when required
FYI i'm taking over for codename_duchess - i just wanna second their recommendation to follow that guide for now, but feel free to let me know if you have any additional questions
Okay, I'll try that and get back to you, thanks you !