Skip to main content

Thai bank OAuth API clients (SCB, KBank)

Project description

thanakan-oauth

Thai bank OAuth API clients for SCB and KBank.

Installation

pip install thanakan-oauth

Usage

SCB API

from thanakan_oauth import SCBAPI, SCBBaseURL

api = SCBAPI(
    app_key="your_app_key",
    app_secret="your_app_secret",
    cert="/path/to/cert.pem",
    base_url=SCBBaseURL.PRODUCTION
)

# Verify slip
result = await api.verify_slip(
    sending_bank_id="014",
    transaction_ref_id="2024010112345678901234"
)

if result.data:
    print(f"Amount: {result.data.amount}")
    print(f"Sender: {result.data.sender.name}")

KBank API

from thanakan_oauth import KBankAPI

api = KBankAPI(
    consumer_id="your_consumer_id",
    consumer_secret="your_consumer_secret",
    cert="/path/to/cert.pem"
)

# Verify slip (async)
result = await api.verify_slip(
    sending_bank_id="014",
    transaction_ref_id="2024010112345678901234"
)

# Verify slip (sync)
result = api.verify_slip_sync(
    sending_bank_id="014",
    transaction_ref_id="2024010112345678901234"
)

SCB API Methods

  • verify_slip(sending_bank_id, transaction_ref_id) - Verify transfer slip
  • create_qr30(amount, ref1, ref2, ref3) - Generate QR30 payment code
  • query_transaction(biller_id, reference1, transaction_date) - Query transaction
  • create_deeplink(amount, ref1, ref2, ref3) - Create SCB Easy deeplink
  • get_deeplink(transaction_id) - Get deeplink details

KBank API Methods

  • verify_slip(sending_bank_id, transaction_ref_id) - Verify transfer slip (async)
  • verify_slip_sync(sending_bank_id, transaction_ref_id) - Verify transfer slip (sync)

mTLS Certificate

Both APIs require mTLS certificates for production:

# Single file (cert + key combined)
api = SCBAPI(..., cert="/path/to/combined.pem")

# Separate cert and key
api = SCBAPI(..., cert=("/path/to/cert.pem", "/path/to/key.pem"))

Documentation

Full documentation: https://ninyawee.github.io/thanakan/libraries/thanakan-oauth/

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

thanakan_oauth-0.2.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

thanakan_oauth-0.2.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file thanakan_oauth-0.2.0.tar.gz.

File metadata

  • Download URL: thanakan_oauth-0.2.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for thanakan_oauth-0.2.0.tar.gz
Algorithm Hash digest
SHA256 20d9a5aab9ac0d09ee99e15be800c6416ecd08cbe8358393068e164b3cbdb6d5
MD5 ada87e55d0bfc02757ebe3bea13841f5
BLAKE2b-256 813d89e586ba9bb3dc8ecd135b4f9417147f94ce476f7ba0349e937e9ab17429

See more details on using hashes here.

File details

Details for the file thanakan_oauth-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: thanakan_oauth-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for thanakan_oauth-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 791a5fe33bc6dd1d1218643c332ac50604ae91acb4fa3da09ae9ba235f7c9a38
MD5 a66c0d93ccc0d419036cb12e49fe7c3d
BLAKE2b-256 763b43e22255579b9dfc1c3bf21d0239f760ce1fa2cd8481d91da0868dcf3c9e

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