简体   繁体   中英

Stripe checkout integration in Android

I'm trying to integrate Stripe checkout in an android application. Currently I'm receiving the checkout session ID from the backend. I need to run this js code in application

<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. How to achieve the same in android.I was advised against webview by the Stripe support as that solution appears to have some issues. 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. There is no other way to run js code in android directly. Especially since this code simply redirects to Stripe gateway which will require a WebView.

Stripe has proper documentation on steps to be followed at 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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