Manually Redirect to Paypal in onSubmit

khenn 08 Jan, 2010
I was originally using the Redirect plugin to go to Paypal, but I want to programmatically determine if I should send the user to Paypal, or just show a thank you page based on a radio button where the user can choose to pay with check or paypal. I have the manual redirect working in the "onSubmit before email", however, what url can I set the Paypal "return" variable to so that it will return to my form and continue the processing of the page by sending the email an displaying a thank you page?

Thanks,
Kris
GreyHead 09 Jan, 2010
Hi Kris,

There isn't an instant answer to this :-(

Ideally I think that we should support IPN, techically that's not difficult I just need to find the time to work through the code.

The problem with returning to the form is that you don't want to return to the form itself, and, for technical reasons the submisson page (with &task=send in the URL) doens't easily accept external connections.

I think I would probably use &task=extra in the PayPal return URL and then custom code the remaining action is the extra code 1 box. Far from ideal but probably the most straightforward solution.

You could try returning to &task=send with the Security token off but it woudl then take some experimenting to pick up the flow of the code.

An alternative approach is to save the user data to the database and then use a second form in the return url that autosubmits - as I think about it that might be better.

Bob
khenn 12 Jan, 2010
Bob,

If I were to set the return url for paypal to my form url with the task=extra entry in it, would my email still fire?

What I need is:
User chooses to pay with check... submits form and saves data, system sends confirmation email and then displays Thank You
OR
User chooses to pay with Paypal... submits form and saves data, system redirects to Paypal, user completes payment, user returns to form where email is sent, paypal transaction id is stored and record is updated as paid in database, then Thank You is displayed.

How can I best accomplish this?

Kris
GreyHead 13 Jan, 2010
Hi Kris,

Returning to the extra code won't fire your email unless you set it up manually. I think the better approach might be to return to a second form - though you'd need to bypass the security token check.

Bob
cedric 14 Jan, 2010
I've got the same problem
Could you help Us to explain how to make a second form?
Or Is it simple to use the API ?
What i need to use it ?
If i use the API paypal, will i be able to make a form as show:
The user enters the datas, then is redirected to paypal, then redirected to the page (After Submit) with (for example) a return (PAID), and the datas are writen on the database..

I dont know very well the product but on my opinion, this is the most important to be able to make a form, then paid, check if the paiement is OK, if it is, write the datas to the database.

!

Thanks a lot , and sorry formy english

Cédric
This topic is locked and no more replies can be posted.