in

AlertPay Developers Community

txt AlertPay Instant Payment Notification PHP Sample

Downloads: 5,214 File Size: 8kB
Posted By: AlertPay_Peter Views: 12,266
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
 

Ignatius said:

It doesn't work at all. PHP error in that script.
12-18-2008 9:20 PM
 

Shayan said:

hi, can any one tell me How Instantly Payment Done In a PTC Website
01-01-2009 5:20 AM
 

Pavan said:

Sir i can't create a alert pay account .I have submited my address and I also created a Alertpay emil ID and Password I have perfectly complrted the form Correctly but every time I give my ID and it is not opening at one Click,I have to again Click to resend my email . So I am confused that is my "Alertpay account is created or not ".
02-03-2009 9:17 AM
 

Pavan said:

Sir I do not have any Credit Card .Can I use Alertpay account. Please Response me. Thanking You Pavan
02-03-2009 9:25 AM
 

Raza Ali said:

my website is not getting alertpay url back values so, would you guys guide me to solve this issue?
02-06-2009 2:53 PM
 

Oleg said:

what a shame scrit
02-08-2009 3:58 AM
 

AC said:

Hi guys I have a question. I tried to use the test mode by using the same credit card twice with the same email address and I got an error for using same credit card and email address. Can someone explain me what to do to fix this problem?
02-09-2009 10:52 AM
 

Jorge Silva said:

Dear Sirs, I´m trying to contact this people, in "contact us", but it is im possible. this "intelligent support". Few weeks I sent all documents and today says that is missing. I click and don´t tell me what document it is missing. I want also to be a affiliate. There is anyone that can help me, please. Regards, Jorge Silva
05-15-2009 6:21 AM
 

okija said:

Oh yeah, what was I thinking responding http://rapid4me.com/?q=First+Responders to that in seriousness. Shame on me.
05-22-2009 8:50 AM
 

mike said:

does anone have a valid working ipn file they would care to share since i can not get any of the ones listed to work atleast not with the ipn tests as it doesnt post the data to my database or send the custom email notification i coded in to the ipn file
08-03-2009 1:22 AM
 

seo said:

seo
09-01-2009 10:53 PM
 

Ram R Tiwari said:

is there any testing environment like sandbox in paypal??can any one help me to use this in application?
10-08-2009 1:57 AM

Add Comment

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

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