Hi, I need to know how to set up a very very simple paypal system, where a customer hits the buy now button, pays via paypal, and is then emailed either an attachment or a password to a secret area. I've had this set up before and I know it's very simple so I know I don't need to pay for it. I've played with the code a bit myself but it's been a while. I used IPN. Can anyone point me to a simple php script to set up this system? I could do the email stuff myself, I just need to handle the paypal info. It's only one ebook.
I think here http://www.pixelmill.com/support/support_article.aspx?ArticleID=kb101591 you can get all informations you need.
Hi you could set up an account with Payloadz.com. The customer clicks to purchase. Pays. And an email is sent with a file to download. You could include the password within that file. (A .txt file within a .zip file perhaps) Very simple. I've been doing this for about 3 years with Payloadz.com Hope this helps.
Thanks. But I found the answer on the paypal site. I use this script and simply send an email to the customer containing their download info. // read the post from PayPal system and add 'cmd' $req = 'cmd=_notify-validate'; foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } // post back to PayPal system to validate $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30); // assign posted variables to local variables $item_name = $_POST['item_name']; $item_number = $_POST['item_number']; $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; if (!$fp) { // HTTP ERROR } else { fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp ($res, "VERIFIED") == 0) { // check the payment_status is Completed // check that txn_id has not been previously processed // check that receiver_email is your Primary PayPal email // check that payment_amount/payment_currency are correct // process payment } else if (strcmp ($res, "INVALID") == 0) { // log for manual investigation } } fclose ($fp); } ?> PHP:
I have something similar I offer for google checkout. Call it Google-Digital-Chekcout and sell it for 15.00 to people looking for a quick solution to digital delivery. I dont know why i chose google checkout. Who has the better rates anyone know off hand? Cause seeing any skimmed off the top makes me cringe.