使用Android连接Stripe并获取Stripe用户ID?

时间:2015-09-23 11:17:41

标签: android oauth alertdialog stripe-payments strip-tags

在Stripe Dialog中启动Stripe Connect页面。

使用以下代码连接条纹:

mStripeButton = (StripeButton) PaymentOptionPage.findViewById(R.id.StripeConnect);

        mStripeButton.setStripeApp(mApp);

        mStripeButton.addStripeConnectListener(new StripeConnectListener() {

            @Override
            public void onConnected() {

                Log.e("getAccessToken", "" + mApp.getAccessToken());

                Stripe.apiKey = mApp.getAccessToken();

                Log.e("Stripe.apiKey", "" + Stripe.apiKey);

                Log.e("getUserId", "" + mApp.getStripeSession().getUserId());


            }

            @Override
            public void onDisconnected() {

                Log.e("getAccessToken", "Disconnected");

                Log.e("getUserId", "" + mApp.getStripeSession().getUserId());

            }

            @Override
            public void onError(String error) {
                Toast.makeText(mContext, error, Toast.LENGTH_SHORT).show();
            }

        });

当记住我的密码时,在抛出异常后连接到Stripe后选中Checked:

  

09-23 07:14:38.301:W / System.err(9597):java.io.FileNotFoundException:   https://connect.stripe.com/oauth/token 09-23 07:14:38.301:   W / System.err(9597):at   com.android.okhttp.internal.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:197)

     

09-23 07:14:38.301:W / System.err(9597):at   com.android.okhttp.internal.http.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)

     

09-23 07:14:38.301:W / System.err(9597):at   com.android.okhttp.internal.http.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:25)

     

09-23 07:14:38.301:W / System.err(9597):at   com.healingradius.Stripe.StripeUtils.executePost(StripeUtils.java:64)

     

09-23 07:14:38.301:W / System.err(9597):at   com.healingradius.Stripe.StripeApp $ 3.run(StripeApp.java:98)09-23

     

07:14:38.396:W / EGL_emulation(9597):eglSurfaceAttrib未实现

     

09-23 07:14:38.396:W / OpenGLRenderer(9597):设置失败   表面上的EGL_SWAP_BEHAVIOR为0xabb5ad20,错误= EGL_SUCCESS 09-23   07:14:38.422:I / StripeConnect(9597):   StripeApp.mHandler.handleMessage():调用mListener.onSuccess()

     

09-23 07:14:38.465:D / StripeButton(9597):正在呼叫   OAuthAuthenticationListener.onSuccess()09-23 07:14:38.465:   D / StripeButton(9597):断开09-23 07:14:38.465:   D / StripeButton(9597):调用mStripeConnectListener.onDisconnected()

     

09-23 07:14:38.466:E / getAccessToken(9597):断开连接09-23   07:14:38.466:E / getUserId(9597):null 09-23 07:14:38.466:   d / StripeConnect(9597):   StripeConnectAPI.OAuthWebViewClient.onPageFinished():url:   http://localhost/?scope=read_write&code=ac_72FiJhG5tvzMi7U1yoSGaYV6MCsaZC9I#

0 个答案:

没有答案