PHPackages                             cashfree/cashfree-pg-sdk-php - 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-sdk-php

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

cashfree/cashfree-pg-sdk-php
============================

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

5.0.3(1y ago)48.5k—0%9[1 PRs](https://github.com/cashfree/cashfree-pg-sdk-php/pulls)Apache-2.0PHPPHP ^7.2 || ^8.0

Since Jul 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/cashfree/cashfree-pg-sdk-php)[ Packagist](https://packagist.org/packages/cashfree/cashfree-pg-sdk-php)[ Docs](https://www.cashfree.com)[ RSS](/packages/cashfree-cashfree-pg-sdk-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (96)Used By (0)

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 Go applications.

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
```

### Configuration

[](#configuration)

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

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

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

$x_api_version = "2022-09-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 = "2022-09-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

43

—

FairBetter than 91% of packages

Maintenance46

Moderate activity, may be stable

Popularity31

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 90.8% 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 ~11 days

Recently: every ~21 days

Total

90

Last Release

410d ago

Major Versions

2.2.0.x-dev → 3.0.22023-11-03

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

3.2.0.x-dev → 4.0.22024-01-23

3.2.12.x-dev → 4.0.32024-01-29

4.3.10 → 5.0.0-beta-12025-04-04

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)")

---

Tags

cashfreepayment-gatewaypaymentsphpsdkphpapisdkrestpayment gatewaycashfree

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[zenditplatform/zendit-php-sdk

PHP client for Zendit API

1204.3k](/packages/zenditplatform-zendit-php-sdk)[huaweicloud/huaweicloud-sdk-php

Huawei Cloud SDK for PHP

1829.2k2](/packages/huaweicloud-huaweicloud-sdk-php)[ory/hydra-client-php

Documentation for all of Ory Hydra's APIs.

1710.8k](/packages/ory-hydra-client-php)

PHPackages © 2026

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