API reference / Quittio \ Country \ CH \ QrBill
SwissQrBillGenerator
final class in quittio/country-ch · implements ProvidesPaymentSlip
Quittio\Country\CH\QrBill\SwissQrBillGenerator · Source
The Swiss QR bill: the Swiss QR Code (Swiss Payments Code "SPC", version 0200) and its payment part with receipt, after the Swiss Implementation Guidelines QR-bill 2.3 of SIX.
- Account: the first credit transfer account (BT-84) with an IBAN of Switzerland or Liechtenstein; a QR-IBAN (institution identification 30000 to 31999) needs a QR reference.
- Reference: the remittance information (BT-83) if it is a QR reference (with a QR-IBAN) or a Creditor Reference (with an IBAN); with a QR-IBAN otherwise the QR reference of the digits of the invoice number. Without one the code has no reference (NON) and the remittance information or the invoice number as unstructured message.
- Creditor: the account holder (or the seller) with the seller's address; debtor: the buyer. Addresses are structured (type "S"): a building number at the end of the street is written as building number.
- Amount: the amount due (BT-115), in CHF or EUR.
Constants#
| Constant | Value | Description |
|---|---|---|
KEY | 'swiss-qr-bill' |
Methods#
| Method | Description |
|---|---|
::isQrIban() | Whether the IBAN is a QR-IBAN (institution identification 30000 to 31999). |
->key() | |
->payload() | |
->slip() | The payment part and receipt of the code $payload, read from the code itself, so that they show its amount and reference also for a payment reminder. |
->supports() |
isQrIban()#
public static function isQrIban(string $iban): boolWhether the IBAN is a QR-IBAN (institution identification 30000 to 31999).
| Parameter | Type | Description |
|---|---|---|
$iban | string |
- Returns
bool
key()#
public function key(): string- Returns
string
payload()#
public function payload(InvoiceData $invoice, array<string, mixed> $options = []): ?string| Parameter | Type | Description |
|---|---|---|
$invoice | InvoiceData | |
$options | array<string, mixed> = [] | "value": the amount instead of the amount due; "remittance": the remittance information instead of BT-83 |
- Returns
?string
slip()#
public function slip(InvoiceData $invoice, string $payload, string $locale): ?PaymentSlipThe payment part and receipt of the code $payload, read from the code itself, so that they show its amount and reference also for a payment reminder.
| Parameter | Type | Description |
|---|---|---|
$invoice | InvoiceData | |
$payload | string | |
$locale | string |
- Returns
?PaymentSlip
supports()#
public function supports(InvoiceData $invoice): bool| Parameter | Type | Description |
|---|---|---|
$invoice | InvoiceData |
- Returns
bool