android - Stripe 连接安卓

标签 android stripe-payments

我正在构建一个支付某人费用的 Android 应用程序。我探索了 Stripe Connect,它有一个 API 和网站流程,需要显示一个 stripe 连接按钮,还需要一个重定向 uri。

但是,我在 Android 上找不到任何允许显示连接按钮并提示用户在 Android 设备上本地创建或连接 Stripe 帐户的内容。我应该使用 WebView 来执行此操作还是有更优雅的方法来执行此操作?

最佳答案

据我所知,没有用于移动 strip 连接的原生 SDK。我为android做了webview路由。微不足道,但我同意我希望有一个更优雅的解决方案。

对于那些想知道如何做到这一点的人(因为我在那里找不到任何文档),给你:

  1. 创建一个按钮,该按钮将使用 Web View 打开一个新的 Intent。

  2. webview 应该加载 oauth/authorize 端点(“https://connect.stripe.com/oauth/authorize?response_type=code&client_id=[YOUR_API_KEY]&scope=read_write”)。不要忘记在您的 WebView 上启用 javascript。

  3. 在 webview 中填写表单后,如果授权成功,Stripe 将重定向到您提供的带有授权码的 redirect_url。让您的 Web 服务解析该授权代码。

  4. 让您的服务通过提供 grant_type、client_id、code 和 client_secret 发布一个 strip 化 oauth/token。

  5. 然后 Stripe 将使用您需要的 token (授权凭据)进行响应。将其存储起来以备后用,您就大功告成了。

关于android - Stripe 连接安卓,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29904041/

相关文章:

iphone - Swift Apple Pay 崩溃; PKPaymentAuthorizationViewController = 无

node.js - strip 连接错误

localization - Stripe : Is it possible to set the locale for every request (in order to get an error message in proper language)?

javascript - 检测手机震动

javascript - OnKeyboard 在 Sencha Touch 中隐藏

express - Stripe "Cannot accept the Terms of Service on behalf of Standard and Express connected accounts"

java - 是否有任何方法或参数可以从 stripe api 获取无效/停止卡信息 我只能从 stripe 获取到期月份/年份

android - 在为 Android 运行 COCOS2D 时出现致命异常 : main

android - 在 OpenShift Jenkins 上构建 Android 应用程序

c# - 如何使用 Android 版 Xamarin 格式化电话号码?