Skip to main content

Duitku Python SDK

Project description

Duitku Python API Client Library

pypi Build Status License: MIT

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

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"
}
response = None
try:
    response = duitku.invoice.create(create_invoice_req):
except requests.exceptions.HTTPError as e:
    print(e)
print(response)

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

duitku_python-0.2.4.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

duitku_python-0.2.4-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file duitku_python-0.2.4.tar.gz.

File metadata

  • Download URL: duitku_python-0.2.4.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for duitku_python-0.2.4.tar.gz
Algorithm Hash digest
SHA256 c23ba86ac9ae1e56745374f1094e7aac092a1843a0d36f671de3f52ee9420854
MD5 60c09b551e73205f36f86f137433baa4
BLAKE2b-256 df20b247afd2d298028fc68a9529791c7a9ab818dfcaf6ebee6262915045b7a2

See more details on using hashes here.

File details

Details for the file duitku_python-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: duitku_python-0.2.4-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

Hashes for duitku_python-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f14a9754e638ebb05602dc60147759fbb1502a277869addba917e67c67f85d21
MD5 9e0e0d4ee76afeca6413f5f2b3c90129
BLAKE2b-256 ad89951e8b4575d7d691c71727aed0a2a240d279f372dc9f0469ce346ea3ef72

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page