#terrybad-fee

1 messages · Page 1 of 1 (latest)

foggy whale
#

When you retrieve the payment intent, expand data.charges.data.balance_transaction

You can get this as the fee property on the balance_transaction for the charge that succeeded on this payment

hasty wind
#

Thanks
I don't get the decimal value though only a string..
"balance_transaction" => "txn_3JpCsnL7TANue3FT0LdCngIo"

foggy whale
#

That is the ID, you will need to look that up

#

Also I was slightly wrong, you would expand charges.data.balance_transaction if this is the retrieve call

hasty wind
#

ahh ok is that via
GET /v1/balance_transactions/:id

foggy whale
#

So yes, try either and let me know how it works

hasty wind
#

$paymentIntent = PaymentIntent::retrieve(
$intentId,
[
'expand' => ['charges.data.balance_transaction']
]
);

#

the expand flag didn't seem to do anything to the response here (php stripe sdk)

#

use Stripe\PaymentIntent;

#

BalanceTransaction::retrieve($id)

#

works

#

seperate request

#

$balanceTransaction = BalanceTransaction::retrieve($paymentIntent->charges->data[0]->balance_transaction);

foggy whale
#

Interesting. When I do that myself it definitely expands the full balance transaction

#

Can you send me the request ID for that retrieve? (req_123)

hasty wind
#

paymentIntent ID pi_3JpDDoL7TANue3FT0w27kuSy

#

balance_transaction txn_3JpDDoL7TANue3FT0kcLPwS9

foggy whale