Tags: e-commerce, magicway, payment-gateway, checkout, shop, cart, local-payment-gateway, international-payment-gateway
Requires: PHP >= 7.2, Laravel >= 6.0 and MySQL
License: MIT
|-- config/
|-- magic_way.php
|-- app/Library/MoMagic
|-- MoMagicAbstraction.php (core file)
|-- MoMagicInterface.php (core file)
|-- MoMagicConnector.php (core file)
|-- README.md
|-- orders.sql
-
Step 1: Download and extract the library files.
-
Step 2: Copy the
Library
folder and put it in the laravel project'sapp/
directory. If needed, then runcomposer dump -o
. -
Step 3: Copy the
config/magic_way.php
file into your project'sconfig/
folder.
Now, we have already copied the core library files. Let's do copy some other helpers files that is provided to understand the integration process. The other files are not related to core library.
-
Optional: If you later encounter issues with session destroying after redirect, you can set
'same_site' => null,
in yourconfig/session.php
file. -
Step 4: Add
STORE_ID
,STORE_PASSWORD
,STORE_USER
andSTORE_EMAIL
values on your project's.env
file. -
Step 5: Copy the
MoMagicPaymentController
into your project'sControllers
folder. -
Step 6: Copy the defined routes from
routes/web.php
into your project's route file. -
Step 7: Add the below routes into the
$excepts
array ofVerifyCsrfToken
middleware.
protected $except = [ '/success','/fail','/cancel','/ipn' ];
- Step 8: Copy the
resources/views/*.blade.php
files into your project'sresources/views/
folder.
Now, let's go to the main integration part.
-
Step 9: Create a database and import the orders.sql table schema.
-
Step 10: For Checkout integration, you can update the MoMagicPaymentController->checkout() or use a different method according to your need. We have provided a basic sample from where you can kickstart the payment gateway integration.
-
Step 11: When user click Continue to checkout button, redirect customer to payment channel selection page.
-
Step 12: For redirecting action from MagicWay Payment gateway, we have also provided sample success(), fail(), cancel() and ipn() methods in MoMagicPaymentController. You can update those methods according to your need.
Arifur Rahman