atapi
10th December 2004, 10:43 AM
shortened paypal script
can someone give me some bare minimum version of the paypal script.
what do I need to include in my own ipn script to integrate this.
I have been reading your paypal scipt and I think I have it down to
these lines
I need a miniversion where I can set the value I want to set for each subscription
$item_name = $_POST['item_name'];
$custom = $_POST['custom'];
$item_number = $_POST['item_number'];
$payment_status = $_POST['payment_status'];
$payment_amount = $_POST['mc_gross'];
$payment_currency = $_POST['mc_currency'];
$txn_id = $_POST['txn_id'];
$receiver_email = $_POST['receiver_email'];
$payer_email = $_POST['payer_email'];
$postvars = '';
foreach($_POST as $k=>$v)
$postvars .= "$k=$v;";
$saleReg = new SaleRegistrator();
// register sale
if($saleReg->decodeData($custom))
{
DebugMsg("PayPal callback: Start registering sale, params TotalCost='".$payment_amount."', OrderID='".$txn_id."', ProductID='".$item_number."'", __FILE__, __LINE__);
$saleReg->registerSale($payment_amount, $txn_id, $item_number);
DebugMsg("PayPal callback: End registering sale", __FILE__, __LINE__);
}
else
{
DebugMsg("PayPal callback: SaleRegistrator->decodeData returned false", __FILE__, __LINE__);
}
DebugMsg("PayPal callback: End registering sale", __FILE__, __LINE__);
can someone give me some bare minimum version of the paypal script.
what do I need to include in my own ipn script to integrate this.
I have been reading your paypal scipt and I think I have it down to
these lines
I need a miniversion where I can set the value I want to set for each subscription
$item_name = $_POST['item_name'];
$custom = $_POST['custom'];
$item_number = $_POST['item_number'];
$payment_status = $_POST['payment_status'];
$payment_amount = $_POST['mc_gross'];
$payment_currency = $_POST['mc_currency'];
$txn_id = $_POST['txn_id'];
$receiver_email = $_POST['receiver_email'];
$payer_email = $_POST['payer_email'];
$postvars = '';
foreach($_POST as $k=>$v)
$postvars .= "$k=$v;";
$saleReg = new SaleRegistrator();
// register sale
if($saleReg->decodeData($custom))
{
DebugMsg("PayPal callback: Start registering sale, params TotalCost='".$payment_amount."', OrderID='".$txn_id."', ProductID='".$item_number."'", __FILE__, __LINE__);
$saleReg->registerSale($payment_amount, $txn_id, $item_number);
DebugMsg("PayPal callback: End registering sale", __FILE__, __LINE__);
}
else
{
DebugMsg("PayPal callback: SaleRegistrator->decodeData returned false", __FILE__, __LINE__);
}
DebugMsg("PayPal callback: End registering sale", __FILE__, __LINE__);