Stripe Checkout 不适用于 WebView

Stripe Checkout does not work on WebView

我正在尝试在 WebView 中使用 Stripe Checkout(在 Android 和 iOS 中)。 如果我 运行 此 page 中的演示结帐来自 Google Chrome 来自移动设备,它会打开一个新网页并且一切正常。

当我尝试 运行 来自 WebView 的演示(我希望它以完全相似的方式运行)时,它不起作用并给了我一个

Sorry, there was a problem loading Checkout.
If this persists, please try a different browser.

我认为它不是为移动设备设计的,但事实并非如此,因为 Google Chrome 工作得很好。 有什么建议可以让它发挥作用吗?

这是我设法在 webview 上使用 Stripe Checkout 的唯一方法(我使用 Xamarin):

  1. 安装Plugin.Share from nuget(项目,在共享和特定移动项目文件夹中添加newget包)
  2. 试试这个代码看看结账是否正常:

    using System;
    
    using Xamarin.Forms;
    using Plugin.Share;
    using Plugin.Share.Abstractions;
    
    namespace stripewebviewtest
    {
        public class App : Application
        {
            public App ()
            {
                Button btn = new Button ();
                btn.Text = "Click on me!";        
    
                // The root page of your application
                MainPage = new ContentPage {
                    Content = new StackLayout {
                        VerticalOptions = LayoutOptions.Center,
                        Children = {
                            new Label {
                                XAlign = TextAlignment.Center,
                                Text = "Welcome to Xamarin Forms!"
                            },
                            btn
                        }
                    }
                };
    
                btn.Clicked += (object sender, EventArgs e) => {
                    var url = "https://stripe.com/docs/checkout";
                    CrossShare.Current.OpenBrowser (url, new BrowserOptions {
                        ChromeShowTitle = true,
                        ChromeToolbarColor = new ShareColor {
                            A = 255,
                            R = 118,
                            G = 53,
                            B = 235
                        },
                        UseSafairReaderMode = false,
                        UseSafariWebViewController = false
                    });
                };
            }
    
            protected override void OnStart ()
            {
                // Handle when your app starts
            }
    
            protected override void OnSleep ()
            {
                // Handle when your app sleeps
            }
    
            protected override void OnResume ()
            {
                // Handle when your app resumes
            }
        }
    }
    
  3. 运行 设备上的项目

  4. 单击 "Click on me!" 按钮
  5. 单击 Web 视图上的 "Pay with Card" 按钮