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.
To work with Assist.Mobile, you need to use Android SDK version 15 or higher (Android 4.0.3).
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. |
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.
To work with Android Pay, it is recommended that you first read the documentation on the developer's website https://developers.google.com/android-pay/.
At the moment, work with the Google wallet is presented in the SANDBOX mode. Therefore, to determine the possibility of making a test payment, you need to contact the Assist support service support@assist.ru.
To use Samsung Pay in their app, a merchant needs to sign up with Samsung and register their app, then get the Samsung Pay SDK http://www.samsung.com/ru/apps/mobile/samsungpay/.
Next, you should create a certificate request, issue a merchant certificate in Samsung and transfer it to Assist via support@assist.ru to connect the Samsung Pay service.
In your app, you need to follow Samsung's instructions to initiate a payment with Samsung Pay. To complete the Samsung Pay payment, you need to transfer the data received from the Samsung Pay SDK to Assist using the AssistPayEngine.payToken() function.
To integrate the mobile app of the online store with SDK Assist.Mobile, you must perform the following steps:
Copy the mobilePay-release-X.X.X.aar file to the /libs directory of the app module.