Bagisto Paystack Integration
Bagisto Paystack Integration
TECHNICAL
DOCUMENTATION
Oluwatobi Odekunle,
Lead Developer.
Payment Integration
A payment gateway is a merchant service provided by an e-commerce application
service provider that authorizes credit card or direct payments processing for e-
businesses, online retailers, bricks and clicks, or traditional brick and mortar.
src/
config/
Paymentmethods.php
System.php
facades/
payment.php
Http/
Helpers.php
Payment/
CashOnDelivery.php
MoneyTransfer.php
Payment.php
Providers/
PaymentServiceProviders.php
Payment.php
Composer.json
You do not have to update this package except you want to add a new payment
gateway eg. Paystack.
For your new payment method e.g Paystack to show on the front end, you have to do
some configurations. All these configurations are done inside the config folder
(Paymentmetods.php and system.php) are the files you need to update to register your
payment method.
Follow the below tutorial to create a new payment method.
I followed the instructions on how to use the library to connect my application with
paystack but unfortunately I could not get it done just because the way WebKul
structured their payment method (PayPal) is different and you have to follow their own
way of creating a package just like PayPal in order to get it to work. The main reason is
to not break the exisiting code.
I tried creating a package with the files gotten from the library but could not get it done
until I developed my own package from scratch.
A new created Paystack Package
Yes, I had to create a new package called Paystack which is now part of WebKul
packages and configured it to work with the application without breaking any code yet.
2. Registered the package: Inside the config folder, a file named app.php and I
registed the package by adding this to providers:
Webkul\Paystack\Providers\PaystackServiceProvider::class,
3. Updated the composer.json file by modifying the autoload property:
"autoload": {
"psr-4": {
"Webkul\\Paystack\\": "src/"
},
"laravel": {
"providers": [
"Webkul\\Paystack\\Providers\\PaystackServiceProvider"
],
"aliases": {}
},
'paystack_standard' => [
'sort' => 4,
],
[
'key' => 'sales.paymentmethods.paystack_standard',
'sort' => 4,
'fields' => [
], [
], [
], [
], [
], [
'name' => 'sort',
'options' => [
'value' => 1,
], [
'value' => 2,
], [
'value' => 3,
], [