npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kittipan/promptpay-qr

v0.1.0

Published

Library to generate PromptPay payload and CLI script to generate QR code

Downloads

152

Readme

promptpay-qr npm version

Mobile web app, command line app, and JavaScript library to generate QR Code payload for PromptPay.

#clone from https://www.npmjs.com/package/promptpay-qr

Introduction

The Bank of Thailand introduced a PromptPay QRCode Standard that works with most mobile banking apps in Thailand.

By generating a QR code, users of mobile banking apps can scan your QR code, and transfer money to your PromptPay account instantly.

In this repository:

What’s in a QR code

⚠️ Read this section to understand privacy implications of using PromptPay QR code ⚠️

  • The PromptPay QR code is based on EMV QRCPS Merchant Presented Mode specification.

  • The QR code contains the PromptPay ID. This means anyone who sees the QR code can find out your PromptPay ID (Phone number, National ID number, e-Wallet ID). Please treat the QR code like your personal information.

  • The QR code can optionally contain the transfer amount. Mobile banking apps use this number to pre-fill the amount for convenience.

Mobile web app

You can quickly receive money from your home screen.

For example, if you want to collect 80 Baht from each friend, you can open the app, type in 80, and show the QR code. It takes less than 5 seconds.

To use it:

  1. Open Chrome (on Android) or Safari (iOS).

  2. Go to https://promptpay2.me/.

  3. Set your PromptPay ID.

  4. “Add to Home Screen.”

Features:

  • The app remembers your PromptPay ID, so you don’t have to enter the information each time.

  • It is a Progressive Web App, so you can add to home screen and it will work offline (Android).

  • No personal data is sent to any server. Your PromptPay ID stays in your phone/computer.

CLI

You can receive money from your terminal.

Install Node.js and run this command to install promptpay-qr in your machine:

npm install -g promptpay-qr

Run this command to generate a QR code:

promptpay-qr 081-xxx-xxxx
promptpay-qr 1-xxxx-xxxxx-xx-x --amount 4.22

Then QR code will be printed in the terminal.

API

generatePayload(idOrPhoneNo, { amount })

Returns a string which should be rendered as a QR code.

API reference

https://apiref.page/package/promptpay-qr

API reference screenshot

References

  • https://www.blognone.com/node/95133
  • https://www.emvco.com/emv-technologies/qrcodes/

Implementation in other languages

These libraries are written by other developers:

Integrations with other software

These plugins/integrations are written by other developers:

License

The MIT License

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.