Cashfree Payment Gateway APIs
Project description
Cashfree PG Python SDK
The Cashfree PG Python SDK offers a convenient solution to access Cashfree PG APIs from a server-side Go applications.
Documentation
Cashfree's PG API Documentation - https://docs.cashfree.com/reference/pg-new-apis-endpoint
Learn and understand payment gateway workflows at Cashfree Payments here
Try out our interactive guides at Cashfree Labs !
Getting Started
Installation
pip install cashfree_pg
Configuration
from cashfree_pg.models.create_order_request import CreateOrderRequest
from cashfree_pg.api_client import Cashfree
from cashfree_pg.models.customer_details import CustomerDetails
Cashfree.XClientId = "<x-client-id>"
Cashfree.XClientSecret = "<x-client-secret>"
Cashfree.XEnvironment = Cashfree.Sandbox
x_api_version = "2022-09-01"
Generate your API keys (x-client-id , x-client-secret) from Cashfree Merchant Dashboard
Basic Usage
Create Order
customerDetails = CustomerDetails(customer_id="123", customer_phone="9999999999")
createOrderRequest = CreateOrderRequest(order_amount=1, order_currency="INR", customer_details=customerDetails)
try:
api_response = Cashfree().PGCreateOrder(x_api_version, createOrderRequest, None, None)
print(api_response.data)
except Exception as e:
print(e)
Get Order
try:
api_response = Cashfree().PGFetchOrder(x_api_version, "order_3242X4jQ5f0S9KYxZO9mtDL1Kx2Y7u", None)
print(api_response.data)
except Exception as e:
print(e)
Licence
Apache Licensed. See LICENSE.md for more details
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
cashfree_pg-3.0.5.tar.gz
(146.6 kB
view hashes)
Built Distribution
cashfree_pg-3.0.5-py3-none-any.whl
(365.9 kB
view hashes)
Close
Hashes for cashfree_pg-3.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9785ab5c55f5ae08076f07b753382b5bc35f035efec96289d0e803417f46d4b |
|
MD5 | 005cf78415321c2b5089c075244bea55 |
|
BLAKE2b-256 | 4c5aa78d021c111ef6d2421937e53a329b1232b7e1779ef0914d0f5a7d679934 |