checkoutCart->getQuote(); $customerId = (int)$this->currentCustomer->getCustomerId() ?: (int)$quote->getCustomerId(); $balance = $customerId > 0 ? (int)$this->balances->getAccount( $customerId, (int)$quote->getStore()->getWebsiteId() )['balance'] : 0; return ['esunReward' => [ 'logged_in' => $customerId > 0, 'balance' => $balance, 'applied_points' => (int)$quote->getData('reward_points_used'), 'maximum' => $this->config->maxCheckoutPoints((int)$quote->getStoreId()), 'rate' => $this->config->redemptionRate((int)$quote->getStoreId()), ]]; } }