使用Cordova ios 4.0.0+的Stripe Checkout [英] Using Stripe Checkout with Cordova ios 4.0.0+

查看:115
本文介绍了使用Cordova ios 4.0.0+的Stripe Checkout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图让Stripe结帐与Cordova iOs 4.2.0一起工作,但我没有运气。最后使用的Cordova iOs版本是3.9.2。为了测试我制作了一个空的hello world cordova应用程序,并为条带添加了此代码(在ios 9和10上测试):

I have been trying to get Stripe checkout working with Cordova iOs 4.2.0 and am having no luck. The last Cordova iOs version this works with is 3.9.2. To test I made an empty hello world cordova app and added this code for stripe (tested on ios 9 and 10):

<script
    src="https://checkout.stripe.com/checkout.js" class="stripe-button"
    data-key="xxxxxxx"
    data-amount="999"
    data-name="Oki Technologies Inc"
    data-description="Widget"
    data-locale="auto"
    data-currency="cad">

现在它在Cordova上运作完美ios 3.9.2,但在4.0.0+上它只有一个带有黑色叠加层的空iframe。我认为它试图在像移动网络这样的新标签中打开弹出窗口,而不是像应用程序那样的弹出窗口。我希望有一个useragent或我可以欺骗的东西让它工作,因为它完美的android web / cordova以及网络上的iphone。有没有办法让这个工作?

Now it works perfectly on Cordova ios 3.9.2, but on 4.0.0+ it just has an empty iframe with a dark overlay. I think its trying to open the popup in a new tab like the mobile web, instead of as a popup like it is supposed to do on the app. I'm hoping there's a useragent or something I can spoof to get this to work as it works perfectly on android web/cordova as well as iphone on the web. Is there any way to get this working?

我在这里做了一个测试回购,有人可以克隆来测试
https://github.com/HockeyCommunity/stripe

I made a test repo here that someone can clone to test https://github.com/HockeyCommunity/stripe

推荐答案

我是几天来我的头撞墙,寻找解决方案。解决方法是将以下两行添加到我的 config.xml 文件中:

I was banging my head against the wall for days looking for a solution to this. Solution was to add the following two lines to my config.xml file:

< ; access origin =*/>
< allow-navigation href =https://*.stripe.com/*/>

希望这有帮助!

编辑:更新的解决方案,建议来自@TateThurston

Updated solution with suggestion from @TateThurston

这篇关于使用Cordova ios 4.0.0+的Stripe Checkout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