PayPal Android Native Checkout SDK - invalid client_id or redirect_uri, and CHECKOUT_ERROR
Asked Answered
M

3

6

I have followed PayPal Android SDK Integration from this link: https://developer.paypal.com/docs/limited-release/native-checkout/android/invoking-sdk.

I am getting this error page on reaching PayPal.. On return to app I am getting this exception from the PayPal Callbacks.

Macromolecule answered 26/2, 2021 at 6:15 Comment(1)
May this answer help you.Randall
P
4

I solved this problem by adding the Return Url. The error comes when the return URL from your app doesn't match with the return URL described in your Paypal sandbox account. So, to solve it, just simply do these steps:

  1. https://developer.paypal.com/developer/applications (go to this link)
  2. Go to your app edit page.
  3. Click under the "SANDBOX APP SETTINGS" > "Return URL" > "Show" Add your BuildConfig.APPLICATION_ID://paypalpay (com.example.appname://paypalpay)
  4. More important step is left also: Do it must: Select the "Native Checkout SDK" checkbox, found within the "Advanced options" of the "Accept payments" option. ** Diagram:- "My apps & credentials" -> "App feature options" >"Accept payments" -> "Advanced options" -> "Native Checkout SDK" (check it)
Propensity answered 22/4, 2021 at 9:14 Comment(0)
T
3

I was able to solve the problem by. The problem occours when the return url from your app doesn't match with the return url described in your paypal sandbox account.

  1. go to https://developer.paypal.com/developer/applications
  2. Go to your app edit page.
  3. Click under the "SANDBOX APP SETTINGS" > "Return URL" > "Show"
  4. Add your BuildConfig.APPLICATION_ID://paypalpay (com.example.mypaypalappdemo://paypalpay)

And the problem is solved.

Transitory answered 9/4, 2021 at 12:31 Comment(0)
C
1

Edit: it's no longer limited release, so this answer no longer applies


As that limited release document notes in a red box, "Important: PayPal Checkout Native SDK is a limited-release solution available only to select merchants"

If you are not one of those select merchants (and my understanding is there are very few), an error such as "invalid client_id" on reaching PayPal is expected.

Consecution answered 26/2, 2021 at 6:28 Comment(6)
iOS team also integrated with same account. Paypal is working for them. But not working for android.Macromolecule
Does it work in live for them? Maybe it only works in sandbox, and you have some other additional problem. Per the error it could be related to the redirect_uri , but you haven't provided any code to show how you're sending that. Maybe you need to set up your app for deeplinking, so there is a URI scheme to return to. In any case, don't spend time integrating this in sandbox-only if it won't work for a live accountConsecution
I am setting checkoutConfig.merchantRedirectUrl as myapp://paypalpay . Should I need to register any intents? or Shall I use the deeplink provided by the Firebase?Macromolecule
Is "myapp" your BuildConfig.APPLICATION_ID , and was that set up earlier as the redirect scheme?Consecution
Yes @Preston PHXMacromolecule
More likely a REST app / client_id issue then, but strange if the same one is working on iOS. You can contact PayPal's support about itConsecution

© 2022 - 2024 — McMap. All rights reserved.