elmmac/elmmac-paystack-sdk 问题修复 & 功能扩展

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

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

elmmac/elmmac-paystack-sdk

最新稳定版本:v1.0.0

Composer 安装命令:

composer require elmmac/elmmac-paystack-sdk

包简介

Lightweight procedural Paystack SDK by ElmMac with init, callback and webhook helpers.

README 文档

README

ElmMacPaystack is a lightweight PHP SDK for integrating Paystack into classic/procedural PHP projects. It handles initialize, callback and webhook flows, and logs full request/response payloads into a generic elmmacpaystackpayments table.

GitHub tag GitHub license GitHub issues GitHub stars

Packagist Version Packagist Downloads

Features

  • Simple PHP class wrapper around Paystack REST API
  • Initialize payments with custom metadata
  • Callback handler for success/failed payments
  • Optional webhook listener with signature verification
  • Request / response payload logging for debugging & analytics

Requirements

  • PHP 7.4+ (or higher)
  • cURL extension enabled
  • MySQL / MariaDB (for the example payments table)
  • A Paystack account with secret & public keys

Installation

  1. Copy src/ElmMacPayStack.php into your project (for example into a src/ or lib/ folder).
  2. Include the class in your bootstrap / init script:
require_once __DIR__ . '/src/ElmMacPayStack.php';

use ElmMacPaystack\ElmMacPayStack;

$paystack = new ElmMacPayStack('YOUR_PAYSTACK_SECRET_KEY');
  1. Create the elmmacpaystackpayments table using the SQL provided in database_table.sql (or adapt it to your schema).

Quick start

$payload = [
    'email'       => 'customer@example.com',
    'amount'      => 2500 * 100, // kobo
    'reference'   => uniqid('elmmac_', true),
    'callback_url'=> 'https://yourdomain.com/elmmacpaystack_callback.php',
    'metadata'    => ['user_id' => 123],
];

$response = $paystack->initialize($payload);

if ($response['status']) {
    header('Location: ' . $response['data']['authorization_url']);
    exit;
} else {
    // handle error
}

Then in your callback script you can:

// verify reference and update elmmacpaystackpayments

(See the example files in elmmacpaystack/ for init, callback, and webhook handlers.)

Roadmap

  • More helper methods (verify, refund, list transactions)
  • Framework-agnostic middleware snippets (Laravel, Symfony, etc.)
  • Better error handling & typed responses

Contributing

Pull requests and issues are welcome. Please open an issue first if you plan a bigger change so we can discuss direction.

License

This project is open-source. You can use the MIT license below or choose a different license that fits your needs.

🙏 Credits

Developed with 🚀 by ElmMac Pty Ltd
Maintained by @ElmMac - Misael Cruise MutegeWhatsApp: +27786411181 Durban, South Africa
Digital Dev | Hustler Mode: ON 💼

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-15