#jacques-php-expansion

1 messages · Page 1 of 1 (latest)

simple valveBOT
random quartz
#

hey there, transfer groups are purely informational for your purposes, you must retrieve transfers using the actual transfer id

fickle rock
#

On the payment I only have payment intent id

#

How can I have the transfert related directly ?

random quartz
#

Sorry, can you rephrase that?

#

WHat are you trying to do?

fickle rock
#

Well. I just need the final payment done to the connected account

#

What is the best way to have it ?

#
  • the final payment id
random quartz
#

Can you share an example payment intent you're starting from?

#

ie, on your platform?

#

Are you using destination charges to create the transfer automatically, or are you creating manual separate transfers?

fickle rock
#

I use destination charge

#

Here is a payment intent : pi_3NTFphK5IWeP9lF81v80M82b

#

Here is the payment on the connected account py_1NUf5PGgbFW1bo6sl7MHZ8ss

#

I have "pi_3NTFphK5IWeP9lF81v80M82b" and need to get the "py_1NUf5PGgbFW1bo6sl7MHZ8ss"

random quartz
fickle rock
#

Seems perfect, but

#

$payment = \Stripe\PaymentIntent::Retrieve( $id, ['expand' => ['transfer']]);

#

($id = "pi_3NTFphK5IWeP9lF81v80M82b")

random quartz
#

Is there a question about this?

fickle rock
#

Give me

#

bject(Stripe\PaymentIntent)#19256 (39) {
["id"]=>
string(27) "pi_3NTFphK5IWeP9lF81v80M82b"
["object"]=>
string(14) "payment_intent"
["amount"]=>
int(15000)
["amount_capturable"]=>
int(0)
["amount_details"]=>
object(Stripe\StripeObject)#20504 (1) {
["tip"]=>
array(0) {
}
}
["amount_received"]=>
int(15000)
["application"]=>
NULL
["application_fee_amount"]=>
int(288)
["automatic_payment_methods"]=>
NULL
["canceled_at"]=>
NULL
["cancellation_reason"]=>
NULL
["capture_method"]=>
string(9) "automatic"
["client_secret"]=>
string(60) "pi_3NTFphK5IWeP9lF81v80M82b_secret_C1iEEYQbi8buqa4ALXRshzN1C"
["confirmation_method"]=>
string(9) "automatic"
["created"]=>
int(1689217485)
["currency"]=>
string(3) "eur"
["customer"]=>
string(18) "cus_O3WbYzotIz9AIj"
["description"]=>
NULL
["invoice"]=>
NULL
["last_payment_error"]=>
NULL
["latest_charge"]=>
string(27) "py_3NTFphK5IWeP9lF81HHpboxu"
["livemode"]=>
bool(true)
["metadata"]=>
object(Stripe\StripeObject)#20505 (1) {
["trs_id"]=>
string(6) "260622"
}
["next_action"]=>
NULL
["on_behalf_of"]=>
string(21) "acct_1NAVN8GgbFW1bo6s"
["payment_method"]=>
string(27) "pm_1NHPYiK5IWeP9lF8HmxMw2YO"
["status"]=>
string(9) "succeeded"
["transfer_data"]=>
object(Stripe\StripeObject)#20513 (1) {
["destination"]=>
string(21) "acct_1NAVN8GgbFW1bo6s"
}
["transfer_group"]=>
string(33) "group_pi_3NTFphK5IWeP9lF81v80M82b"

#

I don't have transfert expanded

random quartz
#

Apologies -- you need to expand the transfer within the latest_charge (its not on the root payment intent)
expand[]=latest_charge.transfer

fickle rock
#

That gives me "
py_3NTFphK5IWeP9lF81HHpboxu"

#

but not "py_1NUf5PGgbFW1bo6sl7MHZ8ss"

#

I used "Stripe\PaymentIntent::Retrieve( $id, ['expand' => ['latest_charge.transfer']]);"

random quartz
#

What values are you looking at in teh transfer?

fickle rock
#

py_1NUf5PGgbFW1bo6sl7MHZ8ss

random quartz
#

What's the transfer object look like?

fickle rock
#

["transfer_data"]=>
object(Stripe\StripeObject)#20513 (1) {
["destination"]=>
string(21) "acct_1NAVN8GgbFW1bo6s"
}
["transfer_group"]=>
string(33) "group_pi_3NTFphK5IWeP9lF81v80M82b"

#

and ["latest_charge"]=>
string(27) "py_3NTFphK5IWeP9lF81HHpboxu"

random quartz
#

No, the expanded transfer inside the latest charge

fickle rock
#

["id"]=>
string(27) "pi_3NTFphK5IWeP9lF81v80M82b"
["object"]=>
string(14) "payment_intent"
["amount"]=>
int(15000)
["amount_capturable"]=>
int(0)
["amount_details"]=>
object(Stripe\StripeObject)#20504 (1) {
["tip"]=>
array(0) {
}
}
["amount_received"]=>
int(15000)
["application"]=>
NULL
["application_fee_amount"]=>
int(288)
["automatic_payment_methods"]=>
NULL
["canceled_at"]=>
NULL
["cancellation_reason"]=>
NULL
["capture_method"]=>
string(9) "automatic"
["client_secret"]=>
string(60) "pi_3NTFphK5IWeP9lF81v80M82b_secret_C1iEEYQbi8buqa4ALXRshzN1C"
["confirmation_method"]=>
string(9) "automatic"
["created"]=>
int(1689217485)
["currency"]=>
string(3) "eur"
["customer"]=>
string(18) "cus_O3WbYzotIz9AIj"
["description"]=>
NULL
["invoice"]=>
NULL
["last_payment_error"]=>
NULL
["latest_charge"]=>
string(27) "py_3NTFphK5IWeP9lF81HHpboxu"
["livemode"]=>
bool(true)
["metadata"]=>
object(Stripe\StripeObject)#20505 (1) {
["trs_id"]=>
string(6) "260622"
}
["next_action"]=>
NULL
["on_behalf_of"]=>
string(21) "acct_1NAVN8GgbFW1bo6s"
["payment_method"]=>
string(27) "pm_1NHPYiK5IWeP9lF8HmxMw2YO"
["status"]=>
string(9) "succeeded"
["transfer_data"]=>
object(Stripe\StripeObject)#20513 (1) {
["destination"]=>
string(21) "acct_1NAVN8GgbFW1bo6s"
}
["transfer_group"]=>
string(33) "group_pi_3NTFphK5IWeP9lF81v80M82b"

#

I don't have more

random quartz
#

That doesn't appear to be exapnding the latest_charge there

fickle rock
#

Should I use something different of "\Stripe\PaymentIntent::Retrieve( $id, ['expand' => ['latest_charge.transfer']]);"

random quartz
#

No that looks right, but you're not seeing it expanded?

fickle rock
#

I only have the string

#

I check i have the latest api version

#

Sorry I have to go

simple valveBOT
fickle rock
#

If you have a solution for this I could try later

#

Thanks for the try

random quartz
#

Can you try:
\Stripe\PaymentIntent::Retrieve(['id'=> $id, 'expand' => ['latest_charge.transfer']]);