General information

SDK Assist.Mobile makes it possible to simplify the development of a mobile app of an online store for making the bank card payments with mobile devices using IPS Assist.

The users of SDK Assist.Mobile are the developers of the mobile app of the online store.

This document contains sufficient information on installing, configuring and using the Assist.Mobile SDK to use it.

System requirements

To work with Assist.Mobile, you need to use Android SDK version 15 or higher (Android 4.0.3).

Description of SDK Assist.Mobile

The Assist.Mobile SDK is a mobilePay-release-X.X.X.aar file. To access the functionality of the library, you must use the class:

ru.assisttech.sdk.AssistSDK

This class contains the following method:

AssistPayEngine AssistSDK.getPayEngine(Activity activity)

The method returns an instance of a class that implements payment functions for individuals.

After receiving the AssistPayEngine object, you need to initialize it to make a payment. To do this, you need to set the address of the server through which payment will be made by calling the method:

assistPayEngine.setServerURL(String url).

To control and receive the result of the work of AssistPayEngine, the PayEngineListener interface is used, which is installed by the method:

void assistPayEngine.setEngineListener(PayEngineListener listener).

To start the payment process, use the following method:

assistPayEngine.payWeb(Activity caller, AssistPaymentData data, boolean useCamera),

where

caller – Activity, from which the payment process is launched;

data - object, parameters and data required for making a payment;

useCamera - a flag indicating to use the mobile device's camera to read the customer's bank card number or enter the number manually.

After the successful completion of the payment, you can save the buyer's signature using the method:

void assistPayEngine.setUserSignature(long id, byte[] signature),

where

id - payment transaction ID.

Additionally, you can check the result of the payment using the method:

void assistPayEngine.getOrderResult(Activity caller, long id).

You can interrupt the payment process using the following method:

void assistPayEngine.stopPayment(Activity caller).

The ru.assisttech.sdk.AssistPaymentData class, which allows you to set payment parameters, contains the following methods:

The string is generated from order parameters with semicolon as delimiter. The following parameters are included in the string:  Merchant _ ID;OrderNumber;OrderAmount;OrderCurrency. Then the MD5 hash prepared from this string. Hash is signed by private RSA key of the merchant. Key length - 1024. Received bit sequence is a signature of the merchant. Signature is transferred as an additional parameter encoded as a string.

Storage of payment results

The payments made are stored in SQLite DB, which is accessed through the AssistTransactionStorage interface and the AssistTransactionFilter and AssistTransactionsLoader classes.

The AssistTransactionStorage class is for accessing a single transaction by ID, while the AssistTransactionsLoader is used to get a list of transactions without blocking the main application thread.

The AssistTransactionFilter class is used to filter the list of transactions received from the AssistTransactionStorage.

You can get an instance of the AssistTransactionStorage class using the method:

AssistTransactionStorage assistPayEngine.transactionStorage().

An instance of the AssistTransactionsLoader class must be created in the onCreateLoader(int id, Bundle args) method of the class that implements the LoaderManager.LoaderCallbacks<> interface.