@Override
  public void onError(com.wepay.android.models.Error error) {
    final AppCompatActivity self = this;

    statusTextView.setText(getString(R.string.title_status_swipe));

    if (error.getErrorCode() == ErrorCode.CARD_READER_TIME_OUT_ERROR.getCode()) {
      AppNotifier.showErrorWithItem(
          this,
          getString(R.string.error_swiper_title),
          getString(R.string.error_swiper_preface),
          error.getLocalizedMessage(),
          getString(R.string.error_title_retry),
          new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
              switch (which) {
                case DialogInterface.BUTTON_POSITIVE:
                  {
                    // Selected the retry button
                    PaymentManager.startCardSwipeTokenization(
                        self, (CardReaderHandler) self, (TokenizationHandler) self);
                    break;
                  }
                case DialogInterface.BUTTON_NEGATIVE:
                  {
                    // Selected the cancel button
                    finish();
                    break;
                  }
                default:
                  {
                    break;
                  }
              }
            }
          });
    } else {
      AppNotifier.showSimpleError(
          self,
          getString(R.string.error_swiper_title),
          getString(R.string.error_swiper_preface),
          error.getLocalizedMessage());
    }

    statusTextView.setText(getString(R.string.message_user_try_again));
  }
  @Override
  public void onError(PaymentInfo paymentInfo, Error error) {
    AppNotifier.dismissIndeterminateProgress();

    AppNotifier.showSimpleError(
        this,
        getString(R.string.message_failure_tokenization),
        getString(R.string.error_tokenization_preface),
        error.getLocalizedMessage());

    statusTextView.setText(getString(R.string.message_user_try_again));
  }