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

promptpay.qrcode.to_file(payload: str = '', filepath: str = '') None[source]
Parameters
  • payload – PromptPay Payload

  • filepath – Target destination file path

Returns

promptpay.qrcode.to_image(payload: str = '') <module 'PIL.Image' from '/home/docs/checkouts/readthedocs.org/user_builds/promptpay/envs/latest/lib/python3.7/site-packages/PIL/Image.py'>[source]

todo complete docblockr

Parameters

payload – PromptPay Payload

Returns

Module contents