CashFree API Python Package
This Python package provides a simple interface to the CashFree APIs. It can be used to create orders, payment links, check the status of transactions, and refund orders etc
Note: Refer to the cashfree api docs for detailed payload instructions, API references, and examples.
Installation
To install the package, run the following command:
pip install cashfree
Usage
The following code shows how to create a CashFree Payment Session:
- Initiate Cashfree Object
from cashfree import CashFree
# Instantiate CashFree object for the sandbox environment (TEST)
cashfree_client = CashFree(client_id, client_secret, environment="TEST", api_version='v3')
- Create A Customer Object
from cashfree import CustomerDetails
customer = CustomerDetails(customer_id='CF_7768', customer_phone='7778989987')
- Create A Order Object
from cashfree import CashFreeOrder
order = CashFreeOrder(order_id='your-order-id', order_amount=120.3)
Now you can use the client to interact with CashFree APIs
- Create an order payment session
# You can pass the order & customer object inside create_order method
order = cashfree_client.create_order(order, customer)
payment_session_id = order.get('payment_session_id')
- Get Payment Details Of A Single Order
order_details = cashfree_client.get_payment_details('your_order_id')
- Webhook Signature validation
# Get The raw Payload data
raw_payload = request.get_data(as_text=True)
timestamp = request.headers.get('x-webhook-timestamp')
received_signature = request.headers.get('x-webhook-signature')
is_valid_webhook = cashfree_client.validate_webhook_signature(raw_payload, timestamp, received_signature)
Contributing:
Contributions are always welcome! If you find any issues or have suggestions, please open an issue or create a pull request on GitHub.
License:
This project is licensed under the MIT License
Support:
For api related support please contact support@cashfree.com.
Pending Feature:
- Easy Split Module
- Payouts Module
- Cashgram Module
- Verification Suite
Metadata
Release files for cashfree 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cashfree-1.0.1.tar.gz | 8.6 kB | Without provenance | Details for cashfree-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cashfree-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for cashfree-1.0.1-py3-none-any.whl |
Total release size: 16.2 kB
Release files / cashfree-1.0.1.tar.gz
| Download URL | cashfree-1.0.1.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8df623cb624f565ca7288e838372dd6b4c1cc62622c2284b2dc4a5d53ac5e005
|
|
BLAKE2b-256 checksum How to use checksums |
4096584c1ef0749ed124471c7654d99081e2afefde13ad798b5b1b1ba0a3eb43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / cashfree-1.0.1-py3-none-any.whl
| Download URL | cashfree-1.0.1-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2e35ab951e25f22ba2fe6faea5294dcec7936cd271d2eae3c5cbcb37837c0ffe
|
|
BLAKE2b-256 checksum How to use checksums |
94ec578eeeb7678409a30722279e4ca46797de1b6a8fd843f89ac227048a6ce1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Security for cashfree 1.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.