简体   繁体   English

Android 中的条带结帐集成

[英]Stripe checkout integration in Android

I'm trying to integrate Stripe checkout in an android application.我正在尝试将 Stripe 结帐集成到 android 应用程序中。 Currently I'm receiving the checkout session ID from the backend.目前我正在从后端收到结帐 session ID。 I need to run this js code in application我需要在应用程序中运行这个 js 代码

<script src="https://js.stripe.com/v3/"></script>
<script>
  var stripe = Stripe('publishable_key')

  stripe.redirectToCheckout({
    sessionId:session.id

    })
</script>

In web, this code redirects to a page hosted in Stripe.在 web 中,此代码重定向到托管在 Stripe 中的页面。 How to achieve the same in android.I was advised against webview by the Stripe support as that solution appears to have some issues.如何在 android 中实现相同的效果。Stripe 支持建议我反对 webview,因为该解决方案似乎存在一些问题。 How to proceed further from here.如何从这里进一步前进。

If you do not wish to use a WebView then your only option is to use the Stripe android SDK.如果您不想使用WebView ,那么您唯一的选择是使用 Stripe android SDK。 There is no other way to run js code in android directly.没有其他方法可以直接运行android中的js代码。 Especially since this code simply redirects to Stripe gateway which will require a WebView.特别是因为此代码只是重定向到需要 WebView 的 Stripe 网关。

Stripe has proper documentation on steps to be followed at https://stripe.com/docs/payments/accept-a-payment?platform=android . Stripe 在https://stripe.com/docs/payments/accept-a-payment?platform=android上有关于要遵循的步骤的适当文档。 You will still need to perform some operations on your backend depending on your use-case.根据您的用例,您仍然需要在后端执行一些操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM