#nirav-rathod_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/1298226505456947252
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- nirav-rathod_api, 1 hour ago, 10 messages
Please provide solution @hallow maple
๐
That PaymentIntent didn't get confirmed yet
req_SGtWYfL0T26LgN
This request Id has failed
because you didn't passed the Connect Account in the header
You need to pass the Connect Header same as you did with the creation request
In the payment intent response I m getting status "succeeded"
req_knzbjg0JgoeHuo
please take this req_id in consideration
@hallow maple please take above req_id and provide me proper solution.
Please stop using mentions, we are monitoring all threads!
yes with pleasure, checking..
Okay Sorry for that.
this request is for creating the PaymentIntent.
Great, checking the generated events...
There was an updated event evt_3QCeh94GPIPeJVeQ1RR2y8xz generated
but it was not consumed by any webhook
Do you have a Connect Webhook endpoint ?
Yes. But I just want to fetch receipt_url for that particular paymentintent id
Can i fetch receipt_url after my payment is successfully completed.
Yes sure, you need to fetch its charge first
and from the Charge object you get the receipt url
Yes I have done that from retrieve charge api from the response of payment intent I have latest_charge from that I am calling retrieve charge api. But it is howing me charge not found.
Yes that's expected because the capture is async using the recent Stripe API version
You need to make sure that the charge is created first before retreiving it
or listen to the webhook event charge.updated
Or if you want to disable this behavior (but you'll loose in term of performance) and pass capture_method: automatic
https://docs.stripe.com/api/payment_intents/create#create_payment_intent-capture_method<>
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
by adding capture_method: 'automatic_async', will I get charge and in that receipt url.
You need to use automatic if you want immediately get the charge and receipt url
Okay.
try {
paymentIntent = await stripe.paymentIntents.create(
{
amount: finalPaymentAmount,
currency,
payment_method_types: ["card"],
confirm: true,
application_fee_amount: adminFeeInCents,
payment_method: "pm_card_visa",
capture_method: "automatic",
metadata: {
shopkeeper_name: ${shopkeeper?.firstName} ${shopkeeper?.lastName},
shopkeeper_email: shopkeeper?.email,
tip_amount: tip / 100,
cardNumber,
monthYear,
cvc,
cardHolderName,
postalCode,
description,
tax_amount: taxAmount / 100,
},
},
{ stripeAccount: shopkeeper.stripeAccountId }
);
} catch (err) {
throw createError(
400,
Failed to create payment intent: ${err.message}
);
}
console.log("paymentIntent", paymentIntent);
const charge = await stripe.charges.retrieve(
paymentIntent?.latest_charge
);
console.log("๐ ~ charge:", charge);
I am getting still error no such charge
Can you please share the PaymentIntent Id ?
Your charges.retrieve call is missing the stripeAccount parameter
You need to pass the Stripe Account Header for retreive part too.
In retriving charge like this ?
const charge = await stripe.charges.retrieve(
paymentIntent?.latest_charge,
{ stripeAccount: shopkeeper.stripeAccountId }
);