CodeIgniter Forums
Paypal wrong url - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Paypal wrong url (/showthread.php?tid=64879)



Paypal wrong url - WeberBSG - 04-06-2016

Ok, this is my problem, i've been using THIS tutorial to implement Paypal in my website, after fighting the library a few days
I was finally able to run the code, but the Buy button takes me Here
it should take me to buying form right? so i can "pay" to test it 

Products controller
PHP Code:
function  __construct() {
 
       parent::__construct();
 
       $this->load->helper('form');
 
       $this->load->helper('url');
 
       $this->load->library('paypal_lib');
 
       $this->load->model('product_model');
 
   }


 
   function index(){
 
       $data = array();
 
       //get products data from database
 
       $data['products'] = $this->product_model->getRows();
 
       $data['title'] = 'Products';
 
       //pass the products data to view
 
       $this->load->view('products'$data);
 
   }

 
   function buy($id){
 
       //Set variables for paypal form
 
       $paypalURL 'https://www.sandbox.paypal.com/cgi-bin/webscr'//test PayPal api url
 
       $paypalID 'Here i am using my Paypal Business Email' //business email
 
       $returnURL base_url().'paypal/success'//payment success url
 
       $cancelURL base_url().'paypal/cancel'//payment cancel url
 
       $notifyURL base_url().'paypal/ipn'//ipn url
 
       //get particular product data
 
       $product $this->product_model->getRows($id);
 
       $userID 1//current user id

 
       $this->paypal_lib->add_field('business'$paypalID);
 
       $this->paypal_lib->add_field('return'$returnURL);
 
       $this->paypal_lib->add_field('cancel_return'$cancelURL);
 
       $this->paypal_lib->add_field('notify_url'$notifyURL);
 
       $this->paypal_lib->add_field('item_name'$product['name']);
 
       $this->paypal_lib->add_field('custom'$userID);
 
       $this->paypal_lib->add_field('item_number' $product['products_id']);
 
       $this->paypal_lib->add_field('amount' $product['price']);        
        
        $this
->paypal_lib->paypal_auto_form();
 
   


if you need more info to help please let me know


RE: Paypal wrong url - Tpojka - 04-07-2016

Have you tried that if you are logged out from paypal sandbox?


RE: Paypal wrong url - WeberBSG - 04-08-2016

(04-07-2016, 04:48 AM)Tpojka Wrote: Have you tried that if you are logged out from paypal sandbox?

yes


RE: Paypal wrong url - Tpojka - 04-08-2016

First thing I'd do is to ask the guy who made tutorial in comment on that website.