Paymentwall website uses cookies to store your browsing preferences on your device. However, cookies do not collect personal information.

For more information about how we use cookies, check our cookie policy

Close

Documentation

New Documentation Getting Started API Libraries APIs Checklists Flows Integrations Mobile SDKs Reference Smart TV SDK SpiderPipe Testing Payments
Contacts
If you still have questions regarding integration, please email us at devsupport@paymentwall.com

MINT Android SDK

Attachments

Do you need a simple and safe method to receive in-app payments? MINT is Paymentwall's cash payment solution designed to help monetize your digital goods and services all over the world.

Our MINT Android SDK delivers a way to minimize development time and help accept MINT ePins in your application in several simple steps. Follow our instructions and start accepting MINT today!

How does it work?

The customer clicks on the “Buy” button inside your application. The MINT SDK is called at this moment and displays a pop up dialog with the payment information and field for entering the ePin. User enters ePin into the field and taps on the “Buy” button. The payment is completed and your callback function is triggered to handle its result. Your backend will be also notified about it.

Requirements

Android 2.2 (API Level 8) and above

Credentials

Your mobile integration requires a Project key.
You can obtain these Paymentwall API credentials in the application settings of your Merchant Account at paymentwall.com

Add SDK to your project

Our SDK is delivered as a JAR package so just drop it into your project. It also requires android-support-v4.jar, if your project doesn’t have it, please add one.

Modify your AndroidManifest.xml

Add required permission

<uses-permission android:name="android.permission.INTERNET"/>

Add Mint activty

<activity
    android:name="com.paymentwall.sdk.mint.ui.MintActivity"
    android:windowSoftInputMode="stateVisible|adjustResize|adjustPan"
    android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
    android:theme="@android:style/Theme.Translucent" >
</activity>

Accepting your first payment

Add the following imports

import com.paymentwall.sdk.mint.message.MintRequest;
import com.paymentwall.sdk.mint.message.MintResponse;
import com.paymentwall.sdk.mint.ui.MintActivity;
import com.paymentwall.sdk.mint.utils.Key;
import com.paymentwall.sdk.mint.utils.PaymentMethod;
import com.paymentwall.sdk.mint.utils.ResponseCode;

Create MINT request

MintRequest request = new MintRequest();
request.setAmount(PAYMENT_AMOUNT);
request.setCurrency(PAYMENT_CURRENCY);
// Optional, max 1 ePin per request
request.addEPin(EPIN);
request.setUserId(USER_ID);
request.setAppKey(APPLICATION_KEY);
request.setName(PAYMENT_NAME);

Start MINT dialog

Intent intent = new Intent(getApplicationContext(), MintActivity.class);
intent.putExtra(Key.PAYMENT_TYPE, PaymentMethod.MINT);
intent.putExtra(Key.REQUEST_MESSAGE, request);
startActivityForResult(intent, MintActivity.REQUEST_CODE);

Result handling

You can handle payment results by defining your callback function. We recommend syncing up with your server at this stage to sync up user's balance, confirm purchased item etc. See the example:

if (requestCode == MintActivity.REQUEST_CODE) {
    // Failed to start Mint payment, due to invalid request
    // In some specified cases, the SDK will also return an extra error message
    if (data != null && data.hasExtra(Key.SDK_ERROR_MESSAGE)) {
        String debug = data.getStringExtra(Key.SDK_ERROR_MESSAGE);
    }

    // if there is a response from Paymentwall system, a MintResponse object will be returned
    if (data !=null && data.hasExtra(Key.RESPONSE_MESSAGE)) {
        MintResponse mintResponse = (MintResponse) data.getSerializableExtra(Key.RESPONSE_MESSAGE);
    }

    switch (resultCode) {
        case ResponseCode.ERROR:
            // Failed to start Mint payment, due to invalid request
            break;
        case ResponseCode.CANCEL:
            // User cancelled the payment
            break;
        case ResponseCode.SUCCESSFUL:
            // The payment was successful
            break;
        case ResponseCode.FAILED:
            // The payment was failed
            break;

        default:
            break;
    }
}

ResultCode code can get one of the following values:

RESPONSE_CODE.SUCCESSFUL: the user has completed the payment.

RESPONSE_CODE.FAILED: the user cannot complete the payment (he has entered at least one ePin but it was rejected by our system)

RESPONSE_CODE.CANCEL: the user has aborted the payment.

RESPONSE_CODE.ERROR: the payment cannot be made due to Network error/Invalid supplying request

Server notification handling

After each successful payment we will notify your server about it. We recommend to use this feature as it is the most reliable way to know when the payment went through. Even if your application crashes for some reason, your server will still be notified, so you can sync up later. Please use pingback processing documentation pingback processing documentation for more information.

This page needs JavaScript
Your browser is
not supported anymore.
Please update to the more recent one.
This page needs JavaScript
This page needs JavaScript.
Please enable it in your browser settings and try again.
We use cookies on this website to make your browsing experience better. By using the Paymentwall website you agree to our Cookies Policy.