#WEIRDLEMON - PI capture
1 messages ยท Page 1 of 1 (latest)
I'm confused as to what needs to passed in
const paymentIntent =await stripe.paymentIntents.capture({{{{SOME_PARAMETER}}}
);
Well let's start here:https://stripe.com/docs/api/payment_intents/capture?lang=node
Is it the Intent ID which i got from creating the payment intent
or is it the secret
or is it the payment_method id
Description of what I've implemented..
The parameters are clearly spelled out in the doc i linked
- I created a payment Intent and stored the id of the created payment intent.
[args_passed] ==>
const paymentIntent = await stripe.paymentIntents.create({
description,
shipping: {
name: userName,
address: userAddress,
},
customer: customerId,
amount: parseInt(totalAmt * 100),
currency: "usd",
payment_method_types: ["card"],
capture_method: "manual",
payment_method: payment_method_id,
// setup_future_usage: true,
});
- Then I stored the Id of this payment intent created
- I used this stored ID later to capture the payment
I'm getting internal server error without any error code
So, need help
I could be horribly wrong
Somewhere
I don't see anywhere what is exactly passed in as argument in the code example
What else do you want to pass besides the ID?
just the ID
I just want to capture the entire amount
but later
Error: Stripe: Argument "intent" must be a string, but got: undefined
Got this error
Okay so you are failing to pass in the ID as a string in your code., that's required
StripeInvalidRequestError: 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.
Why am I getting this one?
it should have been requires_capture
I created the Intent like this
The payment method requires confirmation
Do you have a request ID for the Payment Intent creation?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Awesome ๐
Thanks a lot for your time!
Sure thing, that's why we're here ๐