zerkxubas/esewa-laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

zerkxubas/esewa-laravel

Composer 安装命令:

composer require zerkxubas/esewa-laravel

包简介

This package makes the integration of Esewa payment gateway easier.

README 文档

README

This package is for Laravel Framework making super easy for developers to integrate the eSewa payments into Laravel Application and use instantly. For more details read Official eSewa Documentation.

Installation

Install this Package – Using Composer.

Composer Installation

composer require zerkxubas/esewa-laravel

Sail Installation

sail composer require zerkxubas/esewa-laravel

Publishing The Configurations

php artisan vendor:publish --tag=esewa

This will publish esewa.php inside the config directory of your laravel project.

.env Settings [ Development Mode ]

inside the .env file use these below config values for quick setup. For, Production Mode ensuure you set ESEWA_DEBUG_MODE=false & use The Production ESEWA_API_URL and also the ESEWA_MERCHAND_CODE in .env file

ESEWA_API_URL=https://uat.esewa.com.np
ESEWA_DEBUG_MODE=true
ESEWA_MERCHANT_CODE=EPAYTEST
ESEWA_SUCCESS_URL="http://localhost/order/success"
ESEWA_FAILURE_URL="http://localhost/payment/failure"

NOTE: i prefer to use the Sail environment for development so the url seems to be without any port here in my .env but you can specify any url which works for you.

Quick Examples

Easily Create an eSewa Portal Payment Checkout

In this method i have made it super simpler & easier to implement & use instantly in laravel projects. Use like the below example code inside your controller and this will take the user to the esewa payment portal.

// use the namespace
use Zerkxubas\EsewaLaravel\Facades\Esewa;

// Directly use like this inside the controller function code.
return Esewa::checkout($paymentID,$totalAmount,$taxAmount,$serviceCharge,$deliveryCharge);

Dont Forget To Create The Success & Failure Route

Parameters

  1. pid => paymentID
  2. amt => totalAmount
  3. txAmt => taxAmount
  4. psc => serviceCharge
  5. pdc => deliveryCharge

Testing Credentials

Default credentials provided by esewa for testing or development purpose.

eSewa ID: 9806800001/2/3/4/5

Password: Nepal@123

Token: 123456

Verify Payment

To verify our payments status this is super simpler & easier just use like this and you are good to go.

// use the namespace
use Zerkxubas\EsewaLaravel\Facades\Esewa;

// Taking the get request return parameters.
$paymentID = $_GET['oid'];
$transactionAmount = $_GET['amt'];
$refrenceID = $_GET['refId'] ;

// Verifying the Esewa Payment, [ returns, Either true or false ]
$paymentStatus = Esewa::verifyPayment($refrenceID,$paymentID,$transactionAmount);

if ($paymentStatus) {
    // Success payment.
}

License

This package is open-sourced & free to use licensed under the MIT license.

Additional

Reading esewa official documentation is highly recommended as there might be new changes in future so its crucial for a developer to be updated with the latest changes.

zerkxubas/esewa-laravel 适用场景与选型建议

zerkxubas/esewa-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 149 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 02 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「payment」 「laravel」 「esewa」 「nepal」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 zerkxubas/esewa-laravel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 zerkxubas/esewa-laravel 我们能提供哪些服务?
定制开发 / 二次开发

基于 zerkxubas/esewa-laravel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 149
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 19
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-17