PHPackages                             cashfree/cashfree-pg - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. cashfree/cashfree-pg

ActiveLibrary[HTTP &amp; Networking](/categories/http)

cashfree/cashfree-pg
====================

Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.

6.0.5(1mo ago)444.5k↓37.8%9[1 issues](https://github.com/cashfree/cashfree-pg-sdk-php/issues)1unlicensePHPPHP ^8.1

Since Jul 13Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/cashfree/cashfree-pg-sdk-php)[ Packagist](https://packagist.org/packages/cashfree/cashfree-pg)[ Docs](https://openapi-generator.tech)[ RSS](/packages/cashfree-cashfree-pg/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (9)Versions (102)Used By (1)

Cashfree PG PHP SDK
===================

[](#cashfree-pg-php-sdk)

[![GitHub](https://camo.githubusercontent.com/7d2ac09d8afaca080e00cc253bba116bfc3fd4b81995512f07bb97c1ffb54e00/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f63617368667265652f63617368667265652d70672d73646b2d706870)](https://camo.githubusercontent.com/7d2ac09d8afaca080e00cc253bba116bfc3fd4b81995512f07bb97c1ffb54e00/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f63617368667265652f63617368667265652d70672d73646b2d706870) [![Discord](https://camo.githubusercontent.com/372e2fb4f4f869e227f998cd458c32fc2955f9bbdb2dd48cf412f9d22be938b5/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3933313132353636353636393937323031383f6c6162656c3d646973636f7264)](https://camo.githubusercontent.com/372e2fb4f4f869e227f998cd458c32fc2955f9bbdb2dd48cf412f9d22be938b5/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3933313132353636353636393937323031383f6c6162656c3d646973636f7264) [![GitHub last commit (branch)](https://camo.githubusercontent.com/239e92dde2606d9b25fdeff7f34a613597ffb07508f1d624ff4d77dad4886cd9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f63617368667265652f63617368667265652d70672d73646b2d7068702f6d6173746572)](https://camo.githubusercontent.com/239e92dde2606d9b25fdeff7f34a613597ffb07508f1d624ff4d77dad4886cd9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f63617368667265652f63617368667265652d70672d73646b2d7068702f6d6173746572) [![GitHub release (with filter)](https://camo.githubusercontent.com/d589d339ab2c1618a4dc181fead3e83e0c568caa75d56eef8afa62c52eace310/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f63617368667265652f63617368667265652d70672d73646b2d7068703f6c6162656c3d6c6174657374)](https://camo.githubusercontent.com/d589d339ab2c1618a4dc181fead3e83e0c568caa75d56eef8afa62c52eace310/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f63617368667265652f63617368667265652d70672d73646b2d7068703f6c6162656c3d6c6174657374) [![GitHub forks](https://camo.githubusercontent.com/7d786a32d9f07bad02e5db2ef98fb1a78b7a5852d7a4a2509d8f6275697fb747/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f63617368667265652f63617368667265652d70672d73646b2d706870)](https://camo.githubusercontent.com/7d786a32d9f07bad02e5db2ef98fb1a78b7a5852d7a4a2509d8f6275697fb747/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f63617368667265652f63617368667265652d70672d73646b2d706870)

The Cashfree PG PHP SDK offers a convenient solution to access [Cashfree PG APIs](https://docs.cashfree.com/reference/pg-new-apis-endpoint) from a server-side PHP application.

Documentation
-------------

[](#documentation)

Cashfree's PG API Documentation -

Learn and understand payment gateway workflows at Cashfree Payments [here](https://docs.cashfree.com/docs/payment-gateway)

Try out our interactive guides at [Cashfree Dev Studio](https://www.cashfree.com/devstudio) !

Getting Started
---------------

[](#getting-started)

`Note:` This README is for the current branch and not necessarily what's released in `Composer`

### Installation

[](#installation)

```
composer require cashfree/cashfree-pg
```

Version &gt;=6
--------------

[](#version-6)

### Configuration

[](#configuration)

```
$cashfree = new \Cashfree\Cashfree(
    \Cashfree\Cashfree::$SANDBOX,        // or \Cashfree\Cashfree::$PRODUCTION
    "",
    "",
    "",                                  // x-partner-api-key (leave blank if unused)
    "",                                  // x-partner-merchant-id (leave blank if unused)
    "",                                  // x-client-signature (leave blank if unused)
    true                                 // enable error analytics
);
```

Generate your API keys (x-client-id , x-client-secret) from [Cashfree Merchant Dashboard](https://merchant.cashfree.com/merchants/login)

### Basic Usage

[](#basic-usage)

Create Order

```
$create_orders_request = new \Cashfree\Model\CreateOrderRequest();
$create_orders_request->setOrderAmount(1.0);
$create_orders_request->setOrderCurrency("INR");
$customer_details = new \Cashfree\Model\CustomerDetails();
$customer_details->setCustomerId("walterwNrcMi");
$customer_details->setCustomerPhone("9999999999");
$create_orders_request->setCustomerDetails($customer_details);

try {
    $result = $cashfree->PGCreateOrder($create_orders_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PGCreateOrder: ', $e->getMessage(), PHP_EOL;
}
```

Get Order

```
try {
    $response = $cashfree->PGFetchOrder("");
    print_r($response);
} catch (Exception $e) {
    echo 'Exception when calling PGFetchOrder: ', $e->getMessage(), PHP_EOL;
}
```

Version &lt;6
-------------

[](#version-6-1)

### Configuration

[](#configuration-1)

```
\Cashfree\Cashfree::$XClientId = "";
\Cashfree\Cashfree::$XClientSecret = "";
\Cashfree\Cashfree::$XEnvironment = Cashfree\Cashfree::$SANDBOX;

$cashfree = new \Cashfree\Cashfree();
```

Generate your API keys (x-client-id , x-client-secret) from [Cashfree Merchant Dashboard](https://merchant.cashfree.com/merchants/login)

### Basic Usage

[](#basic-usage-1)

Create Order

```
$x_api_version = "2023-08-01";
$create_orders_request = new \Cashfree\Model\CreateOrderRequest();
$create_orders_request->setOrderAmount(1.0);
$create_orders_request->setOrderCurrency("INR");
$customer_details = new \Cashfree\Model\CustomerDetails();
$customer_details->setCustomerId("walterwNrcMi");
$customer_details->setCustomerPhone("9999999999");
$create_orders_request->setCustomerDetails($customer_details);

try {
    $result = $cashfree->PGCreateOrder($x_api_version, $create_orders_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PGCreateOrder: ', $e->getMessage(), PHP_EOL;
}
```

Get Order

```
$x_api_version = "2023-08-01";
try {
    $response = $cashfree->PGFetchOrder($x_api_version, "");
    print_r($response);
} catch (Exception $e) {
    echo 'Exception when calling PGFetchOrder: ', $e->getMessage(), PHP_EOL;
}
```

Supported Resources
-------------------

[](#supported-resources)

- [Order](docs/Orders.md)
- [Payment](docs/Payments.md)
- [Refund](docs/Refunds.md)
- [Token Vault](docs/TokenVault.md)
- [Eligiblity](docs/Eligibility.md)
- [PaymentLink](docs/PaymentLink.md)
- [Settlements](docs/Settlements.md)
- [Reconciliation](docs/Reconciliation.md)
- [Webhook](docs/Webhook.md)

Licence
-------

[](#licence)

Apache Licensed. See [LICENSE.md](LICENSE.md) for more details

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance85

Actively maintained with recent releases

Popularity37

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 87.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~15 days

Recently: every ~0 days

Total

96

Last Release

46d ago

Major Versions

3.1.4.x-dev → 4.0.0.x-dev2024-01-22

3.2.0.x-dev → 4.0.2.x-dev2024-01-23

3.2.12 → 4.0.32024-01-29

4.3.10 → 5.0.0-beta-12025-04-04

5.0.3.x-dev → 6.0.5.x-dev2026-05-18

PHP version history (4 changes)0.0.1PHP ^7.3 || ^8.0

3.0.2PHP ^7.4 || ^8.0

3.1.0PHP ^8.1

3.1.1PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/40a59714693f29aa58788f28ece4732ff144ae31d182d14fb9a5dfced11862fc?d=identicon)[Cashfree developer](/maintainers/Cashfree%20developer)

---

Top Contributors

[![suhas-cashfree](https://avatars.githubusercontent.com/u/79302990?v=4)](https://github.com/suhas-cashfree "suhas-cashfree (69 commits)")[![prem-cashfree](https://avatars.githubusercontent.com/u/71376913?v=4)](https://github.com/prem-cashfree "prem-cashfree (7 commits)")[![kishan-cashfree](https://avatars.githubusercontent.com/u/118521093?v=4)](https://github.com/kishan-cashfree "kishan-cashfree (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

cashfreepayment-gatewaypaymentsphpsdkphpapisdkrestopenapiopenapitoolsopenapi-generator

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/cashfree-cashfree-pg/health.svg)

```
[![Health](https://phpackages.com/badges/cashfree-cashfree-pg/health.svg)](https://phpackages.com/packages/cashfree-cashfree-pg)
```

###  Alternatives

[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[elasticemail/elasticemail-php

The PHP library for the Elastic Email REST API. This API is based on the REST API architecture, allowing the user to easily manage their data with this resource-based approach. To start using this API, you will need your Access Token. Remember to keep it safe.

15114.7k2](/packages/elasticemail-elasticemail-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
