Skip to main content

Duitku Python SDK

Project description

Duitku Python API Client Library

License: MIT

Duitku API Library for Python

Supported Feature

Feature Function HTTP Request Description
Get Payment Method client.payment.get_methods POST /merchant/paymentmethod/getpaymentmethod Get list of available payment methods
Craete New Invoice client.invoice.create POST /merchant/createInvoice Create Transaction via POP API

Requirements

Documentation

Installation

Get this library, add to your project

pip install duitku

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.1.1.tar.gz (6.2 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.1.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: duitku_python-0.1.1.tar.gz
  • Upload date:
  • Size: 6.2 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.1.1.tar.gz
Algorithm Hash digest
SHA256 ce133fbbd4b625927170b618e49314c36c9ba528d88b1fb4158881ba7ce2dd58
MD5 6fdfff685e17ad629b5ca8a0f47f03fc
BLAKE2b-256 454477e26eb1cdeff092d81bc850b4cd346b9769022450d1166d482e215fe539

See more details on using hashes here.

File details

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

File metadata

  • Download URL: duitku_python-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b9429fab426fa4acb6a12525ccea5b13d2852658e5b0c7219f763c05acc7e7f4
MD5 f90bfcb340b24938cfb57406b7af2f5b
BLAKE2b-256 cc60e1982d86c96b70acd5fe58aba727f4102b96240834c8a8d47cdd9e2983f8

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