#harinth_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/1298147318733864992
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there, https://dashboard.stripe.com/test/logs/req_vmRkgRWjoPcR9c based on the request log, the paymentIntent creation request succeeded
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Did you check your server and confirm it returns any response to your client app?
I was getting the webhook till I moved on to stripe.confirmPayment.
I just checked and no webhook came to our server
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.
If I am calling await for stripe.confirmPayment, then I won't get the clientSecret, otherwise I receive the clientSecret
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",
});
Actually I am getting an error while using ajax.
elements.submit() must be called before stripe.confirmPayment(). Call elements.submit() as soon as your customer presses pay, prior to any asynchronous work. Integration guide: https://stripe.com/docs/payments/accept-a-payment-deferred
Are you using the integration mentioned in this guide: https://docs.stripe.com/payments/accept-a-payment-deferred?
"elements.submit() must be called before stripe.confirmPayment(). Call elements.submit() as soon as your customer presses pay, prior to any asynchronous work. Integration guide: https://stripe.com/docs/payments/accept-a-payment-deferred"
Why this error?
Hi @winged basin I'm taking over this thread.
Have you tried adding elements.submit() as the error message suggests?
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.
Ok, that means the options that you pass to elements doesn't match the intent that you created
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)
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?
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.
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?