PayPal page jumps out of the iFrame

Issues related to forms.
Post Reply
User avatar
alex4orly
 
 
Posts: 632
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

PayPal page jumps out of the iFrame

Post by alex4orly »

Please visit this page : https://communitylifestyleaccommodation ... frame.html
The first button that says $100 is actually set currently to only $1 - for my testing stage
The initial page is inside an iFrame - set to _self , but once clicked - the Payment page gets to full screen - and doesn't stay inside my iFrame

Any idea why?

Thanks
User avatar
Pablo
 
Posts: 21580
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PayPal page jumps out of the iFrame

Post by Pablo »

You have already asked this before:
viewtopic.php?f=5&t=85834
User avatar
alex4orly
 
 
Posts: 632
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: PayPal page jumps out of the iFrame

Post by alex4orly »

Yes, this is true, except now it happens in Chrome, Firefox, Opera, IE and Edge....
The common thread is - WWB and I can't think of how would WWB cause this?

Cheers
User avatar
Pablo
 
Posts: 21580
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PayPal page jumps out of the iFrame

Post by Pablo »

For me, the PayPal website stays inside the frame.
However, I can imagine that for security reasons PayPal breaks out of the frame.
This is unrelated to WWB.
User avatar
alex4orly
 
 
Posts: 632
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: PayPal page jumps out of the iFrame

Post by alex4orly »

OK, so is it that Paypal in the UK and PayPal in Australia have different security rules?
I will try to research that on the forums

Thannks
User avatar
BaconFries
 
 
Posts: 5328
Joined: Thu Aug 16, 2007 7:32 pm

Re: PayPal page jumps out of the iFrame

Post by BaconFries »

My personal opinion is PayPal form should never be in an iframe but that's just my two cents.
See the following:
https://www.paypal.com/us/smarthelp/art ... ite-ts1191
User avatar
alex4orly
 
 
Posts: 632
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: PayPal page jumps out of the iFrame

Post by alex4orly »

Thanks guys,
I read the aricle you pointed me to BaconFries
Is there a way however to bring up PayPal into a PopUp dialog instead?

Cheers
User avatar
BaconFries
 
 
Posts: 5328
Joined: Thu Aug 16, 2007 7:32 pm

Re: PayPal page jumps out of the iFrame

Post by BaconFries »

Again this will be a security restriction in the same way as using a iframe so I think you will just need the payment to go to PayPal directly.
User avatar
alex4orly
 
 
Posts: 632
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: PayPal page jumps out of the iFrame

Post by alex4orly »

On the PayPal developers articles, they have some script samples to use a popup.
I am asking if there is a way to do it from within wb?

Cheers
User avatar
Pablo
 
Posts: 21580
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PayPal page jumps out of the iFrame

Post by Pablo »

You can create a popup with a dialog or modal layer. However, if this is triggered from an inline frame then PayPal will still break out of the frame.
If you have found a script that make it possible then this will also work with WWB.
User avatar
alex4orly
 
 
Posts: 632
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: PayPal page jumps out of the iFrame

Post by alex4orly »

OK, I have this cript that I use in other projects,

Please click this link : https://communitylifestyleaccommodation ... ptest.html
The first button that says $100 - has the value set to just $1 for my testing
If you click that button, it will bring up the page inside a popup.

All works fine and PayPal does NOT jump outside of the Dialog, but
When it returns to the thank-you page or on cancel to the website - in either case it loads it also into the Popup dialog
I tried setting the return URL to : _parent:https://communitylifestyleaccommodation.org.au/
I also tried the body of the thankyou page to have an onload function with this simple script in it:

<script type="text/javascript">
SomeFunction();

function SomeFunction()
{
window.history.go(-2);
}
</script>

But, nothing helps me, it stays inside the box...

Any better suggestion?

Cheers
User avatar
Pablo
 
Posts: 21580
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PayPal page jumps out of the iFrame

Post by Pablo »

Once you are in the popup, you cannot go back to the main window. There is no way for the popup to know which windows has triggered it.
User avatar
alex4orly
 
 
Posts: 632
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: PayPal page jumps out of the iFrame

Post by alex4orly »

Well, in production mode - this popup is called from a menu option - so, yes it does "Know" which window it was called from
But maybe there is another option? to force that popup to close itself?
User avatar
Pablo
 
Posts: 21580
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PayPal page jumps out of the iFrame

Post by Pablo »

I'm sorry, to do not know another method.
I do not think it's a good idea to look for workarounds to defeat PayPal's security measures.
You may be able to find a workaround that works today but there is no guarantee that it will work tomorrow.
User avatar
alex4orly
 
 
Posts: 632
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: PayPal page jumps out of the iFrame

Post by alex4orly »

OK, I found another method - very simple actually - Onclick of the final thank-you page (the same for the Cancel option) I created a simple Javascript function

<script type="text/javascript">

function closeCurrentWindow() {
window.close();
}
</script>

To see it in action - please visit:
https://communitylifestyleaccommodation ... ptest.html

This is now just a temporary entry point for testing, when we go live this will be invoked from a menu option.
So, please click the submit button - you get a new dialog coming up, now :
1) If click the close 'x' at the top, you are left on the website
2) If you click the first button $100 (it is currently set to pay $1 only for testing) you get to the Paypal page - still within that same dialog
3) If you proceede to pay, you are returned into a Tank-You page whit a button, when you click it - the dialog is closing itself
4) IF you change your mind and select Cancel on the PayPal page, you are returned to another page with an Exit button also

Thank you again
Post Reply