Adaptive Payment: How to close lightbox from close url?
-
11-06-2021 - |
Question
I have GWT application which is integrating with lightbox on AdaptivePayment API.
I am having trouble closing the cancel/return pages using the code provided:
dgFlow = top.dgFlow || top.opener.top.dgFlow;
dgFlow.closeFlow();
top.close();
I tried calling above code from inside/outside of the Iframe containing cancel/return pages however failed to dismiss the flow. Could someone give me an example of the use case?
Thank!
Solution
I was calling:
var dgFlow = new $wnd.PAYPAL.apps.DGFlow({ trigger: 'invokeOverlay' });
JSNI methods are decalred inside an IFrame, so dgFlow was never a global variable.
$wnd.dgFlow = new $wnd.PAYPAL.apps.DGFlow({ trigger: 'invokeOverlay' });
Add the variable to the document Window to make it explicitly global.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow