使用带有simplemvc框架的angelleye paypal

I have used composer to download the Angell EYE PayPal library into my vendor directory. Now I'm trying to call the class within a controller.

I've tried various methods:

Use \angelleye\PayPal;

at the top of page. I've tried using the require() method.

Within the controller I have used

$paypal = PayPal::PayPal($payment);

And a few other ways, but I just get the error Class not found at line 179 and I'm not sure why.

You just need to load a config file (depending on your framework) and the autoloader.

require_once('includes/config.php');
require_once('vendor/angelleye/paypal-php-library/autoload.php');

Of course, adjust the paths to suit where you have those saved, but the autoloader is what makes the classes available to you.

If you want more direct help you can submit a ticket here.

Thanks for response.

I actually managed to get it working on the framework.

I did nt have to load anything or require the class as the composer autoload must do it for me in the framework.

I simply added :

$PayPal = new \angelleye\PayPal\PayPal($PayPalConfig);

and it started to work.

Im guessing if i want to use the PayFlow i would call using:

$PayPal = new \angelleye\PayPal\PayFlow($PayPalConfig);

I will definately post back if the rest of the proccess fails to work.