I'm writing a Joomla module.
As part of this I'm using an ajax call (using 3.x)
the ajax etc works fine. However I want to use an object autoloader within the ajax class but I can't figure out what I'm doing wrong (it works fine as standalone code just breaks implementing with Joomla and ajax)
I have this for the Joomla class:
public function getAjax()
{
$input = JFactory::getApplication()->input;
$cmd = $input->get('cmd');
if($cmd =="setPayment"){
require __DIR__ . '/PayPal-PHP-SDK/autoload.php';
use PayPal\Api\Amount;
use PayPal\Api\Details;
The code cannot find the Amount and Details classes. I'm assuming that it's to do with the context I'm calling them.
Can someone help?