Jump to content


Photo

Fatal Error Error: Cannot redeclare class Cakephp


  • Please log in to reply
No replies to this topic

#1 jamshaid_0007

jamshaid_0007

    Newbie

  • Members
  • Pip
  • 6 posts
  • LocationLahore punjab Pakistan
  • Age:23

Posted 09 May 2013 - 02:20 AM

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_Goods
File: /var/www/hs/GenII/app/Vendor/paypal-digital-goods/paypal-digital-goods.class.php
Line: 13

path of all files:/var/www/hs/GenII/app/Vendor/paypal-digital-goods/

 

following are lib clases

Attached File  paypal-configuration.class.php   5.54KB   0 downloads

Attached File  paypal-digital-goods.class.php   14.25KB   0 downloads

Attached File  paypal-subscription.class.php   14.15KB   0 downloads

 

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 by jamshaid_0007, 09 May 2013 - 02:25 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com