Ir para o conteúdo

Data extraction


When extracting data, a copy of the terminal's database is made and sent to cloud storage to carry out an analysis of possible problems.

Parameters

Name Type Mandatory Description
callback PaymentCallBack YES Interface that will be executed for success or error notifications.

Detalhe dos parâmetros

callback

Name Type Mandatory Description
onSuccess Method for notification on success
onError Method for notification in case of error.
ErrorData.paymentsResponseCode String Yes Response code for the error that occurred. See Response Codes
ErrorData.responseMessage String Yes Descriptive message of the cause of the error.

Example


public class MyActivity extends Activity implements PaymentClient.PaymentCallback {

    private PaymentClient paymentClient;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_payment);

        paymentClient = new PaymentClientImpl();
    }

    @Override
    protected void onResume() {
        super.onResume();
        paymentClient.bind(this);
    }

    @Override
    protected void onDestroy() {
         try {
            paymentClient.unbind(this);
        } catch (Exception e) {
            Log.e(TAG, e.getMessage());
        }
        super.onDestroy();
    }

    public void doExecute(){
        ApplicationInfo appInfo = new ApplciationInfo();
        appInfo.setCredentials(new Credentials("demo-app", "TOKEN-KEY-DEMO"));
        appInfo.setSoftwareVersion("1.0.0.0");

        try {
            paymentClient.startExtraction(this);
        } catch (ClientException e) {
            Log.e(TAG, "Error while uploading data.", e);
        }
    }

    @Override
    public void onError(Object data) {
        Log.e(TAG, "Error: " + errorData.getResponseMessage());
    }

    @Override
    public void onSuccess(Object data) {
        Log.i(TAG, "Success!");
    }
}