jamshaid_0007 Posted May 9, 2013 Share Posted May 9, 2013 (edited) i am integrating paypal digital payment method. i downloaded lib from github and inclued in app/vendor but when i run this code it gives error: Fatal Error Error: Cannot redeclare class Digital_GoodsFile: /var/www/hs/GenII/app/Vendor/paypal-digital-goods/paypal-digital-goods.class.phpLine: 13 path of all files:/var/www/hs/GenII/app/Vendor/paypal-digital-goods/ following are lib clases paypal-configuration.class.php paypal-digital-goods.class.php paypal-subscription.class.php here is controller action where i included these classes public function set_credentials() {App::import('Vendor', 'Paypal-configurationClass',array('file' => 'paypal-digital-goods' . DS . 'paypal-configuration.class.php'));App::import('Vendor', 'Paypal-subscriptionClass', array('file' => 'paypal-digital-goods' . DS . 'paypal-subscription.class.php'));App::import('Vendor', 'Paypal-digital-goodsClass', array('file' => 'paypal-digital-goods'. DS . 'paypal-digital-goods.class.php'));//App::import('Vendor', 'paypal-purchaseClass', array('file' => 'paypal-digital-goods' . DS . 'paypal-purchase.class.php')); $base_url = $_SERVER['SERVER_NAME'].Router::url('/'); $returnUrlcan = "returnUrl?payPal=cancel"; $returnUrlpaid = "returnUrl?payPal=paid"; $returnUrlnotify = "returnUrl?payPal=notify"; PayPal_Digital_Goods_Configuration::username( 'my id' ); PayPal_Digital_Goods_Configuration::password( '********' ); PayPal_Digital_Goods_Configuration::signature( 'dsdfdsfsfd' ); PayPal_Digital_Goods_Configuration::return_url($this->get_script_uri( $returnUrlpaid ) ); PayPal_Digital_Goods_Configuration::cancel_url($this->get_script_uri( $returnUrlcan ) ); PayPal_Digital_Goods_Configuration::business_name( 'Demo Store' ); PayPal_Digital_Goods_Configuration::notify_url($this->get_script_uri( $returnUrlnotify) ); // Uncomment the line below to switch to the live PayPal site //PayPal_Digital_Goods_Configuration::environment( 'live' ); if( PayPal_Digital_Goods_Configuration::username() == 'your_api_username' || PayPal_Digital_Goods_Configuration::password() == 'your_api_password' || PayPal_Digital_Goods_Configuration::signature() == 'your_api_signature' ) exit( 'You must set your API credentials in ' . __FILE__ . ' for this example to work.' ); } Edited May 9, 2013 by jamshaid_0007 Quote Link to comment https://forums.phpfreaks.com/topic/277824-fatal-error-error-cannot-redeclare-class-cakephp/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.