#sarim_charge-retrieve
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1234989217310838784
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello! You're getting this error because Charge ch_3OqxklCg5ZKHuI4E0aOpsnrA is on the connected account, but you're making the retrieval request from the platform account. You need to be providing the Stripe-Account header (https://docs.stripe.com/connect/authentication#stripe-account-header) in your charge retrieval request
I am adding the stripe_account id as well
$data = \Stripe\Charge::all([ 'customer' => 'cus_PJVNELrySnzAzb' ], ['stripe_account' => 'acct_1HpgQuCg5ZKHuI4E']);
and trying to retrieve a charge like this
$data = \Stripe\Charge::retrieve('ch_3OqxklCg5ZKHuI4E0aOpsnrA', [ ], ['stripe_account' => 'acct_1HpgQuCg5ZKHuI4E']);
Are you 100% sure that you're running the correct code for your ch_3OqxklCg5ZKHuI4E0aOpsnrA retrieval? I'm seeing your list charges requests come through correctly, but the single charge retrieval doesn't seem to be correct still
I shared the code in this message
#1234989217310838784 message
sarim_charge-retrieve
], ['stripe_account' => 'acct_1HpgQuCg5ZKHuI4E']);``` is incorrect. It should be ```$data = \Stripe\Charge::retrieve('ch_3OqxklCg5ZKHuI4E0aOpsnrA',
['stripe_account' => 'acct_1HpgQuCg5ZKHuI4E']);```
let me try
I recommend migrating to our newer (but from 2020 already) implementation for PHP, see https://github.com/stripe/stripe-php/wiki/Migration-to-StripeClient-and-services-in-7.33.0