sumup / sumup-android-sdk

Sample App for the SumUp Android SDK
Other
100 stars 29 forks source link

Problems: INVALID TOKEN ERROR for quotes: UKN-HSXG0, UKN-2WWBS, UKN-2FZXV #151

Closed subpat closed 3 years ago

subpat commented 3 years ago

Hello developers,

I am working on a coding task to incorporate SumUp payment option in an application. I have tried Android SDK 3.2.1 and 3.2.2. Both give me the same errors.

But, as I mentioned in the subject of this message, I receive invalid token errors. Maybe you can use the quote number (UKN-HSXG0, UKN-2WWBS, UKN-2FZXV) to see what is going on?

Anyways here are the steps that I have followed:

I had logged into the test account with the username and password that you provided. Later, I entered the required information (product name and home url) in the Consent Screen. Finally I was able to create the OAuth client credentials for the Android application, which generated among other information two important values for the client_id and client_secret.

I use this above values within the Android application to generate an access_token, taking advantage of the Client Credentials Flow as described here: https://developer.sumup.com/docs/authorization/ I think using this flow is okay since I only require to process payments without the need to manipulate other sensitive data.

Next, using the generated access_token and the affiliate key, I try to do a login without manually entering the details. But I get an "Invalid Token" error, even though the token was generated a few seconds back.

I was wondering if you could look into the problem and provide me with some suggestions. Please note, that by only using the affiliate key combined with manual login, I was able to reach the payment page. But, I want to incorporate the automatic login in the application.

Here are some LOG outputs of various experiments that you can use to check the issue:

  1. Experiment - I

2021-02-11 13:22:39.792 31281-31281/com.example.avjindersinghsekhon E/Retrofit: Successfull::onResponse 2021-02-11 13:22:39.792 31281-31281/com.example.avjindersinghsekhon E/Retrofit: Successfull::access_token 6a0073ef52d1832cc856ba869677c594880aa12bfb7cb8ba31f78e06e290 token_type::Bearer expires_in::3600 2021-02-11 13:22:39.792 31281-31281/com.example.avjindersinghsekhon E/Subhadeep: Log-in with 6a0073ef52d1832cc856ba869677c594880aa12bfb7cb8ba31f78e06e290 . . . . 2021-02-11 13:22:43.517 31281-31281/com.example.avjindersinghsekhon E/SumUp: (SourceFile:181)@main | Event rpcEventLogin - Reason: Sorry, but we've experienced an unexpected error. Please try closing the app and logging in again, or contact our Support Team (quote: UKN-HSXG0) 2021-02-11 13:22:43.540 31281-31281/com.example.avjindersinghsekhon E/Subhadeep: Activity Result requestCode 1 2021-02-11 13:22:43.540 31281-31281/com.example.avjindersinghsekhon E/Subhadeep: Activity Result resultCode 5 2021-02-11 13:22:43.540 31281-31281/com.example.avjindersinghsekhon E/Subhadeep: Result code: 5 2021-02-11 13:22:43.540 31281-31281/com.example.avjindersinghsekhon E/Subhadeep: Message: Invalid Token

  1. Experiment - II

2021-02-11 13:32:58.525 489-489/com.example.avjindersinghsekhon E/Retrofit: Successfull::onResponse 2021-02-11 13:32:58.526 489-489/com.example.avjindersinghsekhon E/Retrofit: Successfull::access_token f345410867f2b15b50db18a2713607083c670170691163c46340288880a9 token_type::Bearer expires_in::3600 2021-02-11 13:33:02.378 489-489/com.example.avjindersinghsekhon I/Surface: opservice is null false 2021-02-11 13:33:08.542 489-489/com.example.avjindersinghsekhon E/Subhadeep: Log-in with f345410867f2b15b50db18a2713607083c670170691163c46340288880a9 . . . . 2021-02-11 13:33:09.284 489-489/com.example.avjindersinghsekhon E/SumUp: (SourceFile:181)@main | Event rpcEventLogin - Reason: Sorry, but we've experienced an unexpected error. Please try closing the app and logging in again, or contact our Support Team (quote: UKN-2WWBS) 2021-02-11 13:33:09.304 489-489/com.example.avjindersinghsekhon E/Subhadeep: Activity Result requestCode 1 2021-02-11 13:33:09.304 489-489/com.example.avjindersinghsekhon E/Subhadeep: Activity Result resultCode 5 2021-02-11 13:33:09.304 489-489/com.example.avjindersinghsekhon E/Subhadeep: Result code: 5 2021-02-11 13:33:09.304 489-489/com.example.avjindersinghsekhon E/Subhadeep: Message: Invalid Token

  1. Experiment - III

2021-02-11 13:36:00.805 1889-1889/com.example.avjindersinghsekhon E/Retrofit: Successfull::onResponse 2021-02-11 13:36:00.805 1889-1889/com.example.avjindersinghsekhon E/Retrofit: Successfull::access_token 778c71c54e822d4087dcbf6a8a45b76eb8af0c1858551671d0e9db4ea752 token_type::Bearer expires_in::3600 2021-02-11 13:36:10.822 1889-1889/com.example.avjindersinghsekhon E/Subhadeep: Log-in with 778c71c54e822d4087dcbf6a8a45b76eb8af0c1858551671d0e9db4ea752 . . . . 2021-02-11 13:36:11.554 1889-1889/com.example.avjindersinghsekhon E/SumUp: (SourceFile:181)@main | Event rpcEventLogin - Reason: Sorry, but we've experienced an unexpected error. Please try closing the app and logging in again, or contact our Support Team (quote: UKN-2FZXV) 2021-02-11 13:36:11.574 1889-1889/com.example.avjindersinghsekhon E/Subhadeep: Activity Result requestCode 1 2021-02-11 13:36:11.574 1889-1889/com.example.avjindersinghsekhon E/Subhadeep: Activity Result resultCode 5 2021-02-11 13:36:11.574 1889-1889/com.example.avjindersinghsekhon E/Subhadeep: Result code: 5 2021-02-11 13:36:11.574 1889-1889/com.example.avjindersinghsekhon E/Subhadeep: Message: Invalid Token