#feni-patel_api

1 messages ¡ Page 1 of 1 (latest)

sonic quiverBOT
#

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

📝 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.

cobalt dawn
#

Hello

eager vale
#

Hello

cobalt dawn
#

Okay thanks, i have one function using that function i am getting the stripe processing fess but i am getting an error like no 404 no such payment intent key, like async function getStripeFees(paymentIntentId) {
try {
// Retrieve PaymentIntent
const paymentIntent = await stripe.paymentIntents.retrieve(paymentIntentId);
// Get the charge ID from the PaymentIntent
const chargeId = paymentIntent.charges.data[0].id;

// Retrieve Charge details
const charge = await stripe.charges.retrieve(chargeId);

// Get the fee breakdown
const stripeFee = charge.balance_transaction;

// Retrieve balance transaction to get the exact fee details
const balanceTransaction = await stripe.balanceTransactions.retrieve(stripeFee);

console.log({
  amount: charge.amount,
  currency: charge.currency,
  stripe_fee: balanceTransaction.fee,  // Fee amount in smallest currency unit (e.g., cents)
  net_amount: balanceTransaction.net,  // Net amount received after fees
});

} catch (error) {
console.error('Error retrieving Stripe fees:', error);
}
}

getStripeFees('pi_3QyXPrFvwcOuFt190YwFFVsb');

eager vale
cobalt dawn
#

'request-id': 'req_gzNWR9sNrc14yf',

#

i am getting this type of error Error retrieving Stripe fees: StripeInvalidRequestError: No such payment_intent: 'pi_3QyXPrFvwcOuFt190YwFFVsb'

eager vale
#

Generally that error implies that the pi_xxx ID exists on a different account to the one whose API keys you're using. pi_3QyXPrFvwcOuFt190YwFFVsb exists on acct_1QWf5yFvwcOuFt19, but your request is using keys from acct_1QBBwSFhYfQgOdcB. You're missing the Stripe-Account header: https://docs.stripe.com/connect/authentication

Learn how to add the right information to your API calls so you can make calls for your connected accounts.

eager vale