#anksta_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/1402962717748498574
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Actually, you can collect the card details before creating an intent and attaching it tot he customer
You can use confirmation token and inspect the card type, before creating the Intent (setup or intent)
I have tried this but I can't use those options because I am passing a client secret,:
stripe={stripePromise}
options={{
clientSecret: paymentData.drawInvitePaymentDetails.stripeSetupIntentClientSecret,
appearance: stripeElementsAppearance,
fonts: stripeFonts,
}}
>```
If I try to pass the paymentMethodCreation: "manual" in this options object I get different errors
I have tried this but I can't use those options because I am passing a client secret,:
You don't need to pass a client secret that's the point. You can create the payment method and collect the payment method without creating an intent
You collect the payment method using confirmation token, inspect it and if it's not prepaid then create the intent and confirm it
do I need to use the legacy guide or the current one??
we don't use confirmation tokens anywhere currently
That's the point, using confirmation token will work better for you
do I need to use the legacy guide or the current one??
What legacy guide? both integration aren't legacy, just two different type of flows
because of this in the link you gave: ```Use createPaymentMethod through a legacy implementation
If you’re using a legacy implementation, you might be using the information from stripe.createPaymentMethod to finalise payments on the server. Although we encourage you to follow this guide to Migrate to Confirmation Tokens, you can still access our old documentation to Build two-step confirmation.```
if I just remove the client secret in that Elements integration I get this error: ```IntegrationError: In order to create a linkAuthentication element, you must pass a clientSecret or mode when creating the Elements group.
e.g. stripe.elements({clientSecret: "{{CLIENT_SECRET}}"})```
You are not using a legacy integration now, so you just ignore that part
Yeah you need to remove the client secret and pass a mode
Between, I shared this guide:
https://docs.stripe.com/payments/build-a-two-step-confirmation
And not the legacy one
that guide says to create a confirmation token using
// Create the ConfirmationToken using the details collected by the Payment Element
const {error, confirmationToken} = await stripe.createConfirmationToken({
elements,
params: {
payment_method_data: {
billing_details: {
name: 'Jenny Rosen',
}
}
}
});```
But if I just lift that straight in I get `Property 'createConfirmationToken' does not exist on type 'Stripe'` my stripe comes from `const stripe = useStrip()`
I have updated to the latest package and this property is available but I'm still getting the same error on LinkAuthetnication and PaymentElement, that these elemets need the client_secret
struggling with how I can render PaymentElement without a client secret if I need to remove this to generate a confirmtaion token?
Ah I see, any particular reason why you want to use the LinkAuthentication element with the PaymentELement ?
not sure, I have just been handed this task to reject prepay cards, I didn't build this, all I can see is it's verifying emails, but even if I comment out the LinkAuthentication I get the same error on the PaymentElement element
but even if I comment out the LinkAuthentication I get the same error on the PaymentElement element
What error ?
Could you please share more details ?
the same as the LinkAuthentication one:
e.g. stripe.elements({clientSecret: "{{CLIENT_SECRET}}"})```
is the mode object in the Elements group just "mode: 'payment'"?
You need to pass the options mentioned here:
https://docs.stripe.com/payments/build-a-two-step-confirmation#add-the-payment-element-to-your-checkout-page
if I pass the options like that I fall down on our Error boundary:
stripe={stripePromise}
options={{
// clientSecret: paymentData.drawInvitePaymentDetails.stripeSetupIntentClientSecret,
appearance: stripeElementsAppearance,
fonts: stripeFonts,
mode: "payment",
paymentMethodCreation: "manual",
}}
>```
just causes "Error: something went wrong"