#jacques-php-expansion
1 messages · Page 1 of 1 (latest)
hey there, transfer groups are purely informational for your purposes, you must retrieve transfers using the actual transfer id
You can list using a group Id if that's what you mean to do: https://stripe.com/docs/api/transfers/list#list_transfers-transfer_group
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
On the payment I only have payment intent id
How can I have the transfert related directly ?
Well. I just need the final payment done to the connected account
What is the best way to have it ?
- the final payment id
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?
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"
Gotcha, in that case when retrieving the payment intent you can expand the transfer then look at the destination_payment:
https://stripe.com/docs/api/transfers/object#transfer_object-destination_payment
https://stripe.com/docs/expand
expand[]=transfer
Seems perfect, but
$payment = \Stripe\PaymentIntent::Retrieve( $id, ['expand' => ['transfer']]);
($id = "pi_3NTFphK5IWeP9lF81v80M82b")
Is there a question about this?
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
Apologies -- you need to expand the transfer within the latest_charge (its not on the root payment intent)
expand[]=latest_charge.transfer
That gives me "
py_3NTFphK5IWeP9lF81HHpboxu"
but not "py_1NUf5PGgbFW1bo6sl7MHZ8ss"
I used "Stripe\PaymentIntent::Retrieve( $id, ['expand' => ['latest_charge.transfer']]);"
What values are you looking at in teh transfer?
py_1NUf5PGgbFW1bo6sl7MHZ8ss
What's the transfer object look like?
["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"
No, the expanded transfer inside the latest charge
["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
That doesn't appear to be exapnding the latest_charge there
Should I use something different of "\Stripe\PaymentIntent::Retrieve( $id, ['expand' => ['latest_charge.transfer']]);"
No that looks right, but you're not seeing it expanded?
No.
I only have the string
I check i have the latest api version
Sorry I have to go
This is the request you're making, which doesn't get the expansion: https://dashboard.stripe.com/logs/req_eDNGRt0jez9HRc
I think this is related to the php SDK shape change
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Can you try:
\Stripe\PaymentIntent::Retrieve(['id'=> $id, 'expand' => ['latest_charge.transfer']]);