RE: [PHP] PayPal: Instant Payment Notification
Lauri, There are a couple links here that might help: http://www.paypalipn.com/scripts.html Chris Montgomery[EMAIL PROTECTED] Airtight Web Services http://www.airtightweb.com Web Development, Web Project Management, Software Sales 210-490-3249/888-745-7603 > -Original Message- > From: Lauri Vain [mailto:[EMAIL PROTECTED]] > Sent: Saturday, April 27, 2002 11:26 AM > To: 'PHP' > Subject: [PHP] PayPal: Instant Payment Notification > > > Hello there, > > Has anybody worked with PayPal's Instant Payment Notification? > > How exactly does it work -- will the payer ever go to PayPal's site > itself (and leave my site for a sec) or will all contact with PayPal's > servers be handled by my script? > > I have to write a system that enables payments via this service, but I'm > low on documentation and this service is a new one for me. > > An overview of the process and pointers would be great! > > Thanks, > Lauri > -- > Tharapita Creations > [server-client web applications] > [EMAIL PROTECTED] > Mobile: +372 53 410 610 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PayPal: Instant Payment Notification
Hi all- > > Has anybody worked with PayPal's Instant Payment Notification? > Not yet, but am about to. we integrated paypal in phpauction. At paypal.com, one you register as developer, you have access to their documentation. That's enough to get it working. > > How exactly does it work -- will the payer ever go to PayPal's site > > itself (and leave my site for a sec) or will all contact with PayPal's > > servers be handled by my script? > No, the user doesn't 'leave' your site, all the processing goes on behind > the scenes. In our implementation, phpauction set up a form with hidden fields containing the data paypal expects to receive. Once the user submit that form he goes to paypal and makes the payment. In that form you pass to paypay a "Confirm" URL you want your users to be redirected after they do the payment and a "Cancel" URL where you want your users to be redirected if they press Cancel at peupal. What you'll also have to do is to set up the IPN url, where paypal will POST the transaction result in the format described in the documentation. Once your IPN script receives the POST from paypal, it will be able to check the transaction's result and act accordingly (tipically update some database tables). I cannot pass you the entire code since it belongs to the non-GPL version of phpauction but will surelly post some pieces of code here if need it. Cheers Gianluca > > I have to write a system that enables payments via this service, but I'm > > low on documentation and this service is a new one for me. > > > > An overview of the process and pointers would be great! > > Paypal provides some scripts which looks self-explanatory. -- Gianluca Baldo Mallorca 186 - 3º 1ª 08036 Barcelona (Spain) tel/fax +34 93 454 93 24 http://www.phpauction.org http://www.gianlucabaldo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PayPal: Instant Payment Notification
On Sunday 28 April 2002 00:25, Lauri Vain wrote: > Has anybody worked with PayPal's Instant Payment Notification? Not yet, but am about to. > How exactly does it work -- will the payer ever go to PayPal's site > itself (and leave my site for a sec) or will all contact with PayPal's > servers be handled by my script? No, the user doesn't 'leave' your site, all the processing goes on behind the scenes. > I have to write a system that enables payments via this service, but I'm > low on documentation and this service is a new one for me. > > An overview of the process and pointers would be great! Paypal provides some scripts which looks self-explanatory. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Never leave anything to chance; make sure all your crimes are premeditated. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PayPal: Instant Payment Notification
Hello there, Has anybody worked with PayPal's Instant Payment Notification? How exactly does it work -- will the payer ever go to PayPal's site itself (and leave my site for a sec) or will all contact with PayPal's servers be handled by my script? I have to write a system that enables payments via this service, but I'm low on documentation and this service is a new one for me. An overview of the process and pointers would be great! Thanks, Lauri -- Tharapita Creations [server-client web applications] [EMAIL PROTECTED] Mobile: +372 53 410 610 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: re: [PHP] Paypal Instant Payment Notification
simply change the fsocketopen's socket from 80 to 443 (SSL port) > I'm thinkin' the problem is that I'm not posting to > https://www.paypal.com/blah, but to > http://www.paypal.com/. How do I use the posttohost > function (or some other function) to post securely? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
re: [PHP] Paypal Instant Payment Notification
hi guys! i've been working on this darn "instant payment notification" script for weeks now. I've gotten pretty close based on some recent posts that use the great Rasmus' postToHost function to talk to paypal and get the "confirmation". However, the reply from paypal, instead of being "one word" (VALID or INVALID), is a whole web page. I'm thinkin' the problem is that I'm not posting to https://www.paypal.com/blah, but to http://www.paypal.com/. How do I use the posttohost function (or some other function) to post securely? Best, Sondra -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Paypal Instant Payment Notification
>>My problem (due to my lack of fundemental understanding) is that I don't know how to read Paypal's response to the post. >>Paypal describes the response like this, >>"PayPal will respond to the post with a single word, 'VERIFIED' or 'INVALID', in the body of the response." YES EXACTLY. it will be in that var in either xml or straight htmlsimply regex the $result var and look for verified or invalid and act accordingly. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Paypal Instant Payment Notification
I'm close to finishing a php script for Paypal's Instant Payment Notification Service. Here is what I have so far. I grapped this function off of the php documentation and added the last line. This forms the response to be posted back to Paypal. *** // Function to convert posted array to a string. while(list($key, $val) = each($HTTP_POST_VARS)) { $key = stripslashes($key); $val = stripslashes($val); $key = urlencode($key); $val = urlencode($val); $postString .= "$key=$val&"; // Add cmd=_notify-validate; $postString .= "cmd=notify_validate"; } *** Next, I used Rasmus Lerdorf's PostToHost function to send the post. http://pgfsun.ucdavis.edu/php-stuff/post_to_host.inc.txt My problem (due to my lack of fundemental understanding) is that I don't know how to read Paypal's response to the post. Paypal describes the response like this, "PayPal will respond to the post with a single word, 'VERIFIED' or 'INVALID', in the body of the response." How do I receive and handle this response? Is this the $return_result variable in the PostToHost function? Once this is received, the data can be processed however one pleases. -Randall
Re: [PHP] Paypal & instant payment notification
> Actually it doesn't seem like too much of a hack, except that it seems > to be not a realtime operation (otherwise why would they need to contact > your script?). They contact your script so you can do whatever *YOU* want for each transaction -- Log it, email the customer, ring a bell, whatever. They don't need to provide custom templates and database services to you on their site just so you can manage your customers. I dunno what the lag is between a transaction and the POST they send out, but there's no reason to expect it's not as real-time as it gets. All they have to do is open up a connection to port 80 on your server and send a few POST headers. Sample code to do this abounds in the various PHP Code Archive sites, so if you wanna write your own PayPal, this would be an easy feature. You are provided with a half of a key-pair to check back with their server that it's *REALLY* coming from them, and not some spoofer thief trying to fool your system into thinking they paid with PayPal when they didn't. So you send back your half of the key-pair, and they say "Yep, that's valid." and you *KNOW* it's a valid notification. Of course, if somebody can hack into PayPal server and insert their own key-pair, you're screwed, but one would hope they're pretty up on security over there at PayPal, eh? Whether you have a Shopping Cart or not is irrelevant -- If you want to provide people with the option of using PayPal, and you want to record their purchase in real-time instead of, err, doing it by hand when PayPal sends you some report or something, you want this instant payment notification stuff. Don't have sample code, but it's basically just an fopen() to the URL they provide with the key they provide, and then examine the output for either: "Yes, that's valid." "No, that's not valid." "Our server is dead. Sorry." types of results. If it's a "Yes", you mark the transaction as "Paid" or whatever your shopping cart does, and then ship the goods. If it's not valid, you log it, and tell the Customer their hack didn't work. If the server is dead, you tell the Customer there will be a short delay in verifiction, but they can check back in a half hour to be sure it all went through, and then retry in a few minutes or whatever. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Paypal & instant payment notification
> To me, this seems kind of like a hack -- i.e. there should be a better > way to do this, perhaps as part of a (free or low-cost) shopping cart > and payment prcoessing system. Also, there seems to be no way to test > this without sending the Paypal user money. (I am going to contact > Paypal about that one.) Actually it doesn't seem like too much of a hack, except that it seems to be not a realtime operation (otherwise why would they need to contact your script?). Good points: 1. PayPal contacts your script to tell it about the transaction, this script could be anywhere. 2. Requires verification from PayPal. 3. Encrypted transaction identifier from PayPal means you don't have to protect your receiving script with SSL. Bad point: 1. Sounds like it's not realtime. Jason -- Jason Murray [EMAIL PROTECTED] Web Developer, Melbourne IT "Work now, freak later!" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Paypal & instant payment notification
Hello, I have a customer who wants to implement Paypal instant payment notification on his website. Basically, he wants a script that emails a custom message once a customer purchases an item. Instant Payment Notification has the ability to do this. However, I have a couple of questions: -- Is this really the best method? We're going to implement a shopping cart on the site, too, so Paypal might not be the best solution. -- Does anyone have sample code for Instant Payment Notification? If you'd like more information about Instant Payment Notification, you can go here: https://www.paypal.com/cgi-bin/webscr?cmd=p/acc/ipn-info Note that this requires you to login with a Paypal account. Here's a brief synopsis taken from the above page: How It Works When a customer makes a payment to you, PayPal will post a notification to your server at a URL you specify. Included in this notification will be all of your customer's payment information (e.g. customer name, amount) as well as a piece of encrypted code. When your server receives a notification, it will then post the information, including the encrypted code, back to a secure PayPal URL. PayPal will authenticate the transaction and send confirmation of its validity back to your server. After you have activated Instant Payment Notification, your server will be sent a notification every time you receive a payment, this notification will be sent as a hidden "FORM POST" to the URL you specified, and will include all of the payment information. The FORM variables for the notification are listed below: To me, this seems kind of like a hack -- i.e. there should be a better way to do this, perhaps as part of a (free or low-cost) shopping cart and payment prcoessing system. Also, there seems to be no way to test this without sending the Paypal user money. (I am going to contact Paypal about that one.) Any experiences, good or bad, and advice would be appreciated. Thanks! Erica Remove SPAMFREE- to email me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]