PayPal Express Checkout 付款后返回 Flex
我已成功将 PayPal Express 集成到 Flex 应用程序中。在 DoExpressCheckoutPayment.php 中,我有以下 JavaScript 代码行不会执行:
window.opener.window.document.getElementById('index').paymentComplete();
'index' - http:// /mysite.com/index.html# 包含index.swf ' paymentComplete() ' - 完成处理交易的函数
有人使用 JavaScript 成功激活了从弹出窗口到 Flex 应用程序的回调方法吗?
预先感谢您的帮助,
奥维尔
I have successfully integrated PayPal Express into a Flex application. In DoExpressCheckoutPayment.php, I have the following JavaScript line of code that will not execute:
window.opener.window.document.getElementById('index').paymentComplete();
'index' - http://mysite.com/index.html# contains index.swf
'paymentComplete()' - the function that finishes processing the transaction
Has anyone successfully activated callback methods back from a popup to a Flex application using JavaScript?
Thank you in advance for any help,
Orville
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
SWFAddress 将是一个非常好的解决方案。
SWFAddress would be a really good solution for this.
在 Flex 中,URLRequest 中的地址是绝对地址 (http://mysite.com/phpfolder/),而不是相对于 SWF (/phpfolder)。由于某种原因,JavaScript 需要相对 URL 才能运行以下行。我不知道为什么。
In Flex, the address in URLRequest was absolute (http://mysite.com/phpfolder/) and not relative (/phpfolder) to the SWF. For some reason JavaScript requires the relative URL for the following line to work. I am not sure why.
如果您可以让弹出窗口在包含flex应用程序的html页面中调用JS方法,则可以使用 ExternalInterface 类的 addCallBack 方法,使该 JS 方法与 Flex 应用程序进行通信。
If you can get the popup to call a JS method in the html page that holds the flex app, you can use addCallBack method of the
ExternalInterface
class to make that JS method communicate with the flex app.对于 getElementById 使用 OBJECT-tag 中 EMBED-tag 的 id ..而不是 OBJECT-tag 本身的 id!
for getElementById use the id from the EMBED-tag in the OBJECT-tag .. not the id from the OBJECT-tag itself!