package com.kushkipagos.android.example;

import android.os.AsyncTask;
import android.widget.TextView;

import com.kushkipagos.android.Card;
import com.kushkipagos.android.Kushki;
import com.kushkipagos.android.KushkiEnvironment;
import com.kushkipagos.android.Transaction;

import org.json.JSONException;

import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;

import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;

class ExampleAsyncTask extends AsyncTask<String, Void, Transaction> {

    private final TextView textView;

    ExampleAsyncTask(TextView textView) {
        this.textView = textView;
    }

    @Override
    protected Transaction doInBackground(String... endpoints) {
        try {
            Kushki kushki = new Kushki("", "USD", KushkiEnvironment.TESTING);
            return kushki.requestToken(new Card("", "", "", "", ""), 10.0);
        } catch (IOException | BadPaddingException | IllegalBlockSizeException | JSONException |
                NoSuchPaddingException | NoSuchAlgorithmException | InvalidKeySpecException | InvalidKeyException e) {
            e.printStackTrace();
            return null;
        }
    }

    @Override
    protected void onPostExecute(Transaction transaction) {
        try {
            if (transaction.isSuccessful()) {
                textView.setText(transaction.getToken());
            } else {
                textView.setText("ERROR: " + transaction.getCode() + " " + transaction.getText());
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }
}

@@ -926,16 +926,48 @@
 Kushki(%22
+10000001656015280078454110039965
 %22, %22USD%22
@@ -1012,63 +1012,132 @@
     
-return kushki.requestToken(new Card(%22%22, %22
+Card card = new Card(%22Lisbeth Salander%22, %224017779991118888
 %22, %22
+123
 %22, %22
+12
 %22, %22
-%22)
+21%22);%0A            return kushki.requestToken(card
 , 10

Use a valid test card in example app