#noglassso-connect-reconciliation

1 messages · Page 1 of 1 (latest)

nimble tuskBOT
brisk mason
#

@brittle mountain a BalanceTransaction has a source property that points to the object that created the BalanceTransaction

brittle mountain
#

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)

brisk mason
#

Look at this picture, it's showing all the objects involved in a Destination Charge.

brittle mountain
#

oh maybe i don't have it properly expanded

brisk mason
#

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

brittle mountain
#

oh that makes sense!

#

can you recommend the quickest way to get from the refund balance transaction to the payment intent id?

brisk mason
#

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

brittle mountain
#

perfect, let me give that a try. thanks very much!

nimble tuskBOT
brittle mountain
#

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?

hollow bone
#

Hi @brittle mountain I'm taking over this thread

brittle mountain
#

thanks, hi jack!

#

the retrieveReversal method requires the transfer id which i don't have yet

hollow bone
#

Do yo have the ID of the refund object?

brittle mountain
#

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?

hollow bone
#

Is the balance transaction's type == 'refund' ?

brittle mountain
#

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
    )
hollow bone
#

Isn't trr_1OWOhnFpNhphKMNx59bVfvSt the reversal transfer object?

brittle mountain
#

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

hollow bone
#

How do you expand? can you show me the code?

brittle mountain
#

i think it was something like this

#

$refund = $stripe->refunds->retrieve($refundId, ['expand' => 'transfer_reversal'], ["stripe_account" => $stripe_account]);

hollow bone
brittle mountain
#

Oh i'm sorry, my expansion was set up oncorrectly! that seemed to work, so now i have the transfer id