我需要在我的移动应用程序中集成paypal支付。但这种错误也会发生
我正在使用这个贝宝android sdk版本
implementation 'com.paypal.sdk:paypal-android-sdk:2.16.0'
我开始服务
//Paypal Service
Intent intent = new Intent(this,PayPalService.class);
intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION,config);
startService(intent);
然后我付款
amount = edtAmount.getText().toString();
PayPalPayment payPalPayment = new PayPalPayment(new BigDecimal(String.valueOf(amount)), "USD", "Pay Now",PayPalPayment.PAYMENT_INTENT_SALE);
Intent intent = new Intent(this, PaymentActivity.class);
intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION,config);
intent.putExtra(PaymentActivity.EXTRA_PAYMENT,payPalPayment);
startActivityForResult(intent,PAYPAL_REQUEST_CODE);
我已经尝试了沙盒和生产,但仍然遇到相同的问题,这是我登录买家帐户后的错误。
E/paypal.sdk: request failure with http statusCode:404,exception:Not Found
E/paypal.sdk: Exception parsing server response
org.json.JSONException: End of input at character 0 of
at org.json.JSONTokener.syntaxError(JSONTokener.java:460)
at org.json.JSONTokener.nextValue(JSONTokener.java:101)
at com.paypal.android.sdk.cw.m(Unknown Source:7)
at com.paypal.android.sdk.fm.d(Unknown Source:0)
at com.paypal.android.sdk.ci.a(Unknown Source:21)
at com.paypal.android.sdk.cm.a(Unknown Source:58)
at com.paypal.android.sdk.cq.onResponse(Unknown Source:45)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
E/paypal.sdk: request failed with server response:
E/paypal.sdk: INTERNAL_SERVER_ERROR
1条答案
按热度按时间deyfvvtc1#
由于paypal android sdk非常陈旧,已经过时,因此请改用新的android原生 checkout sdk。