SDK gives error when I use it as intended
PayPal Android SDK Version
0.0.10
Environment
Sandbox
Android Version & Device
No response
PayPal dependencies
paypal-payments-sdk = { module = "com.paypal.android:paypal-native-payments", version.ref = "0.0.10" }
Describe the bug
The SDK doesn't work when I pass the client id. The SDK works fine when I pass the token instead.
To reproduce
All PayPal calls are done by our server.
I call SDK with the next code:
val coreConfig = CoreConfig(
clientId = providerTokens!!.clientId,
environment = Environment.SANDBOX
)
val returnUrl = "${applicationContext.resources.getString(R.string.deep_link_scheme)}://paypalpay/"
val payPalNativeClient = PayPalNativeCheckoutClient(
application = applicationContext as Application,
coreConfig = coreConfig,
returnUrl = returnUrl
)
This doesn't work. However if I do it next
val coreConfig = CoreConfig(
clientId = providerTokens!!.paymentAccessToken, // <<----- this is the change
environment = Environment.SANDBOX
)
val returnUrl = "${applicationContext.resources.getString(R.string.deep_link_scheme)}://paypalpay/"
val payPalNativeClient = PayPalNativeCheckoutClient(
application = applicationContext as Application,
coreConfig = coreConfig,
returnUrl = returnUrl
)
It works great for me.
As you can see, I pass the token instead of the client id.
Expected behavior
SDK works fine with API it is provided.
Screenshots
No response
@emartynov thanks for filing this issue. Can you share the error message provided by the SDK when it fails with client ID?
It is the same as in the case of #152
@emartynov is this resolved?
@sshropshire was something changed in this regard?
Hello @sshropshire
I'm experiencing the same issue. This is the output that I get https://gist.github.com/fobos531/3d3c53cb9cc1a0e601972a7d760790bb
I'm using the Client ID as per the official documentation
I can confirm that the workaround provided by @emartynov works (using the access token)
@fobos531 are you using the latest 1.0.0 version?
@fobos531 are you using the latest
1.0.0version?
Yes. Same on 1.0.1-SNAPSHOT
Quite unmotivating, the question asked about the latest version usage with no fix/changes in it.