ข้ามไปยังเนื้อหา

All versions since 0.1.1

0.1.1

Patch Changes

  • e4af92f Thanks @uunw! - Fix QR matrix alignment-pattern placement for v2-v40. The previous alignmentCentres() lost the spec’s intermediate positions through a buggy shift()/unshift() sequence, leaving alignment patterns at the wrong coordinates (or missing entirely). Every QR at version ≥ 2 was rejected by scanners as “invalid”. v1 was unaffected because it has no alignment patterns.

    Rewrite the routine using the canonical “walk backwards from dim - 7, prepending each position until we hit floor(v/7) + 2 entries” algorithm from ISO/IEC 18004 Annex E. Adds 10 regression tests against the Annex E table.

    QR output now decodes cleanly via jsQR for every (version, ECC, mask) combination, including the 80+ character Thai QR Payment payloads at v6-H that scanners previously rejected.

  • Updated dependencies [e4af92f]:

    • @thai-qr-payment/qr@0.1.1
    • @thai-qr-payment/payload@0.1.1
    • @thai-qr-payment/assets@0.1.1

0.1.2

Patch Changes

  • f3e30b9 Thanks @uunw! - Redesign renderCard() to match the official BOT/TBA “Thai QR Payment” brand guideline:

    • Canvas 600 × 800 (3:4 aspect, kittinan-style ratio with footer room).
    • Full-width navy strip at the top (rounded top corners, flat bottom). Replaces the previous floating logo island that left gaps on either side.
    • Logo centred inside the strip at 210 × 80 with vertical padding. Uses the tight content-bbox crop (viewBox 88 75 750 210) so icon + wordmark sit tight together while the strip provides the navy breathing room.
    • PromptPay2 sub-mark (navy color variant) is now the default for theme: 'color'. PromptPay1 (monochrome) remains for theme: 'silhouette'. Both pickable via promptpayLogo: 'PromptPay1' | 'PromptPay2'.
    • PromptPay2 ships as an embedded PNG inside the SVG wrapper. Vectorising the wordmark produced jagged polygons; embedding the raster preserves font fidelity at every render size.
    • TQR Maximum Blue (#00427A) is the default accent, replacing the bad-vectorisation #0e3d67. Auxiliary navy shades + the iris #1ba997 were unified to the brand colours throughout Thai_QR_Payment_Logo-01.svg.
    • QR modules render in #000000 by default for max scanner contrast, decoupled from the accent colour. New qrColor option overrides per-render.
    • Centre-overlay Thai QR Payment icon at 16 % of the QR width, on a white pad. Active by default for theme: 'color'; opt out via centerOverlay: false.
    • Optional merchant name + amount label stacked below the QR.
    • renderThaiQrPayment() one-shot helper now defaults errorCorrectionLevel to 'H' (was 'M') because the centre overlay obscures ~3 % of the modules — H ECC recovers them cleanly.

    No API removed. CardOptions gains centerOverlay and qrColor (both optional). Callers that don’t override stay on the new defaults.

  • Updated dependencies [f3e30b9]:

    • @thai-qr-payment/payload@0.1.2
    • @thai-qr-payment/qr@0.1.2
    • @thai-qr-payment/assets@0.1.2

0.1.3

Patch Changes

  • ba9e8e8 Thanks @uunw! - Point every package homepage at the new docs site https://thai-qr-payment.js.org. Ship sourcemaps with every published bundle and keep original function + class names through minification — published code is now traceable to source and no longer trips supply-chain scanners that flag aggressive mangling.

  • Updated dependencies [ba9e8e8]:

    • @thai-qr-payment/assets@0.1.3
    • @thai-qr-payment/payload@0.1.3
    • @thai-qr-payment/qr@0.1.3

0.1.4

Patch Changes

  • 655b343 Thanks @uunw! - Sanitize numeric SVG attributes (width, height, viewBox, transform) at the renderer boundary. renderQrSvg() now coerces options.size, options.quietZone, and matrix.size through a finite-non-negative-integer guard before interpolation. Closes 7 CodeQL js/html-constructed-from-input alerts; also hardens the JS-callable surface against NaN/Infinity/non-numeric input.

1.0.0

Patch Changes

  • Updated dependencies [7ae8f9d, 5a5a62e]:
    • @thai-qr-payment/payload@1.0.0

1.1.0 Latest

Minor Changes

  • 948c126 Thanks @uunw! - Acronym rename across the public surface. Every PascalCase identifier whose leading or trailing token was a 2–4 letter acronym (Qr, Crc, Tlv, Svg, Vat, Tqrc, Bot) now renders the acronym in all-caps to match the BoT / EMVCo / ISO spec convention and the JS native style for acronym types (URL, JSON, XMLHttpRequest).

    BeforeAfter
    ThaiQrPaymentBuilderThaiQRPaymentBuilder
    ParsedCrcParsedCRC
    TlvFieldTLVField
    QrMatrixQRMatrix
    QrSvgOptionsQRSvgOptions
    VatTqrcInputVATTQRCInput
    ParsedVatTqrcParsedVATTQRC
    BotBarcodeInputBOTBarcodeInput
    ParsedBotBarcodeParsedBOTBarcode
    ThaiQrPayment (React)ThaiQRPayment
    ThaiQrPaymentMatrix (React)ThaiQRPaymentMatrix
    renderThaiQrPaymentrenderThaiQRPayment
    renderThaiQrPaymentMatrixrenderThaiQRPaymentMatrix
    renderQrSvgrenderQRSvg
    buildBotBarcodebuildBOTBarcode
    parseBotBarcodeparseBOTBarcode

    Methods on the builder (.vatTqrc(), .bankAccount(), .ota(), …) keep camelCase per TypeScript’s standard library convention. Constants (TAG_VAT_TQRC, GUID_PROMPTPAY, …) were already SCREAMING_SNAKE. To migrate, run a single regex pass on your codebase using the table above. No behaviour or wire-format changes.