Example of checkout page using Midtrans Snap. A quick and secure way to accept payment with a beautiful user interface done for you.
This is a very simple, very minimalist example to demonstrate integrating Midtrans Snap with Flask (Python). To start:
- Install Python (v3.7.0 for example, as used by this example)
- Clone the repository
- Install flask:
pip install Flask
- Install midtrans:
pip install midtransclient
- Run the web server using:
python web.py
, orFLASK_APP=web.py flask run
,
Or replace step 3 & 4 by
pipenv install
, if you are using pipenv.
The app will run at port 5000. Visit this url on your browser: http://localhost:5000
required: Docker installed.
- First time to build & run:
docker build -t midflask . && docker run -p 5000:5000 --rm -it midflask
. - Next time just run
docker run -p 5000:5000 --rm -it midflask