You are not logged in.
Pages: 1
Hellow,
My question off today
I am buzzy adding Mollie (dutch payment company) within Bigtree.
In my Template (startpayment.php) I do this:
But when I go to the payment Page I get this
I know bigtree rewrites a lot, haha.
Normally this is working with just php
Fatal error: Cannot redeclare class Mollie_API_Autoloader in /home/onepageshop/public_html/templates/layouts/Mollie/API/Autoloader.php on line 32
<?
//site/extensions/Startpayment.php
include 'extensions/Mollie/API/Autoloader.php';
$mollie = new Mollie_API_Client;
// = new Mollie_API_Client;
$mollie->setApiKey("test_xxx");
$payment = $mollie->payments->create(array(
'amount' => $amount,
'description' => '$DES',
'redirectUrl' => '$returnsite',
'metadata' => array(
'order_id' => $orderID)));
// bewaar de payment_id voor als de gebruiker terugkeert
$_SESSION['mollie_payment_id'] = $payment->id;
echo '<br>';
echo getcwd() . "\n";
?>
<?
//Mollie/API/Autoloader.php
* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php
* @author Mollie B.V. <info@mollie.com>
* @copyright Mollie B.V.
* @link https://www.mollie.com
*/
class Mollie_API_Autoloader
{
/**
* @param string $class_name
*/
public static function autoload ($class_name)
{
if (strpos($class_name, "Mollie_") === 0)
{
$file_name = str_replace("_", "/", $class_name);
$file_name = realpath(dirname(__FILE__) . "/../../{$file_name}.php");
if ($file_name !== false)
{
require $file_name;
}
}
}
/**
* @return bool
*/
public static function register ()
{
return spl_autoload_register(array(__CLASS__, "autoload"));
}
/**
* @return bool
*/
public static function unregister ()
{
return spl_autoload_unregister(array(__CLASS__, "autoload"));
}
}
Mollie_API_Autoloader::register();
?>
Offline
My only guess would be that somehow that Autoloader.php file was already included once? If it was stored in /custom/inc/required/ then it would automatically be included but it looks like you have it in a subdirectory of templates or site.
Offline
Pages: 1