Skip to main content

Cashfree Payment Gateway APIs

Project description

Cashfree PG Python SDK

GitHub Discord GitHub last commit (branch) GitHub release (with filter) GitHub forks Order Create API Order Create API

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 Dev Studio !

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
from cashfree_pg.models.order_meta import OrderMeta

Cashfree.XClientId = "<x-client-id>"
Cashfree.XClientSecret = "<x-client-secret>"
Cashfree.XEnvironment = Cashfree.SANDBOX
x_api_version = "2023-08-01"

Generate your API keys (x-client-id , x-client-secret) from Cashfree Merchant Dashboard

Basic Usage

Create Order

customerDetails = CustomerDetails(customer_id="walterwNrcMi", customer_phone="9999999999")
orderMeta = OrderMeta(return_url="https://www.cashfree.com/devstudio/preview/pg/web/checkout?order_id={order_id}")
createOrderRequest = CreateOrderRequest(order_amount=1, order_currency="INR", customer_details=customerDetails, order_meta=orderMeta)
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)

Supported Resources

Licence

Apache Licensed. See LICENSE.md for more details

Project details


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-4.3.10.tar.gz (192.6 kB view details)

Uploaded Source

Built Distribution

cashfree_pg-4.3.10-py3-none-any.whl (411.6 kB view details)

Uploaded Python 3

File details

Details for the file cashfree_pg-4.3.10.tar.gz.

File metadata

  • Download URL: cashfree_pg-4.3.10.tar.gz
  • Upload date:
  • Size: 192.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for cashfree_pg-4.3.10.tar.gz
Algorithm Hash digest
SHA256 e8d6e7a2ce19e30437defba6482899b6b9a2a9bec7ffaac80cbdb2f9bdc554d9
MD5 6dae8edeeb4c1e4bd9347b39db1b7005
BLAKE2b-256 76f6980ff9219c7accca3313a08af368af7822730c3027506e98e388acac1865

See more details on using hashes here.

File details

Details for the file cashfree_pg-4.3.10-py3-none-any.whl.

File metadata

  • Download URL: cashfree_pg-4.3.10-py3-none-any.whl
  • Upload date:
  • Size: 411.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for cashfree_pg-4.3.10-py3-none-any.whl
Algorithm Hash digest
SHA256 919d50954ba8501cbf600f847ebc4c9d45f84d97e95e47b9317f0c4708955c2d
MD5 ca94326ea32b6ba1cc010065d45e68db
BLAKE2b-256 032947899e0bfcf1c23992b00f5497f2998e1f96a3fb330d32fd3386a7e0ba2e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page