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.
Installs: 3 706
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 5
Open Issues: 4
Requires
- php: ^7.2 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
- sentry/sdk: ^3.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- phpunit/phpunit: ^8.0 || ^9.0
- dev-master
- 4.2.5.x-dev
- 4.2.3.x-dev
- 4.2.3
- 4.2.2.x-dev
- 4.2.2
- 4.2.1.x-dev
- 4.2.1
- 4.2.0.x-dev
- 4.2.0
- 4.1.2.x-dev
- 4.1.2
- 4.0.10.x-dev
- 4.0.10
- 4.0.9.x-dev
- 4.0.9
- 4.0.7.x-dev
- 4.0.7
- 4.0.5.x-dev
- 4.0.5
- 4.0.3.x-dev
- 4.0.3
- 4.0.2.x-dev
- 4.0.2
- 4.0.0.x-dev
- 4.0.0
- 3.2.12.x-dev
- 3.2.12
- 3.2.3.x-dev
- 3.2.3
- 3.2.1.x-dev
- 3.2.1
- 3.2.0.x-dev
- 3.2.0
- 3.1.4.x-dev
- 3.1.4
- 3.1.3.x-dev
- 3.1.3
- 3.1.1.x-dev
- 3.1.1
- 3.1.0.x-dev
- 3.1.0
- 3.0.8.x-dev
- 3.0.8
- 3.0.6.x-dev
- 3.0.6
- 3.0.5.x-dev
- 3.0.5
- 3.0.2.x-dev
- 3.0.2
- 2.2.0.x-dev
- 2.2.0
- 2.1.0.x-dev
- 2.1.0
- 2.0.2.x-dev
- 2.0.2
- 2.0.1.x-dev
- 2.0.1
- 2.0.0.x-dev
- 2.0.0
- 0.0.10.x-dev
- 0.0.10
- 0.0.9.x-dev
- 0.0.9
- 0.0.8.x-dev
- 0.0.8
- 0.0.7.x-dev
- 0.0.7
- 0.0.6.x-dev
- 0.0.6
- 0.0.5.x-dev
- 0.0.5
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
- dev-feature/unit-test
- dev-feature/update-docs
- dev-quickfix/resolve-syntax-error
- dev-changing-namespace
This package is not auto-updated.
Last update: 2024-11-01 11:31:37 UTC
README
The Cashfree PG PHP 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
Note:
This README is for the current branch and not necessarily what's released in Composer
Installation
composer require cashfree/cashfree-pg
Configuration
\Cashfree\Cashfree::$XClientId = "<x-client-id>"; \Cashfree\Cashfree::$XClientSecret = "<x-client-secret>"; \Cashfree\Cashfree::$XEnvironment = Cashfree\Cashfree::$SANDBOX;
Generate your API keys (x-client-id , x-client-secret) from Cashfree Merchant Dashboard
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, "<order_id>"); print_r($response); } catch (Exception $e) { echo 'Exception when calling PGFetchOrder: ', $e->getMessage(), PHP_EOL; }
Supported Resources
Licence
Apache Licensed. See LICENSE.md for more details