Pre-Authorization with a Stored Card

You can perform a pre-authorization using a previously stored card token. This will lock the specified amount on the customer's card without capturing it immediately. The funds remain on hold until the transaction is either completed or cancelled.

Start a Pre-Authorization with a Stored Card

To initiate a pre-authorization using a saved card token, launch the PreAuthorizationActivity with the necessary intent extras:

public void onPreAuthSBtnClick(View view) {
...
  Intent intent = new Intent(this, PreAuthorizationActivity.class);
  intent.putExtra(MyPos.INTENT_EXTRA_AMOUNT   , amount);
  intent.putExtra(MyPos.INTENT_EXTRA_ORDER_ID , "12345678");
  intent.putExtra(MyPos.INTENT_EXTRA_CARD_TOKEN,      cardToken);
  startActivityForResult(intent, MyPos.REQUEST_CODE_PRE_AUTHORIZATION);
...
}

Always use a unique Order ID per transaction to maintain accurate tracking and avoid conflicts.

Handle the Pre-Authorization Result

After attempting the pre-authorization, you can capture the result using the onActivityResult() method in your activity:

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

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

What’s Next?

Once the pre-authorization is successful, you have two options:

  • Complete it to capture the funds
  • Cancel it to release the hold on the customer’s funds

These follow-up actions are typically handled through additional SDK methods or API endpoints.