#noglassso-connect-reconciliation
1 messages · Page 1 of 1 (latest)
@brittle mountain a BalanceTransaction has a source property that points to the object that created the BalanceTransaction
You can use our Expand feature https://stripe.com/docs/expand to get that object
Here's an example of one of the balance transaction objects:
Stripe\BalanceTransaction Object
(
[id] => txn_1OWOhn2HAg2qyuadHyoEA4hk
[object] => balance_transaction
[amount] => -103530
[available_on] => 1704742911
[created] => 1704742911
[currency] => usd
[description] => REFUND FOR PAYMENT
[exchange_rate] =>
[fee] => 0
[fee_details] => Array
(
)
[net] => -103530
[reporting_category] => refund
[source] => Stripe\Refund Object
(
[id] => pyr_1OWOhn2HAg2qyuadzNSO9vae
[object] => refund
[amount] => 103530
[balance_transaction] => txn_1OWOhn2HAg2qyuadHyoEA4hk
[charge] => py_1OPTjz2HAg2qyuadfl63QiUf
[created] => 1704742911
[currency] => usd
[metadata] => Stripe\StripeObject Object
(
)
[payment_intent] =>
[reason] =>
[receipt_number] =>
[source_transfer_reversal] => trr_1OWOhnFpNhphKMNx59bVfvSt
[status] => succeeded
[transfer_reversal] => trr_1OWOhnFpNhphKMNx59bVfvSt
)
[status] => available
[type] => payment_refund
)
The thing is, if I pull the charge that's listed in source, i can't get much info
in this example, the charge is py_1OPTjz2HAg2qyuadfl63QiUf
but all the relevant fields on that charge are blank (customer, payment intent, billing details, etc)
Look at this picture, it's showing all the objects involved in a Destination Charge.
oh maybe i don't have it properly expanded
The "problem" is that the real info lives on the platform objects and right now you're only looking at the objects on the connected account
oh that makes sense!
can you recommend the quickest way to get from the refund balance transaction to the payment intent id?
BT -> source -> Refund (pyr_123) -> source_transfer_reversal -> TransferReversal (trr_123) -> transfer -> Transfer (tr_123) -> source_transaction -> Charge (ch_123) -> payment_intent -> PaymentIntent (pi_123)
noglassso-connect-reconciliation
perfect, let me give that a try. thanks very much!
Hi again! I'm stuck trying to go from transfer reversal to transfer. I'm getting the transfer reversal id (trr_) from the Refund object but how do i get to the transfer from there?
Hi @brittle mountain I'm taking over this thread
thanks, hi jack!
the retrieveReversal method requires the transfer id which i don't have yet
Do yo have the ID of the refund object?
Yes, i'm able to retrieve the refund object
I'm starting with the balance transaction object which includes the refund id in its source
I'm trying to get from there to the Payment intent id, and the last person suggested this was the path:
BT -> source -> Refund (pyr_123) -> source_transfer_reversal -> TransferReversal (trr_123) -> transfer -> Transfer (tr_123) -> source_transaction -> Charge (ch_123) -> payment_intent -> PaymentIntent (pi_123)
but if there's an easier way (with fewer API calls) that'd be great!
But if that is the correct path, how do I jump from the transferReversal to the transfer?
Is the balance transaction's type == 'refund' ?
in this case the type is "payment_refund". Here's an example:
Stripe\BalanceTransaction Object
(
[id] => txn_1OWOhn2HAg2qyuadHyoEA4hk
[object] => balance_transaction
[amount] => -103530
[available_on] => 1704742911
[created] => 1704742911
[currency] => usd
[description] => REFUND FOR PAYMENT
[exchange_rate] =>
[fee] => 0
[fee_details] => Array
(
)
[net] => -103530
[reporting_category] => refund
[source] => Stripe\Refund Object
(
[id] => pyr_1OWOhn2HAg2qyuadzNSO9vae
[object] => refund
[amount] => 103530
[balance_transaction] => txn_1OWOhn2HAg2qyuadHyoEA4hk
[charge] => py_1OPTjz2HAg2qyuadfl63QiUf
[created] => 1704742911
[currency] => usd
[metadata] => Stripe\StripeObject Object
(
)
[payment_intent] =>
[reason] =>
[receipt_number] =>
[source_transfer_reversal] => trr_1OWOhnFpNhphKMNx59bVfvSt
[status] => succeeded
[transfer_reversal] => trr_1OWOhnFpNhphKMNx59bVfvSt
)
[status] => available
[type] => payment_refund
)
Isn't trr_1OWOhnFpNhphKMNx59bVfvSt the reversal transfer object?
it's the id, but it's not expandable
and i dont see how to retrieve the object with its id but no transfer id
How do you expand? can you show me the code?
i think it was something like this
$refund = $stripe->refunds->retrieve($refundId, ['expand' => 'transfer_reversal'], ["stripe_account" => $stripe_account]);
Hi! Can you share the request ID (req_xxx)? Here's how you can find it: 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.
Oh i'm sorry, my expansion was set up oncorrectly! that seemed to work, so now i have the transfer id