thai_promptpay 0.3.0
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
SlipDatatype and never produced as aPromptPayQrPayload):decodeSlip(String)/tryDecodeSlip(String)→ sealedSlipData(BankSlip|TrueMoneySlip), with CRC-16/CCITT-FALSE verification.BankSlipexposes the 3-digit BOTsendingBankCode, thetransRef, thecountryCode(TH) and the resolvedbank(ThaiBank?,nullfor an unknown code — never throws).TrueMoneySlipexposeseventType,transactionIdanddate(DDMMYYYY).- Bank-slip CRC is compared case-insensitively; TrueMoney CRC is case-sensitive (lowercase).
- Add a BOT bank-code table —
ThaiBank+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/tryDecodeBillPayment→BillPaymentPayload; a tag-62 additional-data block (Ref3 etc.) is tolerated and ignored.decodeAnydecodes either kind and returns the sealedPromptPayQrPayloadunion (PromptPayPayload|BillPaymentPayload).decodePromptPaystays 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.