#feni-patel_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/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.
- feni-patel_api, 1 hour ago, 20 messages
- feni-patel_api, 3 days ago, 4 messages
- feni-patel_api, 5 days ago, 7 messages
- feni-patel_api, 5 days ago, 9 messages
Hello
Hello
You should be able to get that from the Charge object: https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card-last4
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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');
Can you share the ID (req_xxx) of the API request? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
'request-id': 'req_gzNWR9sNrc14yf',
i am getting this type of error Error retrieving Stripe fees: StripeInvalidRequestError: No such payment_intent: 'pi_3QyXPrFvwcOuFt190YwFFVsb'
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
In this block of API requests
You can also consolidate those calls into one: https://docs.stripe.com/expand/use-cases#stripe-fee-for-payment