Registering a Card

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

Check that you have initialized the SDK before attempting to register a card.

1. Show the card entry form

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

Intent intent = new Intent(context, RegisterCardActivity.class);
intent.putExtra(Judo.JUDO_OPTIONS, judo);

startActivityForResult(intent, REGISTER_CARD_REQUEST);

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

2. Check the Register Card result

In your calling Activity, override the onActivityResult method to receive a receipt from Registering the Card:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if(requestCode == REGISTER_CARD_REQUEST) {
        switch (resultCode) {
            case JudoPay.RESULT_SUCCESS:
                Receipt receipt = data.getParcelableExtra(JudoPay.JUDO_RECEIPT);
                // save the receipt for performing future token payment
            }
    }
}
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.