Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To work with Assist.Mobile, you need to use Android SDK version 15 26or higher (Android 4 8.0 .3Oreo).

Description of SDK Assist.Mobile

...

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.

...

Google Pay support

To work with Android Google 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.

...

3.1. First you need to make sure that the minimum SDK version is 15 26 or higher. There should be an element tag like this inside the <manifest> elementtag:

Code Block
languageactionscript3
        <uses-sdk android:minSdkVersion="1526"/>

3.2. The following permissions must also be present inside the <manifest> elementtag:

Code Block
languageactionscript3
             <uses-permission android:name="android.permission.INTERNET" />
             <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />        
             <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
             <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
             <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
 
             <uses-permission android:name="android.permission.CAMERA" />
             <uses-permission android:name="android.permission.VIBRATE" />

             <uses-feature android:name="android.hardware.camera" android:required="false" />
             <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
             <uses-feature android:name="android.hardware.camera.flash" android:required="false" />    

3.3. Add an activity to the <application> elementtag:

Code Block
languageactionscript3
             <activity
                 android:name="ru.assisttech.sdk.processor.WebViewActivity"
                 android:configChanges="keyboardHidden|orientation|screenSize">
             </activity>
             <activity
                 android:name="io.card.payment.CardIOActivity"
                 android:configChanges="keyboardHidden|orientation" />
             <activity android:name="io.card.payment.DataEntryActivity" />

...

Code Block
languageactionscript3
package ru.assisttech.example;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import ru.assisttech.sdk.AssistSDK;
import ru.assisttech.sdk.AssistPaymentData;
import ru.assisttech.sdk.engine.AssistPayEngine;
import ru.assisttech.sdk.engine.PayEngineListener;
import ru.assisttech.sdk.storage.AssistTransaction;
public class
MainActivity extends
Activity implements
PayEngineListener { 
    private TextView tvPaymentResult;
    private AssistPayEngine
engine;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        tvPaymentResult = (TextView) findViewById(R.id.textView);
        // Getting a payment component from the library
        engine= AssistSDK.getPayEngine(this);
        // Setting the server address
        engine.setServerURL("server url");
        // Setting the recipientlistener of the result
        engine.setEngineListener(this);

        findViewById(R.id.btPay).setOnClickListener(new View.OnClickListener(){

            @Override
            public void onClick(View v) {
                // Setting payment options
                AssistPaymentData data = new AssistPaymentData();
                // Merchant ID in IPS Assist
                data.setMerchantId("12345");
                // Order number
                data.setOrderNumber("OrderNo");
                // Amount
                data.setOrderAmount("100"); // 100 рубRUB
                // Currency
                data.setOrderCurrency(AssistPaymentData.Currency.RUB);
                // Comment
                data.setOrderComment("ТестовыйTest платежpayment");
                // BuyerPayer's e-mail 
                data.setEmail("customer@mail.com");
                // BuyerPayer's postal address
                data.setAddress("Москва, Ленинградское ш. 39");
                // Home phone
                data.setHomePhone("567-99-29");
                // Work phone
                data.setWorkPhone("555-00-00");
                // Mobile phone
                data.setMobilePhone("+79067410863");
                // Fax
                data.setFax("");
                // Lastname
                data.setLastname("Романов");
                // First name
                data.setFirstname("Пётр");
                // Middle name
                data.setMiddlename("Алексеевич");
                // BuyerPayer country
                data.setCountry("Russia");
                // Region (state)
                data.setState("Moscow");
                // City
                data.setCity("Moscow");
                // Postal code
                data.setZip("100290");
                // Language
                data.setLanguage(AssistPaymentData.Lang.RU);
                // Payment parameters signature calculation...
                String signature = "stub_signature";
                // Signature setting
                data.setSignature(signature);
                // Starting the payment process
                engine.payWeb(MainActivity.this, data, false);
            }
        });
    }
    /**
     * PayEngineListener callbacks
     */
    @Override
    public void onFinished(Activity activity, AssistTransaction assistTransaction) {
        if (!this.equals(activity)) {
            activity.finish();
        }
        tvPaymentResult.setText(assistTransaction.getResult().getOrderState().toText());
    }

    @Override
    public void onCanceled(Activity activity, AssistTransaction assistTransaction) {
        if (!this.equals(activity)) {
            activity.finish();
        }
        tvPaymentResult.setText(assistTransaction.getResult().getOrderState().toText());

    }

    @Override
    public void onFailure(Activity activity, String info) {
        tvPaymentResult.setText("Error: " + info);
    }

    @Override
    public void onNetworkError(Activity activity, String s) {
        tvPaymentResult.setText("Network error: " + s);
    }
 }

The SDK and the sample app sample are available for download at the following link:

...