src/OrangePaymentSlipData.php
public function getCompleteReferenceNumber($formatted = true, $fillZeros = true)
    {
        $referenceNumber = $this->getReferenceNumber();
        $notForPayment = $this->getNotForPayment();

        $completeReferenceNumber = $referenceNumber;
        if ($notForPayment) {
            $completeReferenceNumber = str_pad($referenceNumber, 26, 'X', STR_PAD_LEFT);
        } elseif ($this->getWithBankingCustomerId()) {
            // Get reference number and fill with zeros
            $referenceNumber = str_pad($referenceNumber, 20, '0', STR_PAD_LEFT);
            // Prepend banking customer identification code
            $completeReferenceNumber = $this->getBankingCustomerId() . $referenceNumber;
        } elseif ($fillZeros) {
            // Get reference number and fill with zeros
            $completeReferenceNumber = str_pad($referenceNumber, 26, '0', STR_PAD_LEFT);
        }

        // Add check digit
        $completeReferenceNumber = $this->appendCheckDigit($completeReferenceNumber, $notForPayment);

        if ($formatted) {
            $completeReferenceNumber = $this->breakStringIntoBlocks($completeReferenceNumber);
        }

        return $completeReferenceNumber;
    }
public function getCompleteReferenceNumber($formatted = true, $fillZeros = true)
    {
        $referenceNumber = $this->getReferenceNumber();
        $notForPayment = $this->getNotForPayment();

        $completeReferenceNumber = $referenceNumber;
        if ($notForPayment) {
            $completeReferenceNumber = str_pad($referenceNumber, 26, 'X', STR_PAD_LEFT);
        } elseif ($this->getWithBankingCustomerId()) {
            // Get reference number and fill with zeros
            $referenceNumber = str_pad($referenceNumber, 20, '0', STR_PAD_LEFT);
            // Prepend banking customer identification code
            $completeReferenceNumber = $this->getBankingCustomerId() . $referenceNumber;
        } elseif ($fillZeros) {
            // Get reference number and fill with zeros
            $completeReferenceNumber = str_pad($referenceNumber, 26, '0', STR_PAD_LEFT);
        }

        // Add check digit
        $completeReferenceNumber = $this->appendCheckDigit($completeReferenceNumber, $notForPayment);

        if ($formatted) {
            $completeReferenceNumber = $this->breakStringIntoBlocks($completeReferenceNumber);
        }

        return $completeReferenceNumber;
    }
public function getCompleteReferenceNumber ( $ formatted = true , $ fillZeros = true ) { $ referenceNumber = $ this -> getReferenceNumber ( ) ; $ notForPayment = $ this -> getNotForPayment ( ) ; $ completeReferenceNumber = $ referenceNumber ; if ( $ notForPayment ) { $ completeReferenceNumber = str_pad ( $ referenceNumber , 26 , 'X' , STR_PAD_LEFT ) ; } elseif ( $ this -> getWithBankingCustomerId ( ) ) { // Get reference number and fill with zeros $ referenceNumber = str_pad ( $ referenceNumber , 20 , '0' , STR_PAD_LEFT ) ; // Prepend banking customer identification code $ completeReferenceNumber = $ this -> getBankingCustomerId ( ) . $ referenceNumber ; } elseif ( $ fillZeros ) { // Get reference number and fill with zeros $ completeReferenceNumber = str_pad ( $ referenceNumber , 26 , '0' , STR_PAD_LEFT ) ; } // Add check digit $ completeReferenceNumber = $ this -> appendCheckDigit ( $ completeReferenceNumber , $ notForPayment ) ; if ( $ formatted ) { $ completeReferenceNumber = $ this -> breakStringIntoBlocks ( $ completeReferenceNumber ) ; } return $ completeReferenceNumber ; }
Get complete reference number

@param bool $formatted Should the returned reference be formatted in blocks of five (for better readability).
@param bool $fillZeros Fill up with leading zeros, only applies to the case where no banking customer ID is used.
@return string The complete (with/without bank customer ID), formatted reference number with check digit
Get complete reference number