定制 ib/ib-wallet 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

ib/ib-wallet

Composer 安装命令:

composer require ib/ib-wallet

包简介

Complete package for all types of payment gateways for Nepal

README 文档

README

This Laravel Package facilitates creating payments across multiple Nepalese wallets such as Khalti, eSewa, and more, offering versatile payment options in Nepal. This support latest version of any package

How to contribute

If you want to contribute this project.

Support Wallet

  • Khalti : working
  • Esewa : working
  • Parbhu Pay : coming
  • Ime Pay : coming
  • My Pay : coming

Using Example

Using Composer

composer require ib/ib-wallet

Publish Vendor File

php artisan vendor:publish --provider="Ib\IbWallet\IbWalletServiceProvider"

or

php artisan vendor:publish

using

use IbWallet;
or
use Ib\IbWallet\IbWallet;

paste in the controller

for Khalti

set env file (Here is a sample example)

  • mode 0 for development
  • mode 1 for production
KHALTI_CALLBACK_URL=http://127.0.0.1:8000/khalti-callback 
KHALTI_MODE=0
KHALTI_SECRET_KEY=

for khalti marchent

 // if you have amount in rs, then you can use IbWallet::Khaltiamount('amount in rs'), this will response in paisa.
$payload = [
'amount' => 1000, // in paisa
'purchase_order_id' => '123456710', // most in unique
'purchase_order_name'=> 'test prod', // unique but not mendotary
'name'=> 'test bahadur', 
'phone'=> '01912345678',
'email'=> 'test@gmail.com',
'callback_url' => "http://127.0.0.1:8000/khalti-callback" // optional if you wnat to redirect custom url
];
// initate the payment to process the khalti payment
$initate_payment = IbWallet::khalti($payload);
// after initate payment. call checkout method to hit the checkout method
$checkout = IbWallet::KhaltiCheckout($initate_payment);
// this will redirect to khalti checkout section to fullfill the payment 
return $checkout;
//if your payment success then you auto redirect in callback url which you already set in env file.

if you have amount in rs, then you can use IbWallet::Khaltiamount('amount in rs'), this will response in paisa.

$amount = IbWallet::Khaltiamount('amount in rs');

after successful payment and redirect on callback url which you already set in env file. then you can use get metod to print response or ib wallet provide a function for it. for print response

   //print khalti response after redirect success payment. 
   // here you can autometic redirect
   $response = IbWallet::KhaltiResponse();

for esewa

set the env file as seen

  • mode 0 for development
  • mode 1 for production
  • this secret key and product code only used on development, for production you need to contact with esewa
ESEWA_PRODUCT_CODE=EPAYTEST
ESEWA_MODE=0
ESEWA_FAILURE_URL=http://127.0.0.1:8000/esewa-fail
ESEWA_SUCCESS_URL=http://127.0.0.1:8000/esewa-success
ESEWA_SECRET_KEY=8gBm/:&EnhH.1/q

in controller

  • DO not change the signature field.
$paylod =[
       'amount' => 1000, // in amount 
       'product_delivery_charge' => 0,
       'product_service_charge' => 0,
       'signed_field_names' =>"total_amount,transaction_uuid,product_code", // set signature field name, signature field auto generate
       'tax_amount' =>0,
       'total_amount' => 1000,
       // 'failure_url' =>"http://127.0.0.1:8000/esewa-fail" , // optional if you want to redirect to other page
       // 'success_url' =>"http://127.0.0.1:8000/esewa-success", // optional if you want to redirect to other page
       'transaction_uuid' => Str::random(20), // must be unique
   ];
return IbWallet::Esewa($paylod);

after success and falure payment you will auto redierect success and failure url which is set on .env file. Define the method like this

public function esewa_success(Request $request){
    // print your response
    // save your work on database or continue your work
    //dd($request->all());
     $response = IbWallet::EsewaResponse($request->all());
        // dd($response);
       print_r($response);
}

public function esewa_fail(Request $request){
    // print your response
    dd($request->all());
}

Lisence

MIT

Author

  • Indra Basnet

Support and FeedBack

email : basnetindra342@gmail.com

ib/ib-wallet 适用场景与选型建议

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

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-03