#shaharyarilyas
1 messages ยท Page 1 of 1 (latest)
You just want info on the Stripe fees that were charged? Or other fees?
i want all the fees that Stripe was charging me on every payment
I'm collecting payment using destination charges
https://stripe.com/docs/connect/destination-charges
here is my code
amount: amountInCents,
currency: "gbp",
payment_method_types: ["card_present"],
capture_method: "manual",
transfer_data: { destination: accountId },
application_fee_amount: application_fee_amount,
on_behalf_of: accountId,
transfer_group: accountId,
});```
So, it's a little bit complicated to do via the API. Do you want to just see a Dashboard report of the fees? Or is it important that you get the info via the API?
it's important because we want to show how much stripe charge us from every payment
Sure, but you can get that either via the Stripe Dashboard, or via the API. The API is going to be complicated. So that's why I'm asking which one you're wanting to use.
using api
can i check how much stripes deduct fees before creating payment intent so i will set application fee amount accordingly
So in that case, getting the fee information goes like this:
- get
latest_chargevia the Payment Intent --> look at the Charge object - get
balance_transactionvia the Charge object --> look at the Balance Transaction - get
feeandfee_detailsfom the Balance Transaction object
In that order.
Does that make sense?
but I didn't get any information from these keys i already check this
wait i share the payload
look at this fee_details have an empty array
@grave belfry
That's a Payment intent. You need to look at the Balance Transaction
"balance_transaction": { "id": "txn_3NzkVFCnTu8C4df516Eyy6G6", "object": "balance_transaction", "amount": 1480, "available_on": 1697155200, "created": 1696961889, "currency": "gbp", "description": null, "exchange_rate": null, "fee": 0, "fee_details": [], "net": 1480, "reporting_category": "charge", "source": "ch_3NzkVFCnTu8C4df51jpEKlO2", "status": "pending", "type": "charge" },
That's because the charge is pending. You won't have fees on payments until they've processed
payment received
pi_3NzkVFCnTu8C4df51aG4NNJH
check this
Did you get that payload immediately after the charge was created?
yes
This payment was created on Sep 30 but its have not those fee details in his latest_charge.balance_transaction payload
That's probably why. You need to run that request after the Balance Transaction is created, which can take up to 24 hours after the payment resolves.
could i change my application_fee_amount in payment_intent if card type is
- American Express
- Corporate/business
- Pre-paid debit
- International
If you were to use the "two step" pattern when confirming the payment, you'd be able to inspect the card payment method, including the network type, and determine any actions you might want to take:
https://stripe.com/docs/payments/build-a-two-step-confirmation
I'm using stripe wisepad3 terminal with our backend
Oh, gotcha -- sorry missed those details
Which mobile paltform are you using this with?
react native
We have beta support for similarly inspecting the collected payment method details before processing:
https://stripe.com/docs/terminal/payments/collect-payment?terminal-sdk-platform=android#collect-inspect-payment-method
But it looks like that's not currently included in the React Native guide
how did i get card payment method and netwok type and after getting this how to set or update application_fee_amount because i didi't see any params in react-native sdk
I'm not sure if this is exposed on the reacti native sdk
If you look at the Android snippets at the link above, you can see where the payment method is inspected:
override fun onSuccess(paymentIntent: PaymentIntent) {
val pm = paymentIntent.paymentMethod
val card = pm?.cardPresentDetails ?: pm?.interacPresentDetails
// Placeholder for business logic on card before confirming paymentIntent
}
In your react native integration, have you checked paymentIntent.paymentMethod after get the paymentIntent from collectPaymentMethod?
const { paymentIntent, error } = await collectPaymentMethod(paymentIntentId);
If the details are available, that's where they'd be
i'm checking
one question if i already set application_fee_amount. can i update this application_fee_amount when capturing payment intent
Yes, that's supported when capturing: https://stripe.com/docs/api/payment_intents/capture#capture_payment_intent-application_fee_amount
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.