#shaharyarilyas

1 messages ยท Page 1 of 1 (latest)

feral grailBOT
grave belfry
#

You just want info on the Stripe fees that were charged? Or other fees?

fleet widget
#

i want all the fees that Stripe was charging me on every payment

#

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,
    });```
grave belfry
#

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?

fleet widget
#

it's important because we want to show how much stripe charge us from every payment

grave belfry
#

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.

fleet widget
#

using api

#

can i check how much stripes deduct fees before creating payment intent so i will set application fee amount accordingly

grave belfry
#

So in that case, getting the fee information goes like this:

  1. get latest_charge via the Payment Intent --> look at the Charge object
  2. get balance_transaction via the Charge object --> look at the Balance Transaction
  3. get fee and fee_details fom the Balance Transaction object
#

In that order.

Does that make sense?

fleet widget
#

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

grave belfry
#

That's a Payment intent. You need to look at the Balance Transaction

fleet widget
#

"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" },

grave belfry
#

That's because the charge is pending. You won't have fees on payments until they've processed

fleet widget
#

pi_3NzkVFCnTu8C4df51aG4NNJH

#

check this

feral grailBOT
grave belfry
#

Did you get that payload immediately after the charge was created?

fleet widget
#

yes

#

This payment was created on Sep 30 but its have not those fee details in his latest_charge.balance_transaction payload

grave belfry
#

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.

fleet widget
#

could i change my application_fee_amount in payment_intent if card type is

  • American Express
  • Corporate/business
  • Pre-paid debit
  • International
pulsar bronze
fleet widget
pulsar bronze
#

Oh, gotcha -- sorry missed those details

#

Which mobile paltform are you using this with?

fleet widget
#

react native

pulsar bronze
fleet widget
pulsar bronze
#

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

fleet widget
#

i'm checking

#

one question if i already set application_fee_amount. can i update this application_fee_amount when capturing payment intent

pulsar bronze