Welcome to WebmasterWorld Guest from

Forum Moderators: buckworks

Message Too Old, No Replies

Registration after payment with Paypal.



1:23 pm on Sep 23, 2009 (gmt 0)

5+ Year Member


I have a client that wants to offer a paid membership area using paypal.

So far I have set up a website payment standard button.

The process:

Buy button -> User pays -> User redirected to account registration page and fills in their email & password -> user database is updated with email,password & paid=yes.

How can I carry a variable to the registration page so I can insert into the database that the user has paid?

What I don't want is people to get hold of the registration url so they can bypass the payment stage.

Is it possible? i've been reading the paypal library forever and can't find anything.


1:24 pm on Oct 3, 2009 (gmt 0)

5+ Year Member

Nobody done this before?


1:27 pm on Oct 3, 2009 (gmt 0)

Encrypt it. There's an option to do that when you're setting up the payment button.


4:23 pm on Oct 3, 2009 (gmt 0)

10+ Year Member

look for IPN (Instant Payment Notification) on PayPal
The url on your website that the user gets sent to has a key appended, you send this key back to PayPal to verify


12:04 pm on Oct 16, 2009 (gmt 0)

5+ Year Member

Unfortunately can't find either of those options when trying to create a paypal standard button.


5:37 pm on Oct 16, 2009 (gmt 0)

10+ Year Member

when you create the payment button, you add a callback url that PayPal sends the user back to on your website when the payment process is complete. PayPal sends additional data back to this url.

Verifying this data is a lot more advanced than creating a standard button. It's part of the PayPal API, documentation and examples are on PayPal


7:18 pm on Oct 16, 2009 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Yes, IPN is the way to go, and it's not all that difficult.

You have to read the IPN docs, but it works like this.

You go into payPal and enable IPN, enter the URL to the "listener" script described below. Whenever a payment is made, it sends a token to the listener script.

You create some script, let's call it a "listener" script. All it does is "listen" for a message sent from paypal. What payPal sends is a transaction id when a payment is complete. This is particularly cool if someone pays via eCheck, which can take up to three days to clear - three days later, the payment clears and the IPN token is sent to your listener script.

Within the listener script you have to post back to payPal using curl and append the token with "&cmd=_notify-validate." Note: this SHOULD be done over https, and there's a thread around here about non-https IPN functions failing, don't know if this is temporary or permanent.

Within your listener script, if the response is VERIFIED, you update your database.

This allows you to eliminate a lot of user error. In your scenario, the user is making a payment and you are "hoping" they click the link to "return to merchant." If they don't, the whole thing falls down.

With IPN, they enter all their info FIRST, and you add it to the database, but your database has, say, a "transaction_complete" field that is set to 0. Then they are sent on to make the payment.

If they don't use the "return to merchant" link, the IPN completes the process for them, and your listener script sets "transaction_complete" to 1, eliminating user error.


9:39 pm on Oct 18, 2009 (gmt 0)

5+ Year Member

Thanks guys that was very helpful. Got it sorted now you steered me in the right direction.

Much appreciated!


Featured Threads

Hot Threads This Week

Hot Threads This Month