Android MEO Wallet SDK

Adding the SDK to your app

Import the provided JAR to the folder libs on your Android project

Pre Conditions

Server side

Your application should rely on the server side to create the desired Checkout. Take note of the scheme used on url_confirm and url_cancel since you will need it later.

Changing your app Manifest

Register your scheme callback on the appropriate activity with an intent filter. Example:

intent-filter.xml

  <intent-filter>
    <action android:name="android.intent.action.VIEW"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>
    <data android:scheme="YOUR SCHEME"/> //replace "YOUR SCHEME"
  </intent-filter>

Add the following activity:

activity.xml

  <activity
    android:name="pt.sapo.android.paysdk.light.PTPayActivity"
    android:label="PTPayActivity" />

Usage

Create the suitable Checkout, specifying your app scheme, and take note the checkout id and url_redirect returned by our servers when answering your checkout creation. Then, start the sdk:

skd-init.java

1
2
3
4
  Intent intent = new Intent(getApplicationContext(), PTPayActivity.class);
  intent.putExtra(PTPayActivity.PAY_INTENT_CHECKOUT_ID, id);
  intent.putExtra(PTPayActivity.PAY_INTENT_BROWSER_CHECKOUT_URI, url_redirect);
  startActivity(intent);

Finally, after the user pays, he will be redirected to your app using the url_confirm or url_cancel defined when the checkout was created.