Performing a Token Pre Authorization

Zeno Foltin edited this page Jul 21, 2018 · 8 revisions

Check that you have initialized the SDK before attempting to make a token pre-auth.

1. Show the card entry form

Create an Intent for the PreAuthActivity with the required Intent extras, using the saved receipt obtained from registering the card:

Intent intent = new Intent(this, PreAuthActivity.class);
intent.putExtra(Judo.JUDO_OPTIONS, new Judo.Builder()

startActivityForResult(intent, TOKEN_PREAUTH_REQUEST);

Note: Please make sure that the Consumer Reference used and the card token matches the ones used when the card token was originally generated.

2. Check the pre-auth result

In your calling Activity, override the onActivityResult() method to receive a receipt from the pre-auth:

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if(requestCode == TOKEN_PREAUTH_REQUEST) {
        switch (resultCode) {
            case JudoPay.RESULT_SUCCESS:
                Receipt receipt = data.getParcelableExtra(JudoPay.JUDO_RECEIPT);
                // handle successful pre-auth
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.