Stripe Connect Android [英] Stripe Connect Android

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

问题描述

我正在构建一个向某人付款的android应用.我浏览了Stripe Connect,它具有网站的API和流程,它需要显示一个Stripe Connect按钮,并且还需要一个重定向的uri.

I am building an android app which pays someone. I explored Stripe Connect and it has an API and flow for website which requires displaying a stripe connect button and also needs a re-direct uri.

但是,我在Android上找不到任何可以显示连接按钮并提示用户在Android设备上本地创建或连接条带化帐户的内容.我应该使用网络视图来执行此操作还是有一些更优雅的方法来执行此操作?

However, I can not find anything on for Android which allows to show a connect button and prompt user to create or connect a stripe account natively on Android device. Should I use a webview to do this or is there some more elegant way to do this?

推荐答案

据我所知,没有用于移动条带连接的本地SDK.我为Android做过webview路由.是微不足道的,但我同意我希望对此有一个更优雅的解决方案.

As far as I know, there're no native SDK for mobile stripe connect. I did the webview route for android. Was trivial, but I agree that I wished there're a more elegant solution to this.

对于那些想知道如何执行此操作的人(由于我在那里找不到任何文档),请前往:

For those who are wondering on how to do this (since I can't find any doc out there), here you go:

  1. 创建一个按钮,该按钮将通过网络视图打开新的意图.

  1. Create a button that will open a new intent with a web view.

Web视图应加载oauth/authorize端点(" https://connect.stripe.com/oauth/authorize?response_type=code&client_id= [YOUR_API_KEY]& scope = read_write ).不要忘记在Webview上启用javascript.

The webview should load the oauth/authorize endpoint ("https://connect.stripe.com/oauth/authorize?response_type=code&client_id=[YOUR_API_KEY]&scope=read_write"). Do not forget to enable javascript on your webview.

一旦填写了Webview中的表单,如果授权成功,Stripe将重定向到您提供的授权代码的redirect_url.让您的Web服务解析该授权代码.

Once the form in webview is filled, Stripe will redirect to the redirect_url you provided with the authorization code if the authorization is successful. Have your web service parse that authorization code.

通过提供Grant_type,client_id,代码和client_secret,让您的服务发布oauth/token条纹.

Have your service make a post to stripe oauth/token with providing grant_type, client_id, code, and client_secret.

条带将使用所需的令牌(身份验证凭据)进行响应.储存以备后用你差不多完成了.

Stripe will then respond back with the token (auth credentials) that you needed. Store that for later use & you're pretty much done.

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

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