Performing a Pre Authorization

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

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

1. Show the card entry form

Create an Intent for the PreAuthActivity with the required Intent extras:

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

startActivityForResult(intent, PRE_AUTH_REQUEST);

Note: Please make sure that you are using a unique Consumer Reference for each different consumer.

2. Check the Pre-authorization result

In your calling Activity, override the onActivityResult method to receive a receipt from the Pre-authorization:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if(requestCode == PRE_AUTH_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.