Duitku Python SDK
Project description
Duitku Python API Client Library
Duitku API Library for Python
Supported Feature
| Feature | Function | HTTP Request | Description |
|---|---|---|---|
| Get Payment Method | duitku.payment.get_methods | POST /merchant/paymentmethod/getpaymentmethod | Get list of available payment methods |
| Craete New Invoice | duitku.invoice.create | POST /merchant/createInvoice | Create Transaction via POP API |
| Create New Transaction | duitku.transaction.create | POST /merchant/v2/inquiry | Create Transaction via V2 API |
| Get Transaction | duitku.transaction.get_status | POST /merchant/transactionStatus | Get Transaction via V2 API |
Requirements
- Python 3.5 or later
- Duitku account, register here
- API Key
Documentation
Installation
Get this library, add to your project
pip install duitku-python
Example Usage
import requests
import duitku
from http import HTTPStatus
from datetime import datetime
duitku = duitku.Duitku()
client = duitku.client
client.merchant_code = "YOUR MERCHANT CODE"
client.api_key = "YOUR API KEY"
client.environment = client.SandboxEnv
create_invoice_req = {
"paymentAmount": 10001,
"merchantOrderId": datetime.now().strfti("%Y%m%d%H%M%S"),
"productDetails": "test invoice",
"email": "test@duitku.com",
"callbackUrl": "https://duitku.com/callback",
"returnUrl": "https://duitku.com"
}
result = self.duitku.invoice.create(create_invoice_req)
print(result)
Support
If you have a feature request or spotted a bug or a techical problem, create an issue here. For other questions, please contact duitku through their live chat on your dashboard.
License
MIT license. For more information, see the LICENSE file.
Project details
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file duitku_python-0.2.5.tar.gz.
File metadata
- Download URL: duitku_python-0.2.5.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b08de9436172e1339b11755979beb3943e91fcdbd6a5be4d20d0235385a84a8
|
|
| MD5 |
2c21ec7ed3695df560c0210609230055
|
|
| BLAKE2b-256 |
6dbbb5a5e4ef35b9a7a4b5a023d31fc7a501d3629a076c58c45cfd6b0af8158e
|
File details
Details for the file duitku_python-0.2.5-py3-none-any.whl.
File metadata
- Download URL: duitku_python-0.2.5-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01411ac498d138d4b9df2cb6ce6fc247a95c8033e180736c9b24534e0a4160fd
|
|
| MD5 |
a38f6f0f995a6e1771d44ca18dbcbc36
|
|
| BLAKE2b-256 |
fb616e2114df93db7bd144193277ec8bec160c2a6c6aef7811aa2df1b3c1f446
|