Laravel Cashier Paystack simplifies subscription management for developers. With a fluent interface, it handles the complexity of integrating Paystack's billing services, allowing you to focus on building your application. Streamline your payment processes and enhance user experience with minimal hassle.
Laravel Cashier Paystack
Laravel Cashier Paystack provides a fluid and intuitive interface for integrating Paystack's subscription billing services into your Laravel applications. This powerful package simplifies the process by handling most of the tedious subscription billing code, allowing developers to focus on building their projects without getting bogged down by payment processes.
composer require veekthoven/laravel-cashier-paystack
newSubscription, subscribed, and cancel.To start using Laravel Cashier Paystack, publish your configuration file which includes essential parameters such as your Paystack public and secret keys, merchant details, and the user model for customers. Here’s how you can publish the configuration file:
php artisan vendor:publish --provider="veekthoven\Cashier\CashierServiceProvider"
You can create a subscription with just a few lines of code. Here’s a quick example:
$user = User::find(1);
$plan_name = 'default';
$plan_code = 'PLN_gx2wn530m0i3w3m';
$auth_token = 'customer_auth_token';
$user->newSubscription($plan_name, $plan_code)->create($auth_token);
For one-off payments, the package provides a straightforward charging method:
$user->charge(10000); // charges in lowest currency denomination
You can also generate invoices or handle refunds with ease.
Creating and managing customer details is also part of the package's strengths. It includes methods like createAsCustomer() to register new customers directly within Paystack without initiating a subscription right away.
By utilizing Laravel Cashier Paystack, developers can implement robust subscription management features while leveraging Paystack's functionalities, providing users with a smooth and responsive billing experience.
No comments yet.
Sign in to be the first to comment.