Stripe secret key not there

Wappler: 6.7.1
OS: MacOS M1
Server: PHP

I've followed carefully this tutorial:

However, the create_session.php SC file gives this error:

"message":"Class 'Stripe\\StripeClient' not found"

I've looked in the /public_html/dmxConnectLib/modules/stripe.php on line 16 as reported in the rest of the error and it looks to be the secret key:

$this->stripe = new \Stripe\StripeClient(CONFIG('STRIPE_SECRET_KEY'));

I've set this in the Server Connect Settings / Stripe - Stripe Secret Key but it seems to not be providing this when viewing the page.

Can I assume this is a bug? I've even put the secret key directly into the API Key in the Advanced Options for the Create Checkout Session action but it still produces the same error.

UPDATE: I've hard-coded my secret key into the into the module script to see if that fixes it but I get the same error:

$this->stripe = new \Stripe\StripeClient('sk_test_restofthekeyhere');

Maybe you had different target selected where you entered the key?

I only have one target.

Are you able to replicate this? I'm unable to continue with the checkout so it's quite urgent I'm afraid.

@Hyperbytes writes:

They are still working on docs. George asked if i could help them out with videos. Literally just started to look an hour ago. Got as far as the Stripe buy button which i have managed to get working, very like the old PayPal generated buttons. very static, no dynamic settings.

They refers to @Teodor who has promised to do this after his well-deserved holiday.

PS: If it is any consolation, I have been waiting on this for months so that I can continue with the Boutique series of videos.

Thanks Ben.

The tutorial Teodor put up a few weeks ago is actually all that seems to be needed to get up and running but it's the bug which needs addressing so I'm desperately hoping this can be sorted quickly as I'm due to launch a site very soon but can't until this is fixed.

working for me, you on node or php?

Wappler Page

when i "Buy Now"

Thanks for checking this Brian. This is a PHP project.

Hmm,maybe a php only issue

Yep, I suspect you're right but I'm completely stumped until it's sorted :frowning:

Hate to say it but working for me in php also

try dropping this (stripebuynow.php) into your site and see what happens when you run it.

stripebuynow.zip (810 Bytes)

Thanks for this Brian.

Your script works fine. However, that is a Buy Now button whereas I'm trying to work with the Stripe Embedded Checkout. I think that's where the bug lies.

If you have some time, can you create a simple Data Store with just the price and quantity fields and then create the embedded checkout to work with it?

Cant promise when as have friends just arrived, staying overnight but will try when i get a chance.
At least we are focusing in on where th issue lies

1 Like

Thanks again. I'm hoping @George can have a look, too. I feel like it will end up being a fairly small fix which will solve it all.

i am also seeing

the code

  function __construct($app) {
    $this->stripe = new \Stripe\StripeClient(CONFIG('STRIPE_SECRET_KEY'));
    parent::__construct($app);
  }

seems to be a central function called by all the stripe checkout functions so i cant understand why "buynow" works but embedded checkout doesn't (Patrick's coding is way over my head!)

The console messages i see are:

, clicking the 500 error yields the error message above.

Aah, so it's not just me. That's good (I think!)

@patrick Any chance you can look at this? I'm totally stuck until it's fixed.

It can't find the Stripe Client, seems like the stripe library is not installed. Do you use composer in your PHP project?

Yes, Composer is active in this project. And the entire vendor folder has been uploaded (I just uploaded again to be sure)

I've done Install PHP Packages and Update PHP Packages but there's nothing mentioning Stripe anywhere in the vendor folder.

I suppose that "STRIPE_SECRET_KEY" is set but it doesn't seem this value to be passed to the session...
So
when this is called
$this->stripe = new \Stripe\StripeClient(CONFIG('STRIPE_SECRET_KEY'));

you get this error
"message":"Class 'Stripe\\StripeClient' not found"

Obviously the seesion variable is not set (empty)

Just thinking out loud...
Forgive me if I say something wrong

I think Composer isn't installing the Stripe library. Fingers are crossed that Patrick can provide a quick fix.

1 Like