#nizam - stripe fees
1 messages · Page 1 of 1 (latest)
Hi @opaque lion
Okay I was just looking at this so you're in luck.
The trick here is to pass charges.data.balance_transaction as the expand parameter when creating your Payment Intent
okay let try that as you say it has to be done once the payment intent is created
You can also simply query the PaymentIntent API and pass the same value for the expand parameter
Wait...sorry, nevermind we don't have that for the retrieve option
I dont see anything called charges key in documentation for createPaymentIntent
Applied while creating the intent but still no change payment_intent.success
@opaque lion can you please help me out with this
Yes, give me a second to test out some things and I'll get back to you
sure
(Status 400) (Request req_vXeK0GaVHrKj1q) Received unknown parameter: charges
Okay I tested the code and it works for both Create and Retrieve
Here is how you format the expand parameter in PHP: https://stripe.com/docs/api/expanding_objects?lang=php
So for this call you would put 'expand => ['charges.data.balance_transaction']. This is after the Payment Intent has been paid
If you want to check Payment Intents that already exist you can retrieve them by ID here: https://stripe.com/docs/api/payment_intents/retrieve
So I have to put it at the time of retrieving of Payment Intent Details not on creation
Try it out and see what gives you the results you are looking for
But the Charges will be empty if the Payment Intent hasn't been paid yet
Alright. Does that approach work for you?