starfolksoftware/paysub
Composer 安装命令:
composer require starfolksoftware/paysub
包简介
Provides an inteface to paystack's subscription service
关键字:
README 文档
README
Paysub offers basic subscription management for laravel applications. Currently supports only paystack for payment.
Developer Preview [Do not user in production]
This project is in Developer Preview stage, All API's might change without warning and no guarantees are given about stability. Do not use it in production.
Installation
You can install the package via composer:
composer require starfolksoftware/paysub
Run the migrations with:
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --provider="StarfolkSoftware\Paysub\PaysubServiceProvider" --tag="config"
This is the contents of the published config file:
<?php return [ /* |-------------------------------------------------------------------------- | Paystack Keys |-------------------------------------------------------------------------- | | The Paystack publishable key and secret key give you access to Paystack's | API. The "publishable" key is typically used when interacting with | Paystack.js while the "secret" key accesses private API endpoints. | */ 'key' => env('PAYSTACK_KEY'), 'secret' => env('PAYSTACK_SECRET'), /* |-------------------------------------------------------------------------- | Paystack Subscription Path |-------------------------------------------------------------------------- | | This is the base URI path where Paystack Subscription's views, such as the payment | verification screen, will be available from. You're free to tweak | this path according to your preferences and application design. | */ 'path' => env('PAYSUB_SUBSCRIPTION_PATH', 'paysub'), /* |-------------------------------------------------------------------------- | Paystack Subscription Model |-------------------------------------------------------------------------- | | This is the model in your application that implements the Billable trait | provided by Paystack Subscription. It will serve as the primary model you use while | interacting with Paystack Subscription related methods, subscriptions, and so on. | */ 'subscriber_model' => env('PAYSUB_SUBSCRIPTION_MODEL', class_exists(App\Models\User::class) ? App\Models\User::class : App\User::class), /* |-------------------------------------------------------------------------- | Tables' names |-------------------------------------------------------------------------- | | Define the package's table names here | */ 'subscriber_table_name' => env('PAYSUB_SUBSCRIBER_TABLE', 'users'), 'subscription_table_name' => env('PAYSUB_SUBSCRIPTION_TABLE', 'paysub_subscriptions'), 'plan_table_name' => env('PAYSUB_PLAN_TABLE', 'paysub_plans'), 'authorization_table_name' => env('PAYSUB_AUTHORIZATION_TABLE', 'paysub_authorizations'), 'invoice_table_name' => env('PAYSUB_INVOICE_TABLE', 'paysub_invoices'), 'payment_table_name' => env('PAYSUB_PAYMENT_TABLE', 'paysub_payments'), 'card_table_name' => env('PAYSUB_CARD_TABLE', 'paysub_cards'), 'auth_table_name' => env('PAYSUB_AUTH_TABLE', 'paysub_authorizations'), /* |-------------------------------------------------------------------------- | Currency |-------------------------------------------------------------------------- | | This is the default currency that will be used when generating charges | from your application. Of course, you are welcome to use any of the | various world currencies that are currently supported via Paystack. | */ 'currency' => env('PAYSUB_CURRENCY', 'NGN'), /* |-------------------------------------------------------------------------- | Taxes |-------------------------------------------------------------------------- | | Tax definitions for invoice. | */ 'invoice_taxes' => [ // ['name' => 'VAT', 'percentage' => 7.5] ], /* |-------------------------------------------------------------------------- | Company Contact Detail |-------------------------------------------------------------------------- | | Contact details for the billable. This will be shown in invoices sent | to billables. | */ 'contact_detail' => [ 'vendor' => '', 'street' => '', 'location' => '', 'phone' => '', 'url' => '', 'vatInfo' => '', ], /* |-------------------------------------------------------------------------- | Invoice Paper Size |-------------------------------------------------------------------------- | | This option is the default paper size for all invoices generated using | Paystack Subscription. You are free to customize this settings based on the usual | paper size used by the customers using your Laravel applications. | | Supported sizes: 'letter', 'legal', 'A4' | */ 'paper' => env('PAYSUB_PAPER', 'letter'), /* |-------------------------------------------------------------------------- | Paystack Logger |-------------------------------------------------------------------------- | | This setting defines which logging channel will be used by the Paystack | library to write log messages. You are free to specify any of your | logging channels listed inside the "logging" configuration file. | */ 'logger' => env('PAYSUB_LOGGER'), ];
Usage
<?php ... StarfolkSoftware\Paysub\Traits\CanBeBilled; class User extends Model { use CanBeBilled; public function paystackEmail(): string { return 'user@example.com'; } public function invoiceMailables(): array { return [ 'user@example.com' ]; } }
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Road Map
- Multiple plans support
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
starfolksoftware/paysub 适用场景与选型建议
starfolksoftware/paysub 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.41k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2021 年 04 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「starfolksoftware」 「paysub」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 starfolksoftware/paysub 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 starfolksoftware/paysub 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 starfolksoftware/paysub 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A simple and straighforward package to categorize models in your Laravel applications
A simple and straightforward Laravel user permissions package.
A simple and straightforward package to manage and assign taxes to models in your laravel applications
Manage contacts(e.g customers, suppliers, vendors etc) and addresses in your laravel applications.
A Laravel package to manage transaction documents.
Make calendar events recurrable in your Laravel applications
统计信息
- 总下载量: 1.41k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-04-08
