定制 turndale/paystack 二次开发

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

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

turndale/paystack

最新稳定版本:v1.2.2

Composer 安装命令:

composer require turndale/paystack

包简介

A Laravel Package for Paystack payment integration for laravel 11 and above

README 文档

README

A robust, Cashier-like Paystack integration package for Laravel 11+. This package provides an expressive, fluent interface to Paystack's subscription billing services, handling boilerplate subscription code so you can focus on building your application.

Latest Version on Packagist Total Downloads License

Documentation

For full documentation, usage guides, and API reference, please visit:

https://paystack.stephenasare.dev/

Features

  • Complete API Wrapper: Fluent interface for all Paystack API resources (Transactions, Subscriptions, Customers, etc.).
  • Webhooks: Automatic handling of Paystack webhooks with event dispatching.
  • Type Safety: Fully typed responses and resources.
  • Testing: Fully tested with PHPUnit and Orchestra Testbench.

Requirements

  • PHP 8.2+
  • Laravel 11.0+

Installation

You can install the package via composer:

composer require turndale/paystack

After installing, publish the configuration file:

php artisan vendor:publish --tag=paystack-config

Add your Paystack keys to your .env file:

PAYSTACK_PUBLIC_KEY=pk_test_xxxx
PAYSTACK_SECRET_KEY=sk_test_xxxx
PAYSTACK_PAYMENT_URL=https://api.paystack.co

Quick Start

1. Use the Facade

You can access any Paystack resource using the Paystack facade.

use Turndale\Paystack\Facades\Paystack;

// Initialize a transaction
$response = Paystack::transaction()->initialize([
    'email' => 'customer@email.com',
    'amount' => 5000 // NGN 50.00
]);

return redirect($response['data']['authorization_url']);

2. Manage Subscriptions

// Create a subscription
Paystack::subscription()->create([
    'customer' => 'CUS_xxxx',
    'plan' => 'PLN_xxxx'
]);

3. Transaction Splits

// Create a split
Paystack::transactionSplit()->create([
    'name' => 'Percentage Split',
    'type' => 'percentage',
    'currency' => 'NGN',
    'subaccounts' => [
        ['subaccount' => 'ACCT_xxxx', 'share' => 20]
    ]
]);

Webhooks

The package automatically handles Paystack webhooks for you. Just set up your webhook URL in the Paystack Dashboard to point to:

https://your-domain.com/paystack/webhook

You can listen to events in your application:

use Turndale\Paystack\Events\PaymentSuccess;

Event::listen(PaymentSuccess::class, function ($event) {
    // Handle successful payment...
});

Contributing

Please see CONTRIBUTING.md for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

MIT

Support

If you find this package helpful, please consider:

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固