Golang Gin based restful api for create and confirm promptpay qr code.
- Create promptpay request, input: phone or thai id
- Confirm promptpay request, input: uuid from above response
- Can set timeout
- Docker ready
- Unit tests
- Go (should be 1.21+)
- git clone https://github.com/sompornp/promptpay
- go mod download
- Rename or copy .env.example to .env. Take a look on each config value in the file or description in later section.
- For docker run, use env.dev
- Use makefile commands to run or manage the app
- run
make run
to start the app - run
make dockerrun
to start the app in docker - run
make test
to run unit tests
Path | Method | Description |
---|---|---|
/createPromptpay | POST | Create promptpay |
/confirmPromptpay | POST | Confirm promptpay |
See postman or rest client vs code file for example requests in api_test folder.
dev.env is an example of environment file. The following are the environment variables that can be set.
TIMEOUT_IN_SECOND is required. It is the timeout for the promptpay response uuid in second.