mojahed/edupluspgw 问题修复 & 功能扩展

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

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

mojahed/edupluspgw

最新稳定版本:1.0.1

Composer 安装命令:

composer require mojahed/edupluspgw

包简介

Eduplus Payment Gateway SDK for PHP.

README 文档

README

License: MIT

EduplusPGW is a lightweight PHP SDK for integrating with the Eduplus Payment Gateway (PGW). It allows you to generate payment URLs and retrieve payment session details easily using Guzzle HTTP.

Installation

Install via Composer:

composer require mojahed/edupluspgw

Usage

  1. Initialize with API key and create a payment URL:
<?php
use Mojahed\EduplusPGW;

$apiKey = 'your_api_key_here';
$gateway = 'bkash'; // supported gateways: bkash, rocket, etc.

$data = [
    'amount'          => 1000.50,
    'customer_name'   => 'John Doe',
    'customer_phone'  => '017XXXXXXXX',
    'customer_email'  => 'john@example.com',
    'customer_address'=> 'Dhaka, Bangladesh',
    'product_name'    => 'Tuition Fee',
    'reference'       => 'ST12345',
    'callback_url'    => 'https://your-site.com/payment/callback',
    'metadata'        => [
        'student_id' => 'ST12345',
        'year'       => 2025,
        'month'      => '10',
    ]
];

$eduplusPgw = EduplusPGW::of($apiKey, $gateway);
// Create payment URL
$response = $eduplusPgw->getPaymentUrl($data);

if ($response) {
    echo "Redirect the user to: " . $response['payment_url'];
} else {
    print_r($eduplusPgw->errors);
}
  1. Retrieve Payment Session
$sessionId = 'EPGW_SESSION_ID';
$eduplusPgw = EduplusPGW::of($apiKey, $gateway);
$sessionData = $eduplusPgw->getPaymentSession($sessionId);

if ($sessionData) {
    print_r($sessionData);
} else {
    print_r($eduplusPgw->errors);
}

API Methods

  • apiKey($apiKey) Set your API key.

  • of($apiKey, $gateway) Convenience method to set API key and gateway in one call.

  • gateway($gateway) Set the payment gateway (e.g., 'bkash', 'rocket').

  • getPaymentUrl(array $data) Sends a request to create a payment URL for the specified gateway. Returns the array of payment_url if successful, null on failure.

  • getPaymentSession(string $session) Retrieves payment session details by session ID. Returns an array of payment session data if successful, null on failure.

  • $errors Array containing error messages from the last request.

Requirements

  • PHP 7.4+
  • guzzlehttp/guzzle ^7.0

Author

Md Mojahedul Islam Email: dev.mojahedul@gmail.com Website: https://md-mojahed.github.io

License

MIT License

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-20