#shainanand

1 messages · Page 1 of 1 (latest)

vivid edgeBOT
#

Hello! 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.

ionic token
#

Hi

#

Looks like a typo to me

#

Missing the n in accountSessions potentially?

icy plover
#

sorry typed wrong here.

Undefined property: Stripe\\Service\\CoreServiceFactory::$accountSessions

#

this is the error message

ionic token
#

Can you show me your code that triggers this error?

icy plover
#

$stripe = new \Stripe\StripeClient([
// This is your test secret API key.
"api_key" => 'somekey',
]);

try {
$account_session = $stripe->accountSessions->create([
'account' => 'acct_1OMAaoQjqUxSKrw3',
'components' => [
'payments' => [
'enabled' => true,
'features' => [
'refund_management' => true,
'dispute_management' => true,
'capture_payments' => true,
],
],
],
]);

echo json_encode(array(
  'client_secret' => $account_session->client_secret
));exit;

} catch (Exception $e) {
error_log("An error occurred when calling the Stripe API to create an account session: {$e->getMessage()}");
http_response_code(500);
echo json_encode(['error' => $e->getMessage()]);
}

#

i just copied from the API doc

ionic token
#

What version of our PHP library are you using?

icy plover
#

8.1

ionic token
#

Gotcha that is your issue

#

So you'll need to upgrade

icy plover
#

noted

#

thanks will try

#

When I updated the stripe, it is showing "stripe/stripe-php": "^7.128"

#

Is this the correct version?

ionic token
#

No you need 12.1.0+ as I noted above

icy plover
#

okay