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

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

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="walterwNrcMi", customer_phone="9999999999")
orderMeta = CreateOrderRequestOrderMeta(notify_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)

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cashfree_pg-3.0.8-py3-none-any.whl (365.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cashfree_pg-3.0.8.tar.gz
  • Upload date:
  • Size: 146.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for cashfree_pg-3.0.8.tar.gz
Algorithm Hash digest
SHA256 2f862c07cbd0f341736e3af7c4deb61adf6e9a29bd6217160eab2fbcc7b0d773
MD5 7c90eaca33dc0572659a026e420a735e
BLAKE2b-256 afe826b72c25a0307ccddb0e84cce7c186def323a94137c205c8ca76f5aa861c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cashfree_pg-3.0.8-py3-none-any.whl
  • Upload date:
  • Size: 365.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for cashfree_pg-3.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 3b515a955faba7d835aaf6a882071932b4752e409c322347d5be7c1bb127de4f
MD5 0ffac4893ac29950c9a85bcdf1df35b9
BLAKE2b-256 2fbc6879da7412e7b7bda64787277f074a8d6107a63b7dce7619111df88ece09

See more details on using hashes here.

Supported by

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