Wednesday, 13 May 2015

Pay pal auto return settings process


    Auto Return is turned off by default. To turn on Auto Return:

 1. Log in to your PayPal account at https://www.paypal.com. The My Account Overview page appears.
 2.  Click the Profile subtab. The Profile Summary page appears.
 3.  Click the My Selling Tools link in the left column.
 4.  Under the Selling Online section, click the Update link in the row for Website Preferences. The Website Payment Preferences page appears
 5. Under Auto Return for Website Payments, click the On radio button to enable Auto Return.
 6.  In the Return URL field, enter the URL to which you want your payers redirected after they complete their payments. NOTE: PayPal checks the Return URL that you enter. If the URL is not properly formatted or cannot be validated, PayPal will not activate Auto Return.
7.    Scroll to the bottom of the page, and click the Save button.

 Pay pal Payment integration complete process -
 Put this form on your payment page - STEP 1 -
        $paypal_url='https://www.paypal.com/cgi-bin/webscr'; // Test Paypal API URL
        $paypal_id='abcd@gmail.com'; // Business email ID

       $paypal_url='https://www.sandbox.paypal.com/cgi-bin/webscr'; // Test Paypal API URL
       $paypal_id='m@snrinfotech.com'; // Business email ID


 <form method="post" action='<?php echo $paypal_url; ?>'>
         <input type='hidden' name='business' value='<?php echo $paypal_id; ?>'>   
        <input type='hidden' name='cmd' value='_xclick'>
          <br/>
         <input type='hidden' name='item_name' value='Tour-package'>
           <input type='hidden' name='item_number' value='001'>
         <input type='hidden' name='amount' value='<?php echo $amount; ?>'>
         <input type='hidden' name='rest_amount' value='<?php echo $rest_amount; ?>'>
         <input type='hidden' name='cancel_return' value='<?php echo $site_url;?>/cancel'>
         <input type='hidden' name='custemail' value='<?php echo $email; ?>'>
         <input type="hidden" name="rm" value="2">
         <input type="submit" class="sbt-btn-book" name="member-submit" class="sub-btn" value="Submit">
       </form>

Paypal returns all your variables in post form so print_r($_POST) and you will get all data required.

STEP - 2 ----
Make success page and cancel page.
//print_r($_POST);   
        $email = $_POST['payer_email'];
        $got_payment = $_POST['mc_gross'];

and message payment successful.

STEP 3.
cancel page
<h1>Your Payment is cancelled.Please Try Again</h1>

No comments:

Post a Comment