loveycom/cashfree
Laravel package for CashFree (India) integrating Marketplace Settlement and Payment Gateway APIs. Includes config publishing, environment switching (test/prod), and helper classes like Marketplace (e.g., checkBalance) to simplify CashFree API calls in Laravel.
An open source package by kayusgold for CashFree, an Indian payment gateway.
CashFree offers their clients many services to make transactions between sender and receiver seemlessly easy. However, this package focuses mainly on MarketPlace Settlement API and Payment Gateway API. Visit here for MarketPlace Settlement API documentation and here for Payment Gateway API documentation.
Using the package, but you're stuck? Found a bug? Have a question or suggestion for improving this package? Feel free to create an issue on GitHub, we'll try to address it as soon as possible.
composer require loveycom/cashfree
LoveyCom\CashFree\CashFreeServiceProvider::class,
php artisan vendor:publish
'appID' => '',
'secretKey' => '',
'testURL' => 'https://ces-gamma.cashfree.com',
'prodURL' => 'https://ces-api.cashfree.com',
'maxReturn' => 100,
'isLive' => false,
Do not forget to dump composer autoload
composer dump-autoload
config/cashfree.phpcheckBalance() -- endpoint /getBalancewithdraw($amount, $remark = "") -- endpoint /ces/v1/requestWithdrawalgetLedger($maxReturn = "", $lastReturnId = "") -- endpoint /ces/v1/getLedger?maxReturn=$maxReturnstatus($orderId) -- endpoint /ces/v1/getOrderSettlementStatus/$orderIdimportTransaction($details = []) -- endpoint /ces/v1/importTransactionretreive($orderId = "") -- endpoint /ces/v1/getTransactions or /ces/v1/getTransaction/$orderIdattachVendorToTransaction($orderId, $vendorId, $commission = "", $commissionAmount = "") -- endpoint /ces/v1/attachVendordetachVendorFromTransaction($orderId, $vendorId) -- endpoint /ces/v1/detachVendorcreate($vendor = [], $vendorId = "") -- endpoints /ces/v1/editVendor/$vendorId (Update Vendor Details) | /ces/v1/addVendor (Create Vendor)retreive($vendorId = "") -- endpoints -- endpoints /ces/v1/getVendor/$vendorId | /ces/v1/getVendorscheckStatus($vendorId) -- endpoint /ces/v1/getVendor/$vendorIdadjustVendorBalance($vendorId, $adjustmentId, $amount, $type = "CREDIT", $remark = "") -- endpoint /ces/v1/adjustVendorrequestVendorPayout($vendorId, $amount) -- endpoint /ces/v1/requestVendorPayoutgetLedger($vendorId, $maxReturn = 50, $lastReturnId = "") -- endpoint /ces/v1/getVendorLedger/$vendorId?maxReturn=$maxReturngetTransferDetails($vendorTransferId = "", $vendorId = "", $maxReturn = 50, $lastReturnId = "", $startDate = "", $endDate = "") -- endpoint /ces/v1/getVendorTransfer/...transferBetweenVendors($fromVendorId, $toVendorId, $amount, $adjustmentId) -- endpoint /transferVendorBalancecreate($order) -- endpoint /api/v1/order/creategetLink($orderId) -- endpoint /api/v1/order/info/linkgetDetails($orderId) -- endpoint /api/v1/order/info/getStatus($orderId) -- endpoint /api/v1/order/info/statuscreate($orderId, $referenceId, $amount, $remark = "") -- endpoint /api/v1/order/refundinstantRefund($orderId, $referenceId, $amount, $remark = "", $refundType = "", $merchantRefundId = "", $mode = "CASHGRAM", $accountNo = "", $ifsc = "") -- endpoint /api/v1/order/refundretreive($startDate, $endDate, $lastId = "", $count = "") -- endpoint /api/v1/refundsgetAll($startDate, $endDate, $lastId = "", $count = "") -- endpoint /api/v1/settlementsgetOne($settlementId) -- endpoint /api/v1/settlementretreive($startDate = "", $endDate = "", $txStatus = "", $lastID = "", $count = "") -- endpoint /api/v1/transactions//import the class
use LoveyCom\CashFree\PaymentGateway\Order;
//instantiate the class
$order = new Order();
//prepare the order details
//NOTE: Prepare a route for returnUrl and notifyUrl (something like a webhook). However, if you have webhook setup in your cashfree dashboard, no need for notifyUrl. But if notifyUrl is set, it will be called instead.
$od["orderId"] = "ORDER-84984941";
$od["orderAmount"] = 10000;
$od["orderNote"] = "Subscription";
$od["customerPhone"] = "9000012345";
$od["customerName"] = "Test Name";
$od["customerEmail"] = "test@cashfree.com";
$od["returnUrl"] = "http://127.0.0.1:8000/order/success";
$od["notifyUrl"] = "http://127.0.0.1:8000/order/success";
//call the create method
$order->create($od);
//get the payment link of this order for your customer
$link = $order->getLink($od['orderId'])
//You can now either send this link to your customer through email or redirect to it for them to complete the payment.
//To confirm the payment,
//Call either getDetails($orderId) or getStatus($orderId) method
Thank you for your interest, here are some of the many ways to contribute.
If you discover any security related issues, please email info@plustech.com.ng instead of using the issue tracker.
This software is released under the MIT License.
How can I help you explore Laravel packages today?