Jump to content
Larry Ullman's Book Forums

Recommended Posts

Hi Larry,

I am trying to use Stripe from my localhost and have established a test account with Stripe Australia.

I am getting error "Class 'Stripe\Stripe_Charge' not found in .....on line 182 -  I am on page 508 in the book.

I have Stack-Overflowed and tried their solutions but none work.

I am not able to use composer as I'm using PHP 5.5.3 on Windows 7 so I did the manual download and as far as I can tell all that is OK.

Again, any advice will be most appreciated.

Cheers, Necuima

 

zz-larry-3.jpg

Share this post


Link to post
Share on other sites

It's OK - I tried \Stripe\Charge:: etc and that did not give the error.

But now I have another error which seems to be associated with an SSL certificate.  As mentioned I am trying to test this on localhost which, in my case, does not have an SSL certificate.

I understood from a previous query on Stripe that I could test this from localhost without my XAMPP/Apache having an SSL certificate.  Have I mis-understood this?

The beginning of the error is:

"An error occurred in script 'C:\xampp\htdocs\DMChat\modules\process_payment.php' on line 213: Stripe\Error\ApiConnection Object ( [message:protected] => Unexpected error communicating with Stripe. If this problem persists, let us know at support@stripe.com. (Network error [errno 77]: error setting certificate verify ..............."

This was from the catch block:

catch (Exception $e)
     { // Try block failed somewhere else.
      trigger_error(print_r($e, 1));
     }

Again, your advice will be most appreciated,

Necuima

P.S., you can probably figure out that I am using your model/view/controller approach from the advanced book :-)

Share this post


Link to post
Share on other sites

I expect the problem is you CANNOT test from localhost without SSL. If you use Let's Encrypt, you can get a free, legit certificate to use for testing purposes.

Share this post


Link to post
Share on other sites

You can also create your own SSL certificate and sign it off for the browser to accept, a simple search on google will give you a tutorial to complete this task.

Regards

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...