Skip to main content

kobil-payment

KOBIL Pay (mpay-merchant) client for Python, with automatic OAuth token management.

pip install kobil-payment

Credentials are shared across modules and read from KOBIL_* env vars if omitted. merchant_id defaults to client_id. Amounts are in the smallest currency unit (1300 = 13.00 EUR); timeouts in minutes.

from kobil.payment import PaymentClient, payment_group

payment = PaymentClient(
    payment_base_url="https://pay.cloud.kobil.com/mpay-merchant/create/transaction",
    merchant_name="ISPARK",
    # credentials optional if KOBIL_* env vars are set:
    client_id="...", client_secret="...", token_endpoint="https://idp/token",
)

res = payment.create_transaction(
    user_id=user_id,
    amount=1300,
    payment_content=payment_group(("Service Amount", "10.0 TL"), ("Tax Amount", "3.0 TL")),
)
# res["transactionId"], res["status"]

payment.create_pre_auth_transaction(user_id, 1300)
payment.post_auth(transaction_id, 40)
payment.get_status(transaction_id)
payment.cancel(transaction_id, user_id, cancellation_message="Iptal")
payment.refund(transaction_id, user_id, 5555, currency="USD")

Each operation returns the decoded response dict. Failures raise kobil.payment.KobilPaymentError (subclass of kobil.core.KobilError).

License

MIT

Metadata

Release files for kobil-payment 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kobil-payment 1.2.0
File Size Uploaded Provenance Actions
kobil_payment-1.2.0.tar.gz 3.4 kB Without provenance Details for kobil_payment-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kobil-payment 1.2.0
File Interpreter ABI Platform Actions
kobil_payment-1.2.0-py3-none-any.whl Python 3 none any Details for kobil_payment-1.2.0-py3-none-any.whl

Total release size: 7.0 kB

Release files / kobil_payment-1.2.0.tar.gz

Download URL kobil_payment-1.2.0.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
800836019722ed318bb28c1df335cb86cf50e1687e70fd6ec367b87e53effe91
BLAKE2b-256 checksum
How to use checksums
ac621d81fecfb528b2fd1ccd665282d2dddfd2bfbe614422d25bb379fa6268fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / kobil_payment-1.2.0-py3-none-any.whl

Download URL kobil_payment-1.2.0-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
12357ff4310c4021347b728f77448c83cdced45bcc2c363803f9ac37df03252c
BLAKE2b-256 checksum
How to use checksums
2c5f6eaa07a654433c78494d1d56f2dc7aee8e212bbe12f6dd7b8ef3c9f45ea0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for kobil-payment 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page