承接 freelancernishad/laravel-ekpay 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

freelancernishad/laravel-ekpay

最新稳定版本:v1.0.2

Composer 安装命令:

composer require freelancernishad/laravel-ekpay

包简介

Ekpay Payment Gateway integration for Laravel

README 文档

README

A reusable and extensible Laravel package for integrating the Ekpay Payment Gateway. Built for flexibility across any project type (E-commerce, School Management, SaaS, etc.).

Features

  • Project Agnostic: Link payments to any model (Order, StudentFee, Subscription) using polymorphic relations.
  • Extensible: Override default models and add custom database fields via configuration.
  • Detailed Logging: Every request, response, and IPN payload is logged for auditing.
  • Event-Driven: Dispatches events upon payment success/failure for easy business logic integration.

Installation

  1. Install the package via composer:
composer require freelancernishad/laravel-ekpay
  1. Publish the config and migrations:
php artisan vendor:publish --tag=ekpay-config
php artisan vendor:publish --tag=ekpay-migrations
  1. Run the migrations:
php artisan migrate

Configuration

Add your Ekpay credentials to your .env file:

AKPAY_MER_REG_ID=your_reg_id
AKPAY_MER_PASS_KEY=your_pass_key
AKPAY_API_URL=https://sandbox.ekpay.gov.bd/ekpaypg/v1
AKPAY_IPN_URL=https://your-domain.com
WHITE_LIST_IP=your_server_ip

Basic Usage

Controller Example

use FreelancerNishad\Ekpay\Services\EkpayService;

public function checkout(EkpayService $ekpayService)
{
    $trns_info = [
        "trnx_amt" => 100,
        "trnx_currency" => "BDT",
        "trnx_id" => "ORDER_" . uniqid(),
        "ord_det" => "Payment for Order #123",
    ];

    $cust_info = [
        "cust_email" => "customer@example.com",
        "cust_name" => "John Doe",
        "cust_mobo_no" => "017XXXXXXXX",
    ];

    $result = $ekpayService->initiatePayment($trns_info, $cust_info);

    return redirect()->to($result['payment_url']);
}

Advanced Usage & Customization

Adding Extra Fields (Meta Data)

You can pass additional data using the meta field. This data is saved as JSON in the database.

$meta = [
    'student_id' => 101,
    'month' => 'May',
    'year' => 2026
];
$ekpayService->initiatePayment($trns_info, $cust_info, [], $meta);

Overriding Models

If you want to add actual database columns to the logs:

  1. Create a migration to add columns to ekpay_logs.
  2. Create a model that extends the package model:
namespace App\Models;
use FreelancerNishad\Ekpay\Models\EkpayLog as BaseLog;

class CustomEkpayLog extends BaseLog {
    protected $fillable = ['user_id', 'trnx_id', 'my_custom_column', ...];
}
  1. Update config/ekpay.php:
'models' => [
    'log' => \App\Models\CustomEkpayLog::class,
],

Listening for Success

Register a listener for FreelancerNishad\Ekpay\Events\EkpayPaymentEvent to handle logic after payment is confirmed.

License

The MIT License (MIT).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固