Alertpay IPN Script Made Easy
Web Hosting Offer:
- 100 GB WEB SPACE
- Unlimited monthly bandwith
- Unlimited mysql, email, ftp, addon domain etc..
$35 / year (paypal accepted)
PHP Alertpay IPN script

Do you use Alertpay?
If you think you need Alertpay IPN script, take a look at this code.
<?php
/*--
PHP Alertpay IPN
by: simplePHP.net
--*/
//main function
function create_alertpay_button($item_name, $recipient_acc, $amount,
$var1, $var2, $var3){
//your thank you page
$return_url = 'http://www.yoursite.com/thank_you_page.php';
//cancel page
$cancel_url = 'http://www.yoursite.com/cancel_page.php';
//IPN page
//We don't need specify our IPN page here,
//You should insert your IPN URL on your alertpay account
echo '
<form method="post" action="https://www.alertpay.com
/PayProcess.aspx" >
<input type="hidden" name="ap_purchasetype" value="Item"/>
<input type="hidden" name="ap_merchant"
value="'.$recipient_acc.'"/>
<input type="hidden" name="ap_itemname" value="'.$item_name.'"/>
<input type="hidden" name="ap_currency" value="USD"/>
<input type="hidden" name="ap_itemcode" value=""/>
<input type="hidden" name="ap_quantity" value="1"/>
<input type="hidden" name="ap_description" value="'.$item.'"/>
<input type="hidden" name="ap_amount" value="'.$amount.'"/>
<input type="hidden" name="ap_returnurl" value="'.$return_url.'"/>
<input type="hidden" name="ap_cancelurl" value="'.$cancel_url.'"/>
<input type="hidden" name="ap_test" value="0"/>
<input type="hidden" name="apc_1" value="'.$var1.'"/>
<input type="hidden" name="apc_2" value="'.$var2.'"/>
<input type="hidden" name="apc_3" value="'.$var3.'"/>
<input type="image" name="ap_image" src="https://www.alertpay.com
/Images/BuyNow/big_pay_01.gif" alt="Subscribe via Alertpay" />
</form>
';
}
$item_name = 'My Ebook';
//your alertpay bussiness account
$recipient_acc = 'myalertpay@yahoo.com';
$amount = 15.97;
//custom variables
$var1 = 'payer_username';
$var2 = 'sponsor_id';
$var3 = 'any value here';
//create payment button
create_alertpay_button($item_name, $recipient_acc, $amount,
$var1, $var2, $var3);
?>
Please keep in mind, above code is just an example of usage.
You have to download the full code here: PHP Alertpay IPN Script (3 kb)
Enjoy..!
Baby 2008, simplePHP.net