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 3.0.1

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 3.0.1
File Size Uploaded Provenance Actions
kobil_payment-3.0.1.tar.gz 3.4 kB Without provenance Details for kobil_payment-3.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 7.0 kB

Release files / kobil_payment-3.0.1.tar.gz

Download URL kobil_payment-3.0.1.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4659a64b6958f68e8e6a14ac500c2d2416eb38b5d0d337d26a0314fd5a13cae3
BLAKE2b-256 checksum
How to use checksums
c0d86a1f1f45fd5ae46ac0c0ada2556d118402130e685738ef9d37edafc1b1ad
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-3.0.1-py3-none-any.whl

Download URL kobil_payment-3.0.1-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
913447f414e70931f3d6f3bb2077c6e559c46739717c5d855be3249f72d1f65c
BLAKE2b-256 checksum
How to use checksums
0cd4ca972df38ce4729a0cc9a08673020637319ae8a18dea8d66474caaf1e3e7
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 3.0.1

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