#aliensoft

1 messages ยท Page 1 of 1 (latest)

open abyssBOT
shadow wraith
#

Hi ๐Ÿ‘‹ what is the error?

lusty raft
#

it's not initializing

#

i do remembe reading somewhere that if you haven't installed it via composer, there should be a direct call to the init.php

#

i even tried
require_once('vendor/stripe-php/init.php');

#

and php error says no such file or directory

#

PHP Fatal error: Uncaught Error: Class "Stripe\StripeClient" not found

#

PHP Warning: require_once(vendor/stripe-php/init.php): Failed to open stream: No such file or directory

#

any ideas ?

shadow wraith
#

That error makes it sound like you aren't pointing require_once to where the init.php file actually resides.

#

I would recommend double checking where you stored our SDK in relation to your code, and make sure the path to the file is correct.

lusty raft
#

the path is correct

#

i already have implemented stripe for years and the payment is working ok

#

this is just another side project that i'm setting up

#

it works elsewhere, but not here :/

#

PHP Fatal error: Uncaught Error: Class "Stripe\StripeClient" not found

#

actually now i got the initializing art going, but there seems to be when

#

$stripe = new \Stripe\StripeClient($stripeSecretKey);

#

and yes, my clientsecretkey is correct

#

PHP Fatal error: Uncaught Error: Class "Stripe\StripeClient" not found

shadow wraith
#

Okay, so we're on to a new error now? That code looks right if the secret key is correct, unless the Stripe library still isn't being included/initialized.

lusty raft
#

yh seems like the library isn't being included/initialized

#

but why.. it's all there..

#

im looking at my other php files and it's the same calls

#

:/

shadow wraith
#

Can you paste a snippet of how you're trying to initialize things?

lusty raft
#

require_once('vendor/stripe/stripe-php/init.php');
require_once 'secrets.php';

                \Stripe\Stripe::setApiKey($stripeSecretKey);
                $stripe = new \Stripe\StripeClient($stripeSecretKey);


                $paymentIntent = \Stripe\PaymentIntent::retrieve([
                  'id' => $intent,
                  'expand' => ['latest_charge.balance_transaction'],
                ]);
#

$fee = $stripe->balanceTransactions->retrieve(
$taxID,
[]
);

shadow wraith
#

Hm, is that the only error you're seeing? I'm seeing the same error, and am not certain why offhand. Working on comparing it to my other samples.

#

And which version of the SDK are you using?

open abyssBOT
shadow wraith
lusty raft
#

:/ let me try the legacy way

#

this was all working in TEST mode btw

#

since going LIVE it's starting causing these errors

#

how do i find out which stripe client version i have

#

and how do i upgrade it

#

oh it says 6.30.4

shadow wraith
#

Typically, if you download the code directly from us, the folder name will have the version in it. But if not you can check the VERSION file in the root folder of our SDK.
Gotcha, yeah, I believe that version didn't have the client/service implementation in it, which is why you're encountering an error when trying to use it.
For upgrading, are you using composer (which I'm less familiar with) or are you manually pulling down the source code and putting it in your project?

lusty raft
#

im not familiar with composer iether

#

i'll manually replace the folder

lusty raft
#

this has now broken everything ๐Ÿ˜„

#

seems like it's abig jump from v6 to 11

#

i might as well try v7 or something

royal ginkgo
#

Yeah if you're going to try to use the newer way that we show in our docs, everything will have to change

#

If you want to stick to the legacy way, you can. You can't mix them though

lusty raft
#

but why was this all working in TEST mode

#

ohh v8 seems to work now ๐Ÿ˜„

royal ginkgo
#

Cool glad you got it

lusty raft
#

thanks for your help.