I know that we can define a return URL in forms for paypal payments. I wonder if we can define two return urls, one for success and another for fail pages. I looked arround but couldn't find proper info. Does anyone know if it can be done?


Recommended Answers

All 5 Replies

As far as I know, there can only be one call page for PayPal and it will include message with valid or invalid CC, etc

I do not believe there is a way to do 2 ways.

I agree there's no other way for this, there can only be one URL for Paypal returns.

Hi !
All the programming is based on the binary system.In a binary there are only two values 0 or 1,true or false.At a one time you can do only one operation from both.

As the above posters have said, PayPal only accepts one Return URL. However, you can also define a Cancel URL for if the user cancels the transaction while on the PayPal site. Perhaps this is what you are looking for? Check this list of PayPal HTML variables for more info. I believe that the variable in question is called "cancel_return".

Alternatively, if you're interested in receiving information from PayPal about whether a transaction has been successful or not, you need to configure Instant Payment Notifications. These are POST requests from PayPal which go to a special URL which you provide, containing a lot of information about the transaction. Setting these up is an entirely different barrel of monkeys, however. I'd recommend reading PayPal's guide to IPNs if this is the functionality that you're looking for. It is really useful so definitely worth checking out.

Hope this helps!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.