Post

Replies

Boosts

Views

Activity

Comment on An alternative Swift method to PHP `pack()` method
@OOPer I tested your code by passing the following values and compared the results with the PHP lib and found they are different except the first part in the result base64 encoded string `use Salla\ZATCA\GenerateQrCode; use Salla\ZATCA\Tags\InvoiceDate; use Salla\ZATCA\Tags\InvoiceTaxAmount; use Salla\ZATCA\Tags\InvoiceTotalAmount; use Salla\ZATCA\Tags\Seller; use Salla\ZATCA\Tags\TaxNumber; $generatedString = GenerateQrCode::fromArray([ new Seller('Salla'), // seller name new TaxNumber('1234567891'), // seller tax number new InvoiceDate('2021-07-12T14:25:09Z'), // invoice date as Zulu ISO8601 @see https://en.wikipedia.org/wiki/ISO_8601 new InvoiceTotalAmount('100.00'), // invoice total amount new InvoiceTaxAmount('15.00') // invoice tax amount // TODO :: Support others tags ])->toBase64(); // > Output // AQVTYWxsYQIKMTIzNDU2Nzg5MQMUMjAyMS0wNy0xMlQxNDoyNTowOVoEBjEwMC4wMAUFMTUuMDA=`
Nov ’21