Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client class not found,, #64

Open
bhautikdream4u opened this issue Dec 23, 2017 · 1 comment
Open

client class not found,, #64

bhautikdream4u opened this issue Dec 23, 2017 · 1 comment

Comments

@bhautikdream4u
Copy link

Please help me to fix this error in joomla..

i include class.php file and call that class but it giving me error about class not found.

if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR); require_once (JPATH_ROOT.DS.'components'.DS.'com_eshop'.DS.'plugins'.DS.'payment'.DS.'AmazonPay'.DS.'Client.php');
	$config = array(
		'merchant_id' => 'YOUR_MERCHANT_ID',
		'access_key'  => 'YOUR_ACCESS_KEY',
		'secret_key'  => 'YOUR_SECRET_KEY',
		'client_id'   => 'YOUR_LOGIN_WITH_AMAZON_CLIENT_ID',
		'region'      => 'REGION',
		'sandbox'     => true);
	
	$client = new Client($config);
	
	// Also you can set the sandbox variable in the config() array of the Client class by
	
	$client->setSandbox(true);
@nlubisch
Copy link

The Client itself is contained in the namespace "AmazonPay".
So your instantiation of the Client should be

$client = new \AmazonPay\Client($config);

or you could use following notation after your PHP opening tag to be able to use "Client" only

<?php

//if used
namespace XXX;

use AmazonPay\Client;

//...
$client = new Client($config);
//...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants