#harinth_api

1 messages ¡ Page 1 of 1 (latest)

vapid spireBOT
#

👋 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/1298147318733864992

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

winged basin
#

Hi

#

Hello

polar fox
#

Did you check your server and confirm it returns any response to your client app?

vapid spireBOT
winged basin
#

I was getting the webhook till I moved on to stripe.confirmPayment.
I just checked and no webhook came to our server

winged pilot
#

We are not seeing any call for confirmation for the payment intent. Looking at the code you provided, the stripe.confirmPayment call is only made if there is a clientSecret. You will need to add some checks such as console logging the client secret to see if you are getting the client secret correctly.

winged basin
#

If I am calling await for stripe.confirmPayment, then I won't get the clientSecret, otherwise I receive the clientSecret

winged basin
#

Hi

#

Can I replace the below one with an ajax request?

// Create the PaymentIntent and obtain clientSecret
const res = await fetch("/create-intent", {
method: "POST",
});

winged pilot
winged basin
#

Why this error?

polar fox
#

Hi @winged basin I'm taking over this thread.

#

Have you tried adding elements.submit() as the error message suggests?

winged basin
#

Yes, now that error gone, but getting this error now.

Error confirming payment: The provided setup_future_usage (off_session) does not match the expected setup_future_usage (null). Try confirming with a Payment Intent that is configured to use the same parameters as Stripe Elements.

polar fox
#

Ok, that means the options that you pass to elements doesn't match the intent that you created

vapid spireBOT
polar fox
#

For example, if you specify setupFutureUsage in element options ( https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment#additional-options), you also need to set setup_future_usage when creating the payment intent (https://docs.stripe.com/api/payment_intents/object?lang=python#payment_intent_object-setup_future_usage)

Build an integration where you can render the Payment Element prior to creating a PaymentIntent or SetupIntent.

winged basin
#

The provided setup_future_usage (off_session) does not match the expected setup_future_usage (null). Try confirming with a Payment Intent that is configured to use the same parameters as Stripe Elements.

#

This is the error in the log, which means, we should not pass setup_future_usage right?

feral wren
#

It depends on what you're trying to achieve. If you need to use setup_future_usage you should just make sure that you specify it when initiating the Payment Element and when creating the PaymentIntent.

winged basin
#

If we are saving a card, then we need to use this as "off_session" and if we don't want the card to be saved when making payment, we can make it null. Am I correct?