Page 1 of 1

PayPal page jumps out of the iFrame

Posted: Mon Aug 05, 2019 8:36 am
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

Re: PayPal page jumps out of the iFrame

Posted: Mon Aug 05, 2019 8:46 am
by Pablo
You have already asked this before:
viewtopic.php?f=5&t=85834

Re: PayPal page jumps out of the iFrame

Posted: Mon Aug 05, 2019 12:06 pm
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

Re: PayPal page jumps out of the iFrame

Posted: Mon Aug 05, 2019 12:34 pm
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.

Re: PayPal page jumps out of the iFrame

Posted: Mon Aug 05, 2019 8:24 pm
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

Re: PayPal page jumps out of the iFrame

Posted: Mon Aug 05, 2019 9:05 pm
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

Re: PayPal page jumps out of the iFrame

Posted: Mon Aug 05, 2019 10:10 pm
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

Re: PayPal page jumps out of the iFrame

Posted: Mon Aug 05, 2019 10:52 pm
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.

Re: PayPal page jumps out of the iFrame

Posted: Mon Aug 05, 2019 11:07 pm
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

Re: PayPal page jumps out of the iFrame

Posted: Tue Aug 06, 2019 6:37 am
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.

Re: PayPal page jumps out of the iFrame

Posted: Tue Aug 06, 2019 7:09 am
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

Re: PayPal page jumps out of the iFrame

Posted: Tue Aug 06, 2019 7:17 am
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.

Re: PayPal page jumps out of the iFrame

Posted: Tue Aug 06, 2019 7:23 am
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?

Re: PayPal page jumps out of the iFrame

Posted: Tue Aug 06, 2019 8:06 am
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.

Re: PayPal page jumps out of the iFrame

Posted: Wed Aug 07, 2019 12:13 am
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