NewWe open-sourced 50+ Laravel packages
Custom AI apps, agents and automation — Roundly ConsultingRoundly
All packages
QR for Laravel

Banking primitives

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

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

By donating, you agree to our donation terms.

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.