loveycom/cashfree
Composer 安装命令:
composer require loveycom/cashfree
包简介
A package for CashFree Payment Gateway.
README 文档
README
An open source package by kayusgold for CashFree, an Indian payment gateway.
Documentation
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.
Requirements
- PHP >= 7.0.*
- Laravel >= 5.6.*
Installation
- To use LoveyCom CashFree package, add it to your project using composer:
composer require loveycom/cashfree
- Open Config/app.php and add the following to the providers array:
LoveyCom\CashFree\CashFreeServiceProvider::class,
- Run the command below to publish the package config file config/cashfree.php:
php artisan vendor:publish
- Open config/cashfree.php to edit neccessary parameters such as API Key ID and Secret Key.
'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
USAGE
- Edit the cashfree.php already published to your app config. Location:
config/cashfree.php
- Fill all the required details
- The cashfree api wrapper follows the cashfree payment gateway categories (Marketplace & PaymentGateway) - read more from their docummentation
- Under the Marketplace category, this wrapper provides you with the following classes and methods
checkBalance()-- endpoint /getBalancewithdraw($amount, $remark = "")-- endpoint /ces/v1/requestWithdrawalgetLedger($maxReturn = "", $lastReturnId = "")-- endpoint /ces/v1/getLedger?maxReturn=$maxReturn
status($orderId)-- endpoint /ces/v1/getOrderSettlementStatus/$orderId
importTransaction($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/detachVendor
create($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 /transferVendorBalance
- The PaymentGateway has the following classes and methods
create($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/status
create($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/refunds
getAll($startDate, $endDate, $lastId = "", $count = "")-- endpoint /api/v1/settlementsgetOne($settlementId)-- endpoint /api/v1/settlement
retreive($startDate = "", $endDate = "", $txStatus = "", $lastID = "", $count = "")-- endpoint /api/v1/transactions
- To use the Order class of the PaymentGateway Category,
//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
Contributing
Thank you for your interest, here are some of the many ways to contribute.
- Check out our contributing guide
Security
If you discover any security related issues, please email info@plustech.com.ng instead of using the issue tracker.
License
This software is released under the MIT License.
loveycom/cashfree 适用场景与选型建议
loveycom/cashfree 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18.14k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2019 年 09 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 loveycom/cashfree 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 loveycom/cashfree 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 18.14k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 16
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-11