@Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (resultCode == RESULT_OK) {
      if (requestCode == ANDROID_PAY_MASKED_WALLET_REQUEST_CODE) {
        String googleTransactionId =
            ((MaskedWallet) data.getParcelableExtra(WalletConstants.EXTRA_MASKED_WALLET))
                .getGoogleTransactionId();
        FullWalletRequest fullWalletRequest =
            FullWalletRequest.newBuilder()
                .setGoogleTransactionId(googleTransactionId)
                .setCart(mCart)
                .build();

        Wallet.Payments.loadFullWallet(
            mGoogleApiClient, fullWalletRequest, ANDROID_PAY_FULL_WALLET_REQUEST_CODE);
      } else if (requestCode == ANDROID_PAY_FULL_WALLET_REQUEST_CODE) {
        AndroidPay.tokenize(
            mBraintreeFragment,
            (FullWallet) data.getParcelableExtra(WalletConstants.EXTRA_FULL_WALLET));
      }
    } else if (resultCode == RESULT_CANCELED) {
      onCancel(requestCode);
    } else {
      int errorCode = -1;
      if (data != null) {
        errorCode = data.getIntExtra(WalletConstants.EXTRA_ERROR_CODE, -1);
      }

      onError(
          new Exception(
              "Request Code: "
                  + requestCode
                  + " Result Code: "
                  + resultCode
                  + " Error Code: "
                  + errorCode));
    }
  }