Initiate a cancellation for a pre-authorization transaction.

public void onPreAuthCancelBtnClick(View view) {
...
  Intent intent = new Intent(this, PreAuthCompleteOrCancelActivity.class);
  intent.putExtra(MyPos.INTENT_EXTRA_ORDER_ID, orderId);
  intent.putExtra(MyPos.INTENT_EXTRA_IS_PRE_AUTH_CANCELLATION, true);
  startActivityForResult(intent, MyPos.REQUEST_CODE_PRE_AUTHORIZATION_CANCEL);
...
}

 

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if( resultCode == RESULT_OK  && requestCode == MyPos.REQUEST_CODE_PRE_AUTHORIZATION_CANCEL ) {
      int status = data.getIntExtra(MyPos.INTENT_EXTRA_STATUS, MyPos.STATUS_INTERNAL_API_ERROR);

      if( status == MyPos.STATUS_SUCCESS) {
        ...
      }
}