3
我有一個父頁面,它有PayPal
按鈕。按下按鈕將觸發一個迷你瀏覽器,用戶可以登錄並付款。PayPal Express Checkout後重定向父頁面
以下代碼在用戶付款成功後關閉PayPal mini瀏覽器。
// Add javascript to close Digital Goods frame. You may want to
// add more javascript code to
// display some info message indicating status of purchase in
// the parent window
response.setContentType("text/html");
response.getWriter()
.println(
"<script>\n alert(\"Payment Successful\");\n// add relevant message above or remove the line if not required \n window.onload = function(){\nif(window.opener){\nwindow.close();\n}\nelse{\nif(top.dg.isOpen() == true){\ntop.dg.closeFlow();\nreturn true;\n}\n}\n};\n</script>");
迷你瀏覽器已成功關閉,但我的應用程序上的父頁面保持不變。如何使用付款狀態更新父頁面?