Fiverr Script 2.6 - Payment System Notification Not Working with AlertPay IPN

Hello Guys !
If anyone have experience with fiverr script or knowledge in php coding can help me pls…

I have install fiverr script 2.6 on my hosting server… everything works very well ,system of messages reports,email verifications,gigs creating etc.

The Problem:
When i have tested the payment via AlertPay to order a gig in admin area payment statistics continue to stay zero ( 0 ) also the seller did not receive any e-mail notification for the “order” i have setup the AlertPay IPN as it is described on the script tutorial thing that is easy…and still not working…

After Payment via alertpay to the redirected page only show me this message below…
after 15 seconds this process will restart again and again… :frowning:

Thank you for your order!

Your payment is currently being verified and your order created.

Please stay on this page until this message disappears so you can submit your order requirements to the seller!

This page will automatically refresh in 15 seconds. [refresh now]

Below is tha “ipn_ap.php” code : if you see any wrong code please tell me what change i can do…

[php]<?php
/**************************************************************************************************
| Fiverr Script
| http://www.fiverrscript.com
| [email protected]
|
|**************************************************************************************************
|
| By using this software you agree that you have read and acknowledged our End-User License
| Agreement available at http://www.fiverrscript.com/eula.html and to be bound by it.
|
| Copyright © 2011 FiverrScript.com. All rights reserved.
|**************************************************************************************************/
include(“include/config.php”);
define(“IPN_SECURITY_CODE”, $config[‘ap_code’]);
define(“MY_MERCHANT_EMAIL”, $config[‘alertpay_email’]);

$receivedSecurityCode = urldecode($_POST[‘ap_securitycode’]);
$receivedMerchantEmailAddress = urldecode($_POST[‘ap_merchant’]);
$transactionStatus = urldecode($_POST[‘ap_status’]);
$testModeStatus = urldecode($_POST[‘ap_test’]);
$purchaseType = urldecode($_POST[‘ap_purchasetype’]);
$totalAmountReceived = urldecode($_POST[‘ap_totalamount’]);
$feeAmount = urldecode($_POST[‘ap_feeamount’]);
$netAmount = urldecode($_POST[‘ap_netamount’]);
$transactionReferenceNumber = urldecode($_POST[‘ap_referencenumber’]);
$currency = urldecode($_POST[‘ap_currency’]);
$transactionDate= urldecode($_POST[‘ap_transactiondate’]);
$transactionType= urldecode($_POST[‘ap_transactiontype’]);
$customerFirstName = urldecode($_POST[‘ap_custfirstname’]);
$customerLastName = urldecode($_POST[‘ap_custlastname’]);
$customerAddress = urldecode($_POST[‘ap_custaddress’]);
$customerCity = urldecode($_POST[‘ap_custcity’]);
$customerState = urldecode($_POST[‘ap_custstate’]);
$customerCountry = urldecode($_POST[‘ap_custcountry’]);
$customerZipCode = urldecode($_POST[‘ap_custzip’]);
$customerEmailAddress = urldecode($_POST[‘ap_custemailaddress’]);
$myItemName = urldecode($_POST[‘ap_itemname’]);
$myItemCode = urldecode($_POST[‘ap_itemcode’]);
$myItemDescription = urldecode($_POST[‘ap_description’]);
$myItemQuantity = urldecode($_POST[‘ap_quantity’]);
$myItemAmount = urldecode($_POST[‘ap_amount’]);
$item_number = urldecode($_POST[‘apc_1’]);
$featured = urldecode($_POST[‘apc_2’]);

