Download the PHP package ogunsakindamilola/laravel-interswitch without Composer
On this page you can find all versions of the php package ogunsakindamilola/laravel-interswitch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ogunsakindamilola/laravel-interswitch
More information about ogunsakindamilola/laravel-interswitch
Files in ogunsakindamilola/laravel-interswitch
Package laravel-interswitch
Short Description A laravel package for Interswitch
License MIT
Informations about the package laravel-interswitch
laravel-interswitch
A laravel package for Interswitch
Installation
PHP ^7.4|^8.0, and Composer are required.
To get the latest version of Laravel Interswitch, simply require it
Configuration
You can publish the configuration file using this command:
Then select ogunsakin01/laravel-interswitch
A configuration-file named interswitch.php
with some sensible defaults will be placed in your config
directory:
Open your .env file and add the following
INTERSWITCH_ENV=can be set to either
LIVEor
TEST.
INTERSWITCH_GATEWAY=can be set tot either
WEBPAYor
PAYDIRECT. The redirect URL must be a get url declared in your route where you wish to redirect to when a payment process is complete. Make sure this route is defined in your web.php as a
GET` route. Make sure to replace the other env variables withe the details you received from Interswitch.
While still in your env file, make sure you set up your database environment
Replace the variables with your database connection variables the run
php artisan migrate`. When the migration is complete. Return to your env file and set up your mailing environment
` When this is done, then you can proceed to using this package.
Usage
Interswitch requires you to follow some specific steps when implementing their payment gateway
1 Initiate transaction
This initiate transaction sends a post request to the payment gateway and redirects to the payment page
2 Customer Prepayment Notification Email
You are meant to send a prepayment notification email to your customers informaing them about the transaction they are about to make.
3 Store Transaction Details
You are suppose to store all transactions in db even before they are completed
4 Payment Confirmation Notification Email
You must send a payment confirmation email to your customer stating whether the transaction was successful or not and stating your reasons.
5 Transaction Logs Table and Requery
Interswitch requires that you have a page where all transactions are displayed and that you have a requery button which can be used to reconfirm the status of the transaction.
Phew, life hard. Writing that out alone is exhausting, I can imagine how implementing it will feel like. Don't worry, I know exactly how it feels. Well, on this package, all you have to do is add this on your payment page.
If you wish to use a transaction reference defined by you, simply add <input type="hidden" name="reference" value="87YYUIJIJ" />
to the filed you are sending .
That's it, when the pay button is clicked, all the dirty work is done for you behind the scene. When the payment is complete, you will be redirected to the INTERSWITCH_REDIRECT_URL=
you set in your .env with the following query parameters
``
To view your transaction logs, go to this route
That's it, you are good to go
Now that you are here
Thank you for taking your time with my package.
All versions of laravel-interswitch with dependencies
illuminate/support Version ^8.0
doctrine/dbal Version ^2.10
laravel/legacy-factories Version ^1.1