#memekyTeam
1 messages ยท Page 1 of 1 (latest)
Hello
Hello ๐
So it looks like you are retrieving multiple times here when really you can do this all in one go using expansion
You want to expand the latest_charge.balance_transaction when you retrieve the PaymentIntent
Excuse me, but I don't understand. We are a team from Spain and this part is difficult for us due to the language issue.
The objective is to arrive with a payment id to the function below As shown in the picture
Instead of posting a picture can you post your code in text here using three backticks like: this
Then I can show you what to do
okay
$PI = 'pi_3MMXAwFX2ddxx3Qo1hCKmRCX';
$intentA = \Stripe\PaymentIntent::retrieve($PI);
$latest_charge = $intentA->latest_charge->balance_transaction;
echo $latest_charge;
$intentB = $stripe->charges->retrieve(
$latest_charge,
['expand' => ['data', 'source']]
);
$IDBalanceTransactions = $intentB->expand->data->source;
$intentC = $stripe->balanceTransactions->retrieve(
$IDBalanceTransactions,
[]
);
It's okay like that?
That works
So all you should need is: $PI = 'pi_3MMXAwFX2ddxx3Qo1hCKmRCX'; $intentA = \Stripe\PaymentIntent::retrieve($PI, [ 'expand' => ['latest_charge.balance_transaction']);
Can you try that?
$PI = 'pi_3MMXAwFX2ddxx3Qo1hCKmRCX';
$intentA = \Stripe\PaymentIntent::retrieve($PI);
$latest_charge = $intentA->latest_charge->balance_transaction;
$intentB = $stripe->charges->retrieve(
$latest_charge,
['expand' => ['latest_charge.balance_transaction']]
);
$IDBalanceTransactions = $intentB->expand->latest_charge.balance_transaction;
$intentC = $stripe->balanceTransactions->retrieve(
$IDBalanceTransactions,
[]
);
that's OK?
No you expand the latest_charge.balance_transaction when you retrieve the PaymentIntent
Not the Charge
$PI = 'pi_3MMXAwFX2ddxx3Qo1hCKmRCX';
$intentA = \Stripe\PaymentIntent::retrieve($PI, [
'expand' => ['latest_charge.balance_transaction']]);
Yep
$PI = 'pi_3MMXAwFX2ddxx3Qo1hCKmRCX';
$intentA = \Stripe\PaymentIntent::retrieve($PI, ['expand' => ['latest_charge.balance_transaction']]);
$cus = $intentA->expand->latest_charge.balance_transaction;
echo $cus;
Pardon my ignorance but to print it?
expand isn't a property
Sorry*
try just printing $intentA
okok
$stripe->balanceTransactions->retrieve(
$unkown_variable,
[]
);
and the $unknown_variable is in there?
Hmm looks the expansion didn't work
Ooops try $paymentIntent = \Stripe\PaymentIntent::retrieve([ 'id' => 'pi_3MMXAwFX2ddxx3Qo1hCKmRCX', 'expand' => ['latest_charge.balance_transaction'], ]);
๐
echo $paymentIntent -> balance_transaction -> id;
how do i print it like this?
I'm sorry I know I look like a fool I'm giving you a lot of work
echo $paymentIntent -> latest_charge -> balance_transaction -> id;
No worries!
We are here to help
Okay, thank you very much, it has helped me a lot. It is difficult for the team to understand English because we are all Spanish, really, thank you very much ๐ Have a good day, excellent service! gg ๐