flask_midtrans is a package for integrate midtrans to flask framework
Project description
Flask Midtrans
How to use:
from flask_midtrans import Midtrans
from flask import Flask
# set environments
app = Flask(__name__)
app.config['MIDTRANS_IS_PRODUCTION'] = False
app.config['MIDTRANS_SERVER_KEY'] = 'SB-Mid-server-fRTQ4YyV5mVXB'
app.config['MIDTRANS_CLIENT_KEY'] = 'SB-Mid-client-hdv0voYgqK'
# instance
midtrans = Midtrans(app)
@app.route('/')
def hello_world():
param = {
"transaction_details": {
"order_id": "test-transaction-123",
"gross_amount": 200000
}, "credit_card": {
"secure": True
}
}
# midtrans.snap or midtrans.core
# https://github.com/Midtrans/midtrans-python-client
response = midtrans.snap.create_transaction(param)
# >> response
# {'token': 'thistoken', 'redirect_url': 'http://midtrans..'}
return response['token']
Contributes:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file flask_midtrans-0.0.1a0.tar.gz
.
File metadata
- Download URL: flask_midtrans-0.0.1a0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 097f968f3634958ac800682d726d3363b8cba43d92af334b0f4e9bfdb600b032 |
|
MD5 | 6c8b3d8fee36513f37f7a886be081a8b |
|
BLAKE2b-256 | 2e28cb6f2b4f11bdf81d73d0a18feab937976e5baa303083d3c08eb9a493f3ae |
File details
Details for the file flask_midtrans-0.0.1a0-py3-none-any.whl
.
File metadata
- Download URL: flask_midtrans-0.0.1a0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 919dec57ed7bc26a3e524d282c07bcd1fcd063e73818ff889bc0f7093cb01ff5 |
|
MD5 | 2c43cac5812ad64d248793479209c8e9 |
|
BLAKE2b-256 | 5014a4307a446784f4b3df86992b4aba26979ee25b1c106c66dbfab7fc85ecc5 |