EpcGiroCodeGenerator
in package
implements
PaymentQrGenerator
FinalYes
EPC QR code ("GiroCode") for SEPA credit transfers, guideline EPC069-12 version 002.
Created when the currency is EUR, the payment means is a credit transfer with an IBAN and the amount due is positive; never for credit notes and self-billed invoices.
Options of payload(): "amount" (due|discounted), "value" (a BigDecimal that replaces the amount, e.g. the total of a payment reminder) and "remittance" (replaces BT-83).
Table of Contents
Interfaces
- PaymentQrGenerator
- Creates the payload of a payment QR code (GiroCode, Swiss QR bill, …).
Constants
- AMOUNT_DISCOUNTED : string = 'discounted'
- AMOUNT_DUE : string = 'due'
- MAX_BYTES : int = 331
- Maximum size of the payload in bytes (EPC069-12, section 5.2).
Methods
- amount() : BigDecimal|null
- Amount due, or the amount after the first cash discount.
- discountedAmount() : BigDecimal|null
- Amount due after the given cash discount (on its base amount, or on the amount due).
- key() : string
- payload() : string|null
- Text content of the QR code, or null if no code can be created.
- supports() : bool
Constants
AMOUNT_DISCOUNTED
public
string
AMOUNT_DISCOUNTED
= 'discounted'
AMOUNT_DUE
public
string
AMOUNT_DUE
= 'due'
MAX_BYTES
Maximum size of the payload in bytes (EPC069-12, section 5.2).
public
int
MAX_BYTES
= 331
Methods
amount()
Amount due, or the amount after the first cash discount.
public
amount(InvoiceData $invoice[, bool $discounted = false ]) : BigDecimal|null
Parameters
- $invoice : InvoiceData
- $discounted : bool = false
Return values
BigDecimal|nulldiscountedAmount()
Amount due after the given cash discount (on its base amount, or on the amount due).
public
discountedAmount(InvoiceData $invoice, CashDiscount $discount) : BigDecimal|null
Parameters
- $invoice : InvoiceData
- $discount : CashDiscount
Return values
BigDecimal|nullkey()
public
key() : string
Return values
stringpayload()
Text content of the QR code, or null if no code can be created.
public
payload(InvoiceData $invoice[, array<string|int, mixed> $options = [] ]) : string|null
Parameters
- $invoice : InvoiceData
- $options : array<string|int, mixed> = []
Return values
string|nullsupports()
public
supports(InvoiceData $invoice) : bool
Parameters
- $invoice : InvoiceData