Skip to content

Instantly share code, notes, and snippets.

@awebneck
Created February 25, 2011 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awebneck/844043 to your computer and use it in GitHub Desktop.
Save awebneck/844043 to your computer and use it in GitHub Desktop.
<script type="text/javascript" charset="utf-8">
function handleEmbeddedFlow() {
try {
if (parent.myEmbeddedPaymentFlow) {
parent.myEmbeddedPaymentFlow.paymentSuccess();
} else if (top && top.opener && top.opener.top) {
top.opener.top.myEmbeddedPaymentFlow.paymentSuccess();
window.close();
} else if (top.myEmbeddedPaymentFlow) {
top.myEmbeddedPaymentFlow.paymentSuccess();
} else {
throw "Error";
}
} catch (err) {
top.opener.location.href = "<?php echo $rh->getUrl('socialite_order_success', array(), true) ?>";
window.close();
}
}
setTimeout(handleEmbeddedFlow,200);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment