Eduardokum\LaravelBoleto\Boleto\Banco\Hsbc::getAgenciaCodigoBeneficiario PHP Method

getAgenciaCodigoBeneficiario() public method

Retorna o campo Agência/Beneficiário do boleto
    public function getAgenciaCodigoBeneficiario()
    {
        $agencia = $this->getAgenciaDv() !== null ? $this->getAgencia() . '-' . $this->getAgenciaDv() : $this->getAgencia();
        if ($this->getContaDv() !== null && strlen($this->getContaDv()) == 1) {
            $conta = substr($this->getConta(), 0, -1) . '-' . substr($this->getConta(), -1) . $this->getContaDv();
        } elseif ($this->getContaDv() !== null && strlen($this->getContaDv()) == 2) {
            $conta = substr($this->getConta(), 0, -1) . '-' . substr($this->getConta(), -1) . $this->getContaDv();
        } else {
            $conta = $this->getConta();
        }
        return $agencia . ' / ' . $conta;
    }