Follow All the steps and Successfully Add Paypal Integration In your Website
For More Info Visit : Paypal Integration Using PHP
https://www.youtube.com/watch?v=TgiwQ9MljcM
Step 1
Create a Paypal Sandbox account at https://developer.paypal.com/
Step 2
![]() |
How to integrate with Paypal Using PHP |
Here I have created two accounts Buyer (personal) and Seller (merchant/business)
index.php
Contains PHP code. Displaying products, product image, product name and product price. Here you have to give your business(seller) $paypal_id id. Modify paypal button form return and cancel_return URLs.
Paypal payment success return file. Getting Paypal argument like item_number. Paypal data success.php?tx=83437E384950D&st=Completed&amt=10.00&cc=USD&cm=&item_number=1
|
<?php
$item_no = $_REQUEST['item_number'];
$item_transaction = $_REQUEST['tx']; // Paypal transaction ID
$item_price = $_REQUEST['amt']; // Paypal received amount
$item_currency = $_REQUEST['cc']; // Paypal received currency type
$price = '10.00';
$currency='USD';
//Rechecking the product price and currency details
if($item_price==$price && $item_currency==$currency)
{
echo "<h1>Welcome, Guest</h1>";
echo "<h1>Payment Successful</h1>";
}
else
{
echo "<h1>Payment Failed</h1>";
}
|
Paypal API cancel_return file.
When your web application test payment system workflow is completed. Change the form action development API URLs to original API URLs and give valid $paypal_id seller email id.
|
$paypal_url='https://www.sandbox.paypal.com/cgi-bin/webscr';
//to
$paypal_url='https://www.paypal.com/cgi-bin/webscr';
|
For More Info Visit : Paypal Integration Using PHP
No comments:
Post a Comment