Nameslot is a .com-only forum – membership is free with full access; upgrades offer extras like banner ads and newsletter spots. ✅ Signature links are free. No AI-generated posts – share your own insights or risk account removal.
  • Welcome to NamesLot.com Domain Name Forum

    NamesLot.com Domain Name Forum offers a fully open forum to discuss domain industry news and a 0% commission marketplace for you to buy and sell domain names.

    We have reorganized our Marketplace so now it is easier to get attention to your domain while it is also easier for buyers to find the right domain name.

    If you want us to add more threads to our marketplace, please contact us! Listing on our marketplace as always, 100% free! Register NOW or Login HERE!

PHP paypal IPN code

  • Thread starter Thread starter nick
  • Start date Start date
Status
Not open for further replies.
N

nick

Guest
Hey guys. Here is the code for paypal IPN thing.

checkout.php
PHP:
<?php
include("Includes/functions.php");
$dbc = dbconnect();
$pageid = $QUERY_STRING;
if ($QUERY_STRING == "")
{
$pageid = 1;
}
$arr = explode("x", $pageid);
$hid = $arr[0];
$catid = $arr[1];
$site_url = "http://www.hehehahahaha.com";
$order_total = 10;
$order_total = number_format($order_total, 2, ".", ",");
$order_id = "$hid" . "x" . "$catid";

$r = mysql_query("Select * from tblhost WHERE HID = '$hid'");
while ( $row = mysql_fetch_array ( $r ) )
{
$my_sFirstName = $row['User'];
$my_sLastName = $row['User'];
$hemail = $row['Email'];
$hname = $row['Host'];
}
$my_clientEmail = $hemail;
$business_paypal = "[email protected]";
$currency_id = "USD";
$sdate = time();
$r = mysql_query("INSERT INTO tblsponser (HID, CID, Sdate) VALUES ('$hid', '$catid', '$sdate')");


//redirect to paypal
header("location:https://www.paypal.com/xclick?business=$business_paypal&item_name=$hname$order_id&first_name=$my_sFirstName&last_name=$my_sLastName&email=$my_clientEmail&item_number=1&custom=$hid&amount=$order_total&currency_code=$currency_id&notify_url=$site_url/notify.php&return=$site_url/thankyou.php");
?>


Now for the IPN script:
notify.php
PHP:
<?php

	// Assign posted variables to local variables
	$receiver_email = $_POST['receiver_email'];
	$payer_email = $_POST['payer_email'];
	$payer_status = $_POST['payer_status'];
	$payment_gross = $_POST['payment_gross'];
	$payment_fee = $_POST['payment_fee'];
	$payment_date = $_POST['payment_date'];
	$payment_type = $_POST['payment_type'];
	$payment_status = $_POST['payment_status'];
	$pending_reason = $_POST['pending_reason'];
	$txn_id = $_POST['txn_id'];
	$txn_type = $_POST['txn_type'];
	
	$custom = $_POST['custom'];

	if ($_REQUEST['payment_status'] == "Completed" || $_REQUEST['payment_status'] == "Pending") {

//Query for the payment recieved

include("Includes/functions.php");

$dbc = dbconnect();

$hid = $custom;



$r = mysql_query("Update tblsponser SET Payment = 'Y' WHERE HID = '$hid'");

////////////////////////////////////////


}
?>

Enjoy and have fun.
 
Status
Not open for further replies.

Members online

No members online now.

Forum statistics

Threads
21,273
Messages
71,289
Members
44,709
Latest member
kritika12
Active members today
2
New members today
1
New threads today
6
New posts today
7

Latest Listings

Follow NamesLot on Twitter!

NamesLot proudly supported by

NamesLot proudly supported by

Top