Adding New Payment Provider
If your favorite payment provider is not supported out of the box, you can easily implement it in SaaSykit.
SaaSykit offers a simple payment interface (contract) that you can implement in your application to support any payment provider you want.
Here is a list of the steps you need to follow to implement a new payment provider:
- Create a new class that implements the
App\Services\PaymentProviders\PaymentProviderInterface
interface. (You can find an example of how to implement the contract in theApp\Services\PaymentProviders\Stripe\StripeProvider
class). - Register your payment provider in
app/Providers/AppServiceProvider.php
.$this->app->tag([
StripeProvider::class,
PaddleProvider::class,
LemonSqueezyProvider::class,
YourNewPaymentProvider::class,
], 'payment-providers'); - Add your new payment method in the database seeders in
database/seeders/PaymentProvidersSeeder.php
(see the existing seeder definitions there for examples). - If your payment provider send webhook events, then you will need to add a controller to handle these events. You can find an example of how to handle Stripe webhook events in the
App\Http\Controllers\PaymentProviders\StripeController
class. - (optional) You might want to implement a settings/credentials page for your new payment provider on the admin panel. You can find an example of how to implement the settings page in the
app/Filament/Admin/Resources/PaymentProviderResource/Pages/StripeSettings.php
class.
That's it! You have now implemented a new payment provider in SaaSykit. You can now enable it in the admin panel and start accepting payments from your customers using your new payment provider.