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

Built distribution (wheel)

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

Total release size: 7.0 kB

Release files / kobil_payment-3.0.0.tar.gz

Download URL kobil_payment-3.0.0.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
27a3513c36918316ed8a64a4056a7692b2c6824a6b5526402baaba19557dc6f9
BLAKE2b-256 checksum
How to use checksums
35abdf98b1a0460d44843043935607b1e4c515fe3ce97e2903961a17442ac7b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

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

Download URL kobil_payment-3.0.0-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
895a2d92bd60dec180363ceebeee9fff8e64db2c2f1d0454a5611cf78887ec4d
BLAKE2b-256 checksum
How to use checksums
3a033246340de3e3a4ba694bb306ae4b7d3fe1e2826a1d542640209cbced8483
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Security for kobil-payment 3.0.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