Forum Moderators: buckworks

Message Too Old, No Replies

letting customer to pay with paypal

         

prog_sys

2:54 pm on May 9, 2008 (gmt 0)

10+ Year Member



So I have some problem about how to let customer pay using paypal. I know how to make the Buy Now button using script from paypal.

Do someone have some php script that can allow people who had paid for certain product to download a product, without requiring them to log in or sign up ?

Thank you.

T_Miller

4:14 pm on May 9, 2008 (gmt 0)

10+ Year Member



If you setup a sales action (via buttons, scripts, carts, email, PP invoice) that transfers to PayPal for payment, the customer does not have to have a PP account or open a PP account.

They just have to use the link to the left that says "pay with a credit card". It's not displayed in a manner to draw attention to it. PayPal makes the "signup/login" method VERY prominent as they would much rather have customer do that.

I have seen some sites mention this to customers before sending them to the PayPal page. "You don't need a PayPal Account. Just choose Pay With Credit Card" or something to that effect.

You can also use PayPal Website Payments Pro which is setup more like a traditional payment gateway and the customers never "see" that their CC is being processed by PayPal.

[edited by: T_Miller at 4:16 pm (utc) on May 9, 2008]

rocknbil

4:41 pm on May 9, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard prog_sys!

Do someone have some php script that can allow people who had paid for certain product to download a product, without requiring them to log in or sign up ?

T_Miller is addressing log in at payPal, I am presuming you're looking for an automated process at your site after a completed payment.

You can use Payments Pro if you want to post "silently," but there is also payPal's IPN (Instant Payment Notification.) It's a bit less work to implement, especially for a small site. Here's one way that works.

Before sending them off to payPal, you generate a unique ID. This ID is stored in your database with this purchase but your programming prevents access by some mechanism you create. A simple way is to add a field in your database named "transaction_complete" - you mark it to 0 for now.

So now they've clicked submit, you've stored their data in a database but marked as incomplete and identified by the transaction ID field. Put the value of that transaction ID in a variable, and send it along with the other data to payPal. Incidentally, you'll be sending other variables that were submitted on your site - first name, last name, etc., in pre-defined payPal variables so when they get there, those fields are already filled out at payPal.

They arrive and make a payment. It doesn't matter if they use a credit card without logging in, or log in; they can pay by credit card, eCheck, or instant transfer bank account. This becomes important in a minute.

In the meantime, you have a SECOND script on your server, let's call it an "IPN listener." This script listens for posts from payPal, which send a) the transaction id, which is the same number you generated earlier and is a "handle" on this transaction, and b) a payment status. When your script receives data from payPal, it should look up the transaction ID in your database, set the transaction complete field to 1 (if successful,) and emails the customer the status of the purchase, with a link to the download. (Aside: the download link should be unique and have some form of expiration, another topic.)

Here's where the beauty of IPN comes in: in the case of a bank transfer or credit card payment, payPal will connect with your payPal listener almost immediately. If they pay by eCheck, it may not make the connection for several days. In either case, you don't have to worry about manually assigning downloads - when the payment is complete, your payPal listener script does it for you.

There are ample documentation and samples on the IPN API within your payPal account, I don't think you even need to dabble in the payPal developer area to start experimenting with this. You will, however, need basic programming skills or find someone who can do this for you in the programming language of your choice.

prog_sys

8:18 am on May 22, 2008 (gmt 0)

10+ Year Member



Can someone tell me some links where I can start to learn the programming myself ?