I am new to Symfony. I am trying to use a pre existing library that I have used for my Payment Gateway API, with Symfony (v2.3).
Before using Symfony I would have a composer.json
file in the root directory and I would simply use PHP require 'vendor/Braintree...
. However with Symfony I am having a really difficult time using the library for payment gateway API by importing it to my Controller.
Note: I am using an Entity in the same controller as follows, which has a similar directory structure and works great:
use Jets\JetsBundle\Entity\Company;
This is what I tried to use the payment gateway API:
use Jets\JetsBundle\Braintree\braintree\braintree_php\lib\Braintree;
and the Braintree.php
contains:
namespace Widb\WidbBundle\Braintree\braintree\braintree_php\lib;
I keep getting the following error:
FatalErrorException: Error: Class 'Jets\JetsBundle\Controller\Braintree_Configuration' not found in C:\xampp\htdocs\www\symfony\src\Jets\JetsBundle\Controller\DefaultController.php line 239
And the DefaultController.php
Line 239 contains:
Braintree_Configuration::environment('sandbox');
As a side note, I didn't do anything other than drag / drop the ready configured library directory from my old server to the Symfony directory on the new server. Am I missing some configuration script or cmd
set up or something?
I appreciate any assistance in this regard. I will forever be grateful is someone can help me troubleshoot this.
Here is my DefaultController.php
code:
Many thanks in advance!