Forums

Event Switcher & PayPal Redirect

wayne.regehr 12 Sep, 2014
I have a form that is capturing user input data for events. (One form per single event.)

This form is being loaded on the page inside a bootstrap 3 modal, in the body, via an iFrame.

The form works correctly as intended except for the PayPal Redirect action. I've taken a photo of the Events and Actions for this form below:
[attachment=0]Screen Shot 2014-09-12 at 3.18.28 PM.png[/attachment]

After the form is is submitted, the Event Switcher checks to verify the requested ticket quantity can be met. If it can meet the requested quantity, it continues to process. If not, it loops for user correction.

Next, the standard Captcha check. Assuming that passes the input is saved to db and an email is sent. I have tested and verified everything is working up until this point. I have verified that the table entries are being saved to the db and I receive the emails as expected.

Lastly, the PayPayl Redirection action should be invoked at this point. However, the only visible action at this point is a blank page. I have tried using the Debugger action, placed before and after the Event Switcher action. The Debugger is not generating any output.

I recently implemented the Event Switcher action to execute the ticket check. Prior to that the PayPal Redirect action was working just fine.

What can I be looking for to better understand the issue/conflict?
I can provide more details or conduct further tests as necessary.
GreyHead 13 Sep, 2014
Hi wayne.regehr,

A completely blank page is usually a sign of a PHP error. Please try setting the Site Error Reporting to Maximum just long enough to submit the form and see if you get a more useful error message.

Bob
wayne.regehr 15 Sep, 2014
Bob,

I took your advice and set the Site Error Reporting to 'Maximum' while conducting testing of the form. I was still not receiving and errors messages.

While I was thinking through the possible issues, I realized that the error messages most likely will not display in the iframe even if there were any. I then tested the form outside of the iframe and the PayPal redirect worked as expected/intended.

How can I have the form invoke the PayPal Redirect from inside the iframe? Unfortunately I do require the use of iframes for displaying the form. This particular page has up to four forms, which is the reason for the iframes. Basically we needed a clean layouts for users that is not confusing. Even if the PayPal Redirect opened in a new window/tab (not inside the iframe), that would work great.

I will keep working to that end and update with any progress I make.
wayne.regehr 15 Sep, 2014
I think I may have a potential solution but need some assistance to fill in the blanks.

I have this javascript that will a open URL (if supplied or a blank window):
window.open("URL", "_blank");


I tried to have the form open a new window just prior to the PayPal Redirect. The goal was to have the PayPal payment form opened in a new window. Unfortunately I had no success.

My thoughts at this time are that if I can take the PayPal Redirect headers (Curl) and use that when opening the new window it should be successful. How can I access the final output PayPal headers to use for the URL in my javascript?
wayne.regehr 15 Sep, 2014
After testing the Javascript redirect, I ran into conflicts with existing code. As an alternative I'm now using the PHP function HTTP_REDIRECT

http_redirect("relpath", array("name" => "value"), true, HTTP_REDIRECT_PERM);


This is working to redirect correctly, and inside the iframe as well. The issue I've now come across is that to redirect to PayPal for payment I not only require the URL (https://www.paypal.com/cgi-bin/webscr?) which I have, but also the array of values PayPal requires. I'm not aware of how to access that/those variable(s) I require. Are you able to provide this information?
wayne.regehr 15 Sep, 2014
Please note after the HTTP_REDIRECT executes, the PayPal Redirect action is adding the Curl
/index.php?68b6a028a505e8bbef036a38c3641755=35e904f98fd4378b2247ce29a7a467a1


I attempted redirecting to 'https://www.paypal.com/cgi-bin/webscr?', but get redirected to the PayPal homepage. I believe this is due to some encoding going on with the Curl.
GreyHead 16 Sep, 2014
1 Likes
Hi wayne.regehr,

I'm a bit lost about what you are trying to do here. Once you are in a iFrame I would expect that the continuing form processing would stay in the iFrame.

cURL is used to send the data but *not* the user. Is that your intention here? The more common method is to use a ReDirect URL to send the data *and* the User over to PayPal to complete the transaction. I'm not sure if you can get the PayPal Return URL to stay in the same iFrame though.

I'm not clear that a permanent HTTP redirect is useful here - but that's outside my knowledge.

Bob
wayne.regehr 16 Sep, 2014
Bob,

Essentially I am attempting to process my form inside of an iFrame, both the raw data collection and then the PayPal payment. After a lot of research it appears PayPal will not work within iFrames for security reasons, which makes complete sense. Just not what I wanted to hear.

In this scenario, I will need to use a different approach.

Thanks for your assistance. Consider this topic closed.
GreyHead 16 Sep, 2014
Hi wayne.regehr,

Thanks for the update - I didn't know that either, though, as you say, it make sense.

Just a though - but might you be able to get round this somehow by submitting the form data using Ajax from the IFrame and then doing the PayPal transaction from the server in the background??

Bob
This topic is locked and no more replies can be posted.