promptpay package
Submodules
promptpay.qrcode module
- promptpay.qrcode.checksum(target: str = '') str[source]
todo complete docblockr
- Parameters
target –
- Returns
- promptpay.qrcode.format(id: str = '', value: str = '') str[source]
todo complete docblockr
- Parameters
id –
value –
- Returns
- promptpay.qrcode.format_amount(amount: float = 0.0) str[source]
Convert to number with 2 decimal (string type) e.g.
- 10.23 => “10.23”- 10 => “10.00”- 1337.1337 => “1337.13”- 1337.1387 => “1337.14”- Parameters
amount –
- Returns
- promptpay.qrcode.format_target(target: str = '') str[source]
todo complete docblockr
- Parameters
target –
- Returns
- promptpay.qrcode.generate_payload(id: str = '', amount: float = 0.0) str[source]
Generate payload for generate PromptPay QR code
- Parameters
id – PromptPay id e.g. national ID, phone number, eWallet, etc.
amount – number
- Returns
- promptpay.qrcode.print_tty(payload: str = '') None[source]
Output the QR Code only using TTY colors.
- Parameters
payload – PromptPay Payload
- Returns
- promptpay.qrcode.sanitize_target(target: str = '') str[source]
Format target, allow only numeric character e.g.
- “012345678901234” => “012345678901234”- “080-123-4567” => “0801234567”- “1-1111-11111-11-1” => “1111111111111”- “+66-89-123-4567” => “66891234567”- Parameters
target –
- Returns