#shubham_docs
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/1239566090976362567
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, can you share the request id where you saw this error? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request.
Taking a look
Sure
The error states that the PaymentIntent needs a payment method. It does not look like you're passing the payment method id, https://docs.stripe.com/api/payment_intents/create#create_payment_intent-payment_method and the customer does not seem to have a default payment method saved either. Can you try attaching a payment method to the customer, and then create a PaymentIntent by passing the payment method ID?
Sure, Let me try this
req_WU8f1CdLYsivLm
Another request id with pretty much the same message
I think the payment Method is not attached to the intent yet.
Yeah, that is the same state. You need to attach the payment method on the customer, https://docs.stripe.com/api/payment_methods/attach and then pass the payment method ID when you create the PaymentIntent.
req_GxNTi0GBhpzQWy
Please check this one
I have now a payment method sucessfully attached to this paymentIntent
I am using capture method automatic async for this:
Should be something else?
When you created this payment intent, https://dashboard.stripe.com/test/logs/req_0bKKhLGaG561yo you did not specify the confirm method, https://docs.stripe.com/api/payment_intents/create#create_payment_intent-confirmation_method. I assume you'd want automatic here. Can you add this parameter?
Sure
Trying this..
Quick question, confirm - automatic works for both payment intent capture (Server Side) and Client Side using customer Sheet / Payment Sheet?
This PaymentIntent could not be captured because it has a status of requires_confirmation. Only a PaymentIntent with one of the following statuses may be captured: requires_capture.; code: payment_intent_unexpected_state; request-id: req_TklpZRAdj6k1gw
Still getting the same
Can you share the request id?
req_TklpZRAdj6k1gw
Can you pass confirm: true https://docs.stripe.com/api/payment_intents/create#create_payment_intent-confirm when you create it?
Here's my code
This will also work for Payment sheet/ Customer Sheet?
req_wkJdyXFspHGosS
New error.
Hi there ๐ that error says that a return_url is missing, does the error subside if you provide a return_url or use the alternative option discussed in the error message to avoid that requirements?
Can you also elaborate on what you're trying to do? Initially you asked about doing this server-side, but you're now asking about doing it from the Payment Sheet, so I'm not quite sure what you're trying to accomplish here.
req_UpI7gUJmh89m8A
Here's a new one.
I basically changed the setAutomaticPaymentMethods
and configured like this:
.setAllowRedirects(PaymentIntentCreateParams.AutomaticPaymentMethods.AllowRedirects.NEVER)
.setEnabled(true)
Then I got an error to remove the ConfirmationMethod so I did.
Now it says payment intent has already been already captured
Correct, because the intent was confirmed and captured by the request to create it. The intent from that creation request was returned with a status of succeeded:
https://dashboard.stripe.com/test/logs/req_hPNHUEv5JqjhaA
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Oh, So does that mean I don't need to do anything else to charge the customer? Just create the intent with said parameters
When the payments succeed, yes that is correct. You should still be prepared to handle the case where the payment fails, in which case you'll need to bring your customer back on session so they can provide updated payment method details or complete the required authentication challenge.
Okay. Thanks So much for this
Any time!