Skip to content
Advertisement

Stripe Class ‘StripeCharge

I want to implement a Stripe payment form but I get a fatal error Class ‘StripeCharge. The class is there (see my folder tree), I tried :

JavaScript

but both no working. my php code:

JavaScript

enter image description here

Advertisement

Answer

You are using an older (1.x) version of the Stripe PHP library. In that version, all the classes were named Stripe_Class.

In version 2.0.0, the syntax was changed to use a namespace, and now all the classes are named StripeClass.

If it’s possible, I recommend you upgrade to the latest version (3.13.0). You can find it here: https://github.com/stripe/stripe-php/releases. All the examples in Stripe’s documentation and API reference use the newer syntax.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement