Pre-Authorization Completion
Use Pre-authorization completion to capture the funds previously locked during a pre-authorization. This finalizes the transaction and moves the funds from the customer’s account to yours.
Complete a Pre-Authorization
To complete a pre-authorization, start the PreAuthCompleteOrCancelActivity and pass the required intent extras:
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 must use the Order ID from the original pre-authorization.
- The amount you capture cannot exceed the amount that was originally pre-authorized.
Handle the Completion Result
After attempting the completion, handle the response in onActivityResult() like this:
@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) {
...
}
}
Use Case Example
- Scenario: A hotel pre-authorizes €200 at check-in. At check-out, only €150 is needed based on services used.
- Action: You pass €150 to the completion step — and the rest (€50) is automatically released.