thai_promptpay 0.3.0 copy "thai_promptpay: ^0.3.0" to clipboard
thai_promptpay: ^0.3.0 copied to clipboard

Pure-Dart PromptPay (Thai EMVCo QR) toolkit: build and parse the QR payload for mobile, National ID / Tax ID, e-Wallet and Bill Payment, with amount and CRC validation.

Changelog #

0.3.0 #

  • Add Slip Verify Mini-QR offline decoder (closes #2) — parses the small QR printed on a Thai transfer slip to verify a completed transfer (a separate concept from a payable QR; it is modelled by its own sealed SlipData type and never produced as a PromptPayQrPayload):
    • decodeSlip(String) / tryDecodeSlip(String) → sealed SlipData (BankSlip | TrueMoneySlip), with CRC-16/CCITT-FALSE verification.
    • BankSlip exposes the 3-digit BOT sendingBankCode, the transRef, the countryCode (TH) and the resolved bank (ThaiBank?, null for an unknown code — never throws).
    • TrueMoneySlip exposes eventType, transactionId and date (DDMMYYYY).
    • Bank-slip CRC is compared case-insensitively; TrueMoney CRC is case-sensitive (lowercase).
  • Add a BOT bank-code tableThaiBank + thaiBankByCode(String) lookup for 22 Thai banks.
  • Slip TLV structure + test vectors ported from maythiwat/promptparse (MIT), cross-checked with SCB's "extracting data from mini QR" doc. See NOTICE.md.
  • Non-breaking: all existing PromptPay / Bill Payment APIs are unchanged.

0.2.0 #

  • Add PromptPay Bill Payment (EMVCo tag 30) support:
    • encodeBillPayment({billerId, ref1, ref2, amountSatang}) builds the bill payment payload (biller + Ref1 / Ref2, optional amount).
    • decodeBillPayment / tryDecodeBillPaymentBillPaymentPayload; a tag-62 additional-data block (Ref3 etc.) is tolerated and ignored.
    • decodeAny decodes either kind and returns the sealed PromptPayQrPayload union (PromptPayPayload | BillPaymentPayload).
    • decodePromptPay stays personal-only and now throws a clear error on a bill-payment payload.
  • Output verified byte-for-byte against the community references (maythiwat/promptparse and mrwan2546/promptparse-go).
  • Non-breaking: the v0.1.0 personal (tag 29) API is unchanged.

0.1.0 #

  • Initial release: encode + decode PromptPay (EMVCo) QR payloads for mobile, National ID / Tax ID and e-Wallet, with amount and CRC validation. Pure Dart.
0
likes
160
points
170
downloads

Documentation

API reference

Publisher

verified publisher10v3n4m.cc

Weekly Downloads

Pure-Dart PromptPay (Thai EMVCo QR) toolkit: build and parse the QR payload for mobile, National ID / Tax ID, e-Wallet and Bill Payment, with amount and CRC validation.

Repository (GitHub)
View/report issues

Topics

#promptpay #thai #qr #payment #emvco

License

MIT (license)

Dependencies

thainum

More

Packages that depend on thai_promptpay