sumup / sumup-android-sdk

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

How to use it with different activities - login/logout on activity A, payment on activity B? #135

Closed xaxadev closed 3 years ago

xaxadev commented 3 years ago

Hello

How to use it with different activities?

We have a SettingsActivity with SumUp login- and logout-buttons. And that's the activity that will be used by the SumUp library to initialize and login. (So the first steps they are required)

But: The payment process will be initialized on a completly other activity Main3Activity - and there is the issue: If the program is on Main3Activity, the SettingsActivity was "killed"...

The SumUp Android lib is NOT open-source and not well documented - so i can't customize it...

Thank you very much for your feedback.

With best regards, Jan

vladaman commented 3 years ago

You first proceed with Authentication (in your Settings activity) and then once authenticated the SumUp library stores credentials (auth tokens). Later in any other activity you call intent to open SumUp payment. You no longer need to proceed with authentication. This was done already.

We found SumUp library well documented and the integration was a breeze. I understand why library is not Open source. It's payment related and compliance and quality is important

1. Initialize

SumUpState.init(this);

2. Authenticate user

SumUpLogin sumupLogin = SumUpLogin.builder(mAffiliateKey).build();
SumUpAPI.openLoginActivity(MainActivity.this, sumupLogin, 1);
  1. In any other activity call Intent to proceed with a payment with
    SumUpPayment payment = SumUpPayment.builder()
    ...
    SumUpAPI.checkout(MyPaymentActivity.this, payment, 2);
jayjupdhig commented 3 years ago

Thank you very much!!

"We found SumUp library well documented"

Not really i.m.o.

For example, "skipSuccessScreen" is not in the hello-world-demo-app...

But maybe there is an official documentation, e.g. "JavaDoc". If yes, can you give me the link please?

jayjupdhig commented 3 years ago

Hmmm...? ;-)