in

AlertPay Developers Community

txt AlertPay Instant Payment Notification PHP Sample

Downloads: 2,151 File Size: 8kB
Posted By: AlertPay_Peter Views: 4,974
Date Added: 02-09-2008

AlertPay Instant Payment Notification (IPN)

Script: AlertURL.php
Platform: PHP

Purpose:

The purpose of this code is to help you to understand how to process the Instant Payment Notification 
variables for Subscription Button and integrate it in your PHP site.

How to Use: 

Put this code into the page which you have specified as Alert URL.
The variables being read from the _POST object in the below code are pre-defined IPN variables and the
the conditional blocks provide you the logical placeholders to process the IPN variables. It is your responsibility
to write appropriate code as per your requirements.

THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE.

Developer Feedback:

If you have any questions about this script or any suggestions, please email to: devsupport@alertpay.com.

Comments

 

Piyal said:

nice help
07-05-2008 11:25 AM
 

drisate said:

Please add better notes on if the $ap_SecurityCode var should have the encrypted value or the unencrypted one. This script would also need a debug mode where if activated alertpay sends back some info that would help find the scripts problems. Could be a report after the test transaction or an email ... what ever but something to help identify the problems.
08-02-2008 7:39 PM
 

drisate said:

I made some changes to this IPN and posted a new version here: http://dev.alertpay.com/forums/p/1653/3502.aspx#3502
08-02-2008 10:46 PM
 

drisate said:

New version with a debugger included: http://dev.alertpay.com/forums/t/1710.aspx
08-08-2008 12:01 PM
 

Avnendra kumar said:

i am implementing the alertpay IPN for my site .Can you suggest me thee is any testing environment like sandbox in paypal. Thanks, Avnendra
08-22-2008 8:53 AM
 

Mark Sandifur said:

I had a user who said that they tryed to use a credit card to pay viia alertpay and got a error said that Purchase type was invalid but if they dont use a credit cadr the transaction will go threw fine here is how i have my ipn set up keep in mind it works correct with acount funds but when they use a credit card says the purchase type field is incorect <form action='https://www.alertpay.com/PayProcess.aspx' method='post'> <input type='hidden' name='ap_purchasetype' value='Item'> <input type='hidden' name='ap_merchant' value='$settings[pay_ap]'> <input type='hidden' name='ap_itemname' value='$payment_id'> <input type='hidden' name='ap_currency' value='USD'> <input type='hidden' name='ap_returnurl' value='".$settings[base_url]."/index.php?view=thankyou&order_id=$order_id&".$url_variables."'> <input type='hidden' name='ap_quantity' value='1'> <input type='hidden' name='ap_description' value='$payment_id'> <input type='hidden' name='ap_amount' value='$amount'> <input type='hidden' name='ap_cancelurl' value='".$settings[base_url]."/index.php?".$url_variables."'> <input type='hidden' name='apc_1' value='$order_id'> <input type='hidden' name='ap_itemcode' value='$order_id'> <input type=\"submit\" name=\"submit\" value=\"Pay Now With AlertPay\"> </form>
08-29-2008 8:50 PM
 

Calle said:

Hi! Can I use this script on my ptc website so people get payed instantly?
09-14-2008 6:22 AM
 

nyha said:

Calle; you CAN'T!!! alertpay NOT supported for this feature!
09-18-2008 1:41 PM
 

Calle said:

Okay, thanks nyha.
09-27-2008 6:55 AM
 

Brownie said:

Do u have anyone there that I can pay to get this working with my script and site?
10-01-2008 12:55 AM
 

Will said:

I also would like to know if you have anyone that is reasonable that I could pay to add the payment script to my site?
10-16-2008 3:39 PM
 

fawad said:

I am trying to insert the data in my mysql if the payment is complete sucesssfully but it not inserting the datain to table.. I used it with his ipn script and it is working fine but not with ipn. Any sugesstion if ($ap_Status == "Success") { $connection = mysql_connect('localhost', 'xxxxx, 'xxxxxx) or die ('Unable to connect!'); mysql_select_db('xxxxxx_order') or die ('Unable to select database!'); mysql_query("REPLACE INTO orders (username,id,ip,date,method,cart,discount,subtotal,shipping,tax,total,shipping_zone,inv_name,inv_company,inv_addr1,inv_addr2,inv_state,inv_zip,inv_country,del_name,del_addr1,del_addr2,del_state,del_zip,del_country,tel,fax,email,message) VALUES ('ap_ReferenceNumber','Konect1','','','','$ap_Itemcode','0.00','0.00','0.00','0.00','$ap_Amount','0','','','','','','','','','','','','','','','','$ap_CustEmailAddress','Completed')");
10-18-2008 6:36 PM
 

Viser Exciser said:

nyha, what do you mean, you can't use this instant payment feature? Then how do we use this script so alertpay pays instantly? please contact me on zvork@yahoo.com i need to know how to integrate this into a e-commerce script
11-08-2008 10:28 PM
 

Saifur said:

One of my client wanted that they want to integrate Alertpay in their site and don't want the visitor to keep in their site. Is there any way to send the data directly from the site to alert pay?
12-03-2008 8:21 AM

Add Comment

(required) 
(required)
(optional)
(required) 
Add

  AlertPay - Verified by Visa AlertPay - secure credit card and checking services BBBOnline Reliability Program