Paypal Integration in Codeigniter



<form name="paypalFrm" id="paypalFrm_<?php echo $subscribe[$i]->subscriptionpackageID;?>" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
                                            <input type="hidden" name="cmd" value="_ext-enter">
                                            <input type="hidden" name="redirect_cmd" value="_xclick"> //useful to get your custom variable back in response
                                           
                                            <input type="hidden" name="return" value="<?php echo base_url('clinic/paid');?>">
                        //set url name where you can check for your response
                                            <input type="hidden" name="cancel_return" value="<?php echo base_url('clinic/cancel');?>">
                        // set url to check response when user denied or cancel payment and want to back

                                            <input type="hidden" name="notify_url" value="<?php echo base_url('clinic/notify');?>">
                        // to check please set send email logic and check for     response                                            
                                            <input type="hidden" name="business" value="adc.haren@gmail.com">
                        //your bussiness acoount in which payment is done
                        //account in which you want to get paid (owers account)
   
                                            <input type="hidden" name="item_name" value="Purchage 10 docs">
                                            <input type="hidden" name="quantity_1" value="1">
                                           
                                            <input type="hidden" name="currency_code" value="USD">
                                            <input type="hidden" name="amount" value="1">   //your amount
                                         <input type="hidden" name="custom" value="<?php echo $userinfo[0]->userId;?>">
                                           
                                           
                                           
                                            <input type="hidden" name="on1" value="<?php echo $userinfo[0]->firstName;?>">
                                            <input type="hidden" name="on0" value="<?php echo $userinfo[0]->userId;?>">
                                            <input type="hidden" name="on2" value="<?php echo $subscribe[$i]->Amount;?>">
                                            <input type="hidden" name="on3" value="<?php echo $subscribe[$i]->packageName;?>">
                                           
                                    </form>

********** PHP code ***********

 public function paid()
         {
             $uid=$this->session->userdata('userId');
            
             if(isset($_REQUEST['payment_status']))
             {
                 
                 echo "<pre>"; print?_r($_REQUEST['payment_status']);
               Your bussiness logic
             }
             else
             {
               Your bussiness logic
             }
         }
 public function cancel()
         {
            your bussiness logic if client do ot want to pay
         }
        
          public function notify()
          {
             
            echo "<pre>";             print_r($_REQUEST);die;  
          }

Comments

  1. Betway Casino Review & Ratings (2021) - Mapyro
    Betway 제주 출장샵 Casino Review: Get a feel for the 충청남도 출장샵 online 문경 출장샵 casino's offerings, promotions 통영 출장마사지 and live casino experience.What are the welcome bonuses at Betway Casino?Does Betway Casino have an 광주 출장안마 in-app cashout bonus?

    ReplyDelete

Post a Comment

Popular posts from this blog

Connect multiple database and call in code igniter

Pay using braintree

Call CI controler functiona from View using ajax