#alluring_tiger_61182

1 messages · Page 1 of 1 (latest)

coral socketBOT
#

Hello alluring_tiger_61182, we'll be with you shortly! Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
alluring_tiger_61182, 0 days ago, 10 messages
alluring_tiger_61182, 4 days ago, 15 messages
alluring_tiger_61182, 4 days ago, 2 messages

analog saddle
#

Hi there, how can I help?

vital fjord
#

$stripe = new \Stripe\StripeClient(STRIPESKKEY);
$pi = $stripe->paymentIntents->retrieve(
'pi_3O4fGNQmF5QljnRl0Tc7DTIO',
['stripe_account' => '{acct_1KsHq1QmF5QljnRl}']
);

echo $pi;

#

I tried to retrieve paymentIntents for a pi and for a connected account. But empty response

#

Am I doing something wrong?

analog saddle
#

Did you see any error?

vital fjord
#

500 internal server error is all i'm getting

analog saddle
vital fjord
#

req_AZQNj69xWirRfb

#

wait hang on

#

thats incorrect

#

This one req_oIZNAh1XLnxTPT

#

This is correct req_oIZNAh1XLnxTPT

analog saddle
#

I saw this in the request stripe_account: "{acct_1KsHq1QmF5QljnRl}", Remove the curly braces and try again.

vital fjord
#

Still the same req_NLkcMY6yqh6na3

analog saddle
#

Hmm, can you share with me the code?

vital fjord
#

ok

#

Is this what you are after?

#

$stripe = new \Stripe\StripeClient('sk_test_51JqyiyHFKCp84Qhw6va3hbMOhnanP0WT5fUeE3XB3itfVJzlqCCUklYaJxXEus4wmjA0UMNFmYADYlhlohgnqJxD00sFOSU8DR');
$pi = $stripe->paymentIntents->retrieve(
'pi_3O4fGNQmF5QljnRl0Tc7DTIO',
['stripe_account' => 'acct_1KsHq1QmF5QljnRl']
);

echo $pi;

digital ocean
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

vital fjord
#

ok sure thans

digital ocean
#

It seems you need to pass the ['stripe_account' => 'acct_1KsHq1QmF5QljnRl'] as a third argument, not second. The second one is retrieve options and should be an empty object [] in this case.

vital fjord
#

ok i'll try

digital ocean
#

Basically:

$pi = $stripe->paymentIntents->retrieve(
    'pi_3O4fGNQmF5QljnRl0Tc7DTIO',
    [],
    ['stripe_account' => 'acct_1KsHq1QmF5QljnRl']
);
vital fjord
#

oh great. It works!. Do i do the same everytime as a 3rd argument whenever querying a connected account?

digital ocean
#

The logic is the following:

  • For requests where you need to provide an object ID, then it's the first argument, then the 2nd is request options (e.g. expand), and the 3rd is like "meta-parameters" (mostly for stripe_account)
  • If you don't need the object ID, the first argument is request options, and the 2rd is like "meta-parameters" .
vital fjord
#

ok noted with thnaks.

digital ocean
#

Happy to help.