[ic] Paypal Notification Page

General interchange-users@interchange.redhat.com
Sun Mar 17 23:43:58 2002


Hey All,
Thanks for the comments about hosting reliability. Either they solve 
this with your suggestions, or I'll find a new host.
Also fixed my taxshipping issue :)

I've set up my site to accept paypal instant payments (if anyone wants 
to see the code, let me know), but I was hoping someone could send me an 
example of a notification receiving page (to be called by paypal, once 
the payment has been entered).
I'm thinking about doing it in php, because that seems to be the easiest 
for someone who is familiar just with some html.

code from paypal at this link:
http://www.paypal.com/cgi-bin/webscr?cmd=p/pdn/pp-solutions-ipn-outside

here's the part I need help with: (lines with *, I added)

	if (strcmp ($res, "VERIFIED") == 0) {
	// check the payment_status=Completed
*		if (payment_status == "Completed"){
	// check that txn_id has not been previously processed
*			if(???what do I do here???) {
	// check that receiver_email is an email address in your PayPal account
*				if(receiver_email == "MyEmail@MyAddress.com"){
	// process payment
*		???How can I call this "[process secure=1]"???
				}
			}
		}
	}
	else if (strcmp ($res, "INVALID") == 0) {
	// log for manual investigation
*		???how do I do this???
	}
	}


Are the if statements (with else statements added to debug) a good way 
to do this?
Does the format look correct?
What should I do where I have question marks?
(the [Process] command is set up to increment the inventory and generate 
a receipt. I just need to know how to automatically page forward)

big thanks,
Jeff Urban