Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Ksher payment SDK for Python.
📄 Documentation: API Reference
Ksher SDK is available in multiple languages:
There are two ways to install this package:
pip install ksher
git clone https://github.com/ksher-solutions/ksher_sdk_python.git
cd ksher_sdk_python
pip install -r requirements.txt
pip install .
Alternatively, install locally with:
pip install ./ksher_sdk_python --user
First, initialize the payment object to perform various payment actions:
To use the Redirect API, initialize as follows:
from ksher.ksher_pay_sdk import KsherPay
appid = "mch35000"
privatekey = "/path/to/mch_privkey.pem"
pubkey = "/path/to/ksher_pubkey.pem"
payment_handle = KsherPay(appid, privatekey, pubkey)
data = {
"total_fee": "100",
"fee_type": "THB",
"mch_code": "",
"refer_url": "http://www.example.com",
"mch_redirect_url": "http://www.example.com/success",
"mch_redirect_url_fail": "http://www.example.com/fail",
"mch_notify_url": "http://www.example.com/notify",
"product_name": "",
"channel_list": "promptpay,linepay,airpay,truemoney,atome,card,ktc_instal,kbank_instal,kcc_instal,kfc_instal,scb_easy,bbl_deeplink,baybank_deeplink,kplus,alipay,wechat,card,ktc_instal,kbank_instal,kcc_instal,kfc_instal"
}
data['mch_order_no'] = "HelloWebsite"
resp = payment_handle.gateway_pay(data)
To use the C_Scan_B API, specify the API type when initializing:
from ksher.ksher_pay_sdk import KsherPay
appid = "mch35000"
privatekey = "/path/to/mch_privkey.pem"
pubkey = "/path/to/ksher_pubkey.pem"
payment_handle = KsherPay(appid, privatekey, pubkey)
data = {
"mch_order_no": "202208101150",
"total_fee": "100",
"fee_type": "THB",
"channel": "promptpay",
"notify_url": "http://www.example.com/notify"
}
data['mch_order_no'] = "HelloKiosk"
resp = payment_handle.native_pay(data)
appid
, privatekey
, and pubkey
are correctly set.pubkey
inside SDK, The file name is ksher_pubkey.pem
. This value is optional, you not need to pass with it.channel_list
based on your integration.📖 For full documentation, visit Ksher API Docs.
FAQs
python implementation for Khser Payment API.
We found that ksher demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.