---
title: "Banking primitives — QR for Laravel | Roundly"
description: "IBAN, BIC and ISO 11649 creditor-reference value objects — parse, validate, format and generate check digits."
url: https://roundly-consulting.com/open-source/docs/qr-for-laravel/banking
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[QR for Laravel](https://roundly-consulting.com/open-source/docs/qr-for-laravel.md)

# Banking primitives

The banking value objects are framework-free and usable on their own — in payment payloads, forms or your own models:

```php
use RoundlyConsulting\Qr\Banking\{Bic, CreditorReference, Iban};

$iban = Iban::fromString('SK46 1100 0000 0029 4714 7960');
$iban->formatted();        // "SK46 1100 0000 0029 4714 7960"
$iban->electronic();       // "SK4611000000002947147960"
$iban->isEea();            // true
Iban::isValid('DE00 1234');  // false (no exception)

Bic::fromString('TATRSKBX')->country();           // "SK"
CreditorReference::generate('539007547034');       // RF18539007547034
CreditorReference::fromString('RF18 5390 0754 7034')->electronic();
```

- Iban — fromString() strips spaces, NBSP and dashes and upper-cases; plus isValid(), country(), checkDigits(), bban(), electronic(), formatted(), isEea(), equals().
- Bic — fromString(), isValid(), institution(), country(), location(), branch(), isTestCode(), value().
- CreditorReference — fromString(), generate($reference), isValid(), electronic(), formatted().

IBAN validation runs structure → known country → exact length → BBAN structure → check digits 02–98 and MOD 97-10, against the 89 country entries of SWIFT IBAN Registry release 103. Check digits 00, 01 and 99 pass MOD 97-10, but the standard’s generation rule only produces 02–98, so an IBAN or RF reference carrying them fails with iban\_checksum or creditor\_reference\_checksum — in the validation rules, the AsIban cast and the payment payloads too. Failures throw InvalidIbanException, InvalidBicException or InvalidCreditorReferenceException with a precise reason (iban\_checksum, bic\_country, creditor\_reference\_format, …).

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/qr-for-laravel.md)
