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:
void setMerchantId(String value) – the method allows you to set the identifier of the store, specifying the identifier of the store is mandatory;
void setOrderNumber(String value) – the method allows you to set the order number, specifying the order number is mandatory;
void setOrderAmount(String value) - the method allows you to set the order amount (the string value of the amount in kopecks is used), setting the order amount is mandatory;
void setOrderCurrency(Currency value) - the method allows you to set the currency of the order;
void setOrderComment(String value) - the method allows you to set a comment - a description of the payment;
void setEmail(String value) - the method allows you to set the payer's e-mail address;
void setAddress(String value) - the method allows you to set the payer's postal address;
void setHomePhone(String value) - the method allows you to set the payer's home phone number;
void setWorkPhone(String value) - the method allows you to set the payer's work phone number;
void setMobilePhone(String value) - the method allows you to set the mobile phone number of the payer;
void setFax(String value) - the method allows you to set the fax number of the payer;
void setLastname(String value) - the method allows you to set the last name of the payer;
void setFirstname(String value) - the method allows to set the first name of the payer;
void setMiddlename(String value) - the method allows you to set the middle name of the payer;
void setCountry(String value) - the method allows you to set the country of the payer;
void setState(String value) - the method allows you to set the state (region);
void setCity(String value) - the method allows you to set the city;
void setZip(String value) - the method allows you to set the postal code;