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 slipcreate_qr30(amount, ref1, ref2, ref3)- Generate QR30 payment codequery_transaction(biller_id, reference1, transaction_date)- Query transactioncreate_deeplink(amount, ref1, ref2, ref3)- Create SCB Easy deeplinkget_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
Release history Release notifications | RSS feed
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.1.1.tar.gz
(8.3 kB
view details)
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 thanakan_oauth-0.1.1.tar.gz.
File metadata
- Download URL: thanakan_oauth-0.1.1.tar.gz
- Upload date:
- Size: 8.3 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
906481bfc04ff3c0a2239fbef66826da9553b69a9a8be8dda5e3afa4318aa831
|
|
| MD5 |
3f30b1824db8a4354689c24d1cf78010
|
|
| BLAKE2b-256 |
c662596c0896165220a8ec516de404944f56df98d4b6a54091c64618f85f11de
|
File details
Details for the file thanakan_oauth-0.1.1-py3-none-any.whl.
File metadata
- Download URL: thanakan_oauth-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.9 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f568bf15862bd290dca2e0fc9422366c2a174322498df2d0304d275b105f836
|
|
| MD5 |
8c283ea6308034d659a8593a68687356
|
|
| BLAKE2b-256 |
7cf1fced4825cb79ad340d54f6cad4eaa278e5de7b673b131fc257b62db36751
|