Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tips Paypal Payment using PHP
#1
In this tutorial I want to explain how to work with Paypal Sandbox test accounts for payment system development and sending arguments while click buy now button. It’s simple and very easy to integrate in your web projects.
Create a Paypal Sandbox test account at https://developer.paypal.com/
payment.php

Code:
<?PHP
   $paypal_url='https://www.sandbox.paypal.com/cgi-bin/webscr'; // Test Paypal API URL
   // $paypalUrl='https://www.paypal.com/cgi-bin/webscr'; Live Paypal API URL
   $paypal_id='Business email ID'; // Business email ID
?>

<div class="product">            
   <div class="price">
       Price:$10
   </div>
   <div class="btn">
       <form action="<?php echo $paypal_url; ?>" method="post" name="frmPayPal1">
           <input type="hidden" name="business" value="<?php echo $paypal_id; ?>">
           <input type="hidden" name="cmd" value="_xclick">
           <input type="hidden" name="item_name" value="Bladephp Payment">
           <input type="hidden" name="item_number" value="1">
           <input type="hidden" name="credits" value="510">
           <input type="hidden" name="userid" value="1">
           <input type="hidden" name="amount" value="10">
           <input type="hidden" name="no_shipping" value="1">
           <input type="hidden" name="currency_code" value="USD">
           <input type="hidden" name="handling" value="0">
           <input type="hidden" name="cancel_return" value="http://localhost/paypal/cancel.php">
           <input type="hidden" name="return" value="http://localhost/paypal/success.php">  
           <input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit">
           <img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
       </form>
   </div>
</div>

success.php
Code:
$no            = $_REQUEST['item_number'];
$transaction   = $_REQUEST['tx']; // Paypal transaction ID
$price         = $_REQUEST['amt']; // Paypal received amount
$currency      = $_REQUEST['cc']; // Paypal received currency type
cancel.php
Code:
<?php
   echo "Payment Failed";
?>
To Purchase Credit Click here , For how to make money on Sologet forum Click here . 
There is love in sharing
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  How to Stop Sending E-Mail Spam using PHP mail function Kingsolomon 1 59 11-12-2018, 04:38 PM
Last Post: Solomon
  Multiple file upload in php Kingsolomon 1 67 11-08-2018, 03:01 PM
Last Post: Solomon
  How to limit text length in php and provide 'Read more' link Kingsolomon 0 48 10-31-2018, 02:08 PM
Last Post: Kingsolomon
  How to read more / hide text using Jquery and PHP Kingsolomon 0 40 10-31-2018, 02:06 PM
Last Post: Kingsolomon
  Download simple HTML email templates Kingsolomon 0 43 10-31-2018, 02:05 PM
Last Post: Kingsolomon

Forum Jump:


Users browsing this thread:
1 Guest(s)


Users that viewed this thread:
1 User(s) read this thread:
musicblog
Paypal Payment using PHP00