Make a Pre-authorization completion. This will take the funds from the client's account.
public void onPreAuthCompltBtnClick(View view) {
...
Intent intent = new Intent(this, PreAuthCompleteOrCancelActivity.class);
intent.putExtra(MyPos.INTENT_EXTRA_AMOUNT, amount);
intent.putExtra(MyPos.INTENT_EXTRA_ORDER_ID, orderId);
intent.putExtra(MyPos.INTENT_EXTRA_IS_PRE_AUTH_CANCELLATION, false);
startActivityForResult(intent, MyPos.REQUEST_CODE_PRE_AUTHORIZATION_COMPLETE);
...
}
You need to use the pre-authorization code of the original pre-authorization transaction.
For Amount, select the amount which you want to take from the client. It can not be a greater number than the Pre-authorized amount from the original transaction.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if( resultCode == RESULT_OK && requestCode == MyPos.REQUEST_CODE_PRE_AUTHORIZATION_COMPLETE ) {
int status = data.getIntExtra(MyPos.INTENT_EXTRA_STATUS, MyPos.STATUS_INTERNAL_API_ERROR);
if( status == MyPos.STATUS_SUCCESS) {
...
}
}