if($featured == “featured”)
{
if ($receivedMerchantEmailAddress != MY_MERCHANT_EMAIL)
{
echo “Error 1”;
}
else
{
if ($receivedSecurityCode != IPN_SECURITY_CODE)
{
echo “Error 2”;
}
else {
if ($transactionStatus == “Success”)
{
if ($testModeStatus == “1”)
{
$transactionReferenceNumber = “Test Payment”;
}
$user_id = $myItemCode;
$PID = $item_number;
$apcurrency = $config[‘alertpay_currency’];
$price = $config[‘fprice’];

			if($apcurrency==$currency && $totalAmountReceived==$price)
			{
				$qry = "INSERT INTO paypal_table2 VALUES (0 , '$customerEmailAddress', '$transactionDate', '$transactionReferenceNumber', '$customerFirstName', '$customerLastName', '$customerEmailAddress', 'alertpay', '$purchaseType', 'alertpay', '$myItemName', '$item_number', $myItemQuantity, $totalAmountReceived, '$currency', '$customerAddress', '".nl2br($customerAddress)."', '$customerCity', '$customerState', '$customerZipCode', '$customerCountry', 'alertpay', '$customerEmailAddress', '$purchaseType', 'alertpay', 'alertpay', '$purchaseType')";
				if (mysql_query($qry)) 
				{
					$transid = mysql_insert_id(); 
					if($PID > 0)
					{
						$query = "INSERT INTO featured SET PID='".mysql_real_escape_string($PID)."', time='".time()."', price='".mysql_real_escape_string($price)."', PAYPAL='".mysql_real_escape_string($transid)."'"; 
						$executequery=$conn->execute($query);
						
						$query = "UPDATE posts SET feat='1' WHERE PID='".mysql_real_escape_string($PID)."'"; 
						$executequery=$conn->execute($query);
					}
				}
				else 
				{
					echo "Error 3";
				}
			}
			else 
			{
				echo "Error 4";
			}
		}
		else 
		{
			echo "Error 5";
		}
	}
}

}
else
{
if ($receivedMerchantEmailAddress != MY_MERCHANT_EMAIL)
{
echo “Error 1”;
}
else
{
if ($receivedSecurityCode != IPN_SECURITY_CODE)
{
echo “Error 2”;
}
else {
if ($transactionStatus == “Success”)
{
if ($testModeStatus == “1”)
{
$transactionReferenceNumber = “Test Payment”;
}
$user_id = $myItemCode;
$PID = $item_number;
$apcurrency = $config[‘alertpay_currency’];

			$query = "select price from posts where PID='".mysql_real_escape_string($PID)."'"; 
			$executequery=$conn->execute($query);
			$price = $executequery->fields['price'];
			if($price == "")
			{
				$price = $config['price'];
			}
			
			if($apcurrency==$currency && $totalAmountReceived==$price)
			{
				$qry = "INSERT INTO paypal_table VALUES (0 , '$customerEmailAddress', '$transactionDate', '$transactionReferenceNumber', '$customerFirstName', '$customerLastName', '$customerEmailAddress', 'alertpay', '$purchaseType', 'alertpay', '$myItemName', '$item_number', $myItemQuantity, $totalAmountReceived, '$currency', '$customerAddress', '".nl2br($customerAddress)."', '$customerCity', '$customerState', '$customerZipCode', '$customerCountry', 'alertpay', '$customerEmailAddress', '$purchaseType', 'alertpay', 'alertpay', '$purchaseType')";
				if (mysql_query($qry)) 
				{
					$transid = mysql_insert_id(); 
					if($user_id > 0)
					{
						$query = "INSERT INTO orders SET USERID='".mysql_real_escape_string($user_id)."', PID='".mysql_real_escape_string($PID)."', time_added='".time()."', status='0', price='".mysql_real_escape_string($price)."'"; 
						$executequery=$conn->execute($query);
						$order_id = mysql_insert_id();
						if($order_id > 0)
						{
							$query = "INSERT INTO payments SET USERID='".mysql_real_escape_string($user_id)."', OID='".mysql_real_escape_string($order_id)."', time='".time()."', price='".mysql_real_escape_string($price)."', t='1', PAYPAL='".mysql_real_escape_string($transid)."'"; 
							$executequery=$conn->execute($query);
							
							$query = "UPDATE posts SET rev=rev+$price WHERE PID='".mysql_real_escape_string($PID)."'"; 
							$executequery=$conn->execute($query);
						}
					}
				}
				else 
				{
					echo "Error 3";
				}
			}
			else 
			{
				echo "Error 4";
			}
		}
		else 
		{
			echo "Error 5";
		}
	}
}

}
?>[/php]

thanks

Sponsor our Newsletter | Privacy Policy | Terms of Service