Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
617 views
in Technique[技术] by (71.8m points)

kotlin - while paypal integration , I entered email and password , I'm getting " Login Failed ->System error.please try again later dialog"

I'm getting this dialog

   implementation 'com.paypal.sdk:paypal-android-sdk:2.16.0'

   val intent = Intent(this, PayPalService::class.java)
    intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config)
    startService(intent)

   private var config =
    PayPalConfiguration()
        .environment(PayPalConfiguration.ENVIRONMENT_SANDBOX)
        .clientId(AppConstants.getPayPalClientID())

   val payment = PayPalPayment(
        BigDecimal(7),
        "USD",
        "abcd",
        PayPalPayment.PAYMENT_INTENT_ORDER
    )
    payment.invoiceNumber(getting this from my backend)


    val intent = Intent(this, PaymentActivity::class.java)

    // send the same configuration for restart resiliency

    // send the same configuration for restart resiliency
    intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config)

    intent.putExtra(PaymentActivity.EXTRA_PAYMENT, payment)

    startActivityForResult(intent, 0)

The above-implemented code is for Paypal payment, Is the above-implemented code is correct or not

below provided my error for the above code, I'm getting the below exception

 E/paypal.sdk: request failure with http statusCode:404,exception:
2021-01-28 17:16:05.886 7263-10006/{package name} 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:174)
    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:919)
2021-01-28 17:16:05.887 7263-10006/{package name} E/paypal.sdk: request failed with server 
 response:
   2021-01-28 17:16:05.890 7263-7263/{package name} E/paypal.sdk: INTERNAL_SERVER_ERROR

please give the solution for this, anyone have a Paypal mobile SDK integration, please give the blog

question from:https://stackoverflow.com/questions/65936836/while-paypal-integration-i-entered-email-and-password-im-getting-login-fa

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

That SDK has been deprecated for years and is now sunset (end of life). It cannot be used.

If you need a native SDK for PayPal payments, use Braintree's. Here is some documentation: https://developer.paypal.com/docs/archive/checkout/how-to/braintree-integration/ , the rest of it is on Braintree's site. Do not create a gateway account. Use an access token from the bottom of developer.paypal.com applications for authentication to your PayPal account. You will need a webservice to get the client token.

For a non-native integration, use PayPal Checkout


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...