magicway / momagic-laravel
Laravel library for Magic way payment gateway
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
pkg:composer/magicway/momagic-laravel
Requires
- php: >=7.2
- laravel/framework: >=6.0
This package is auto-updated.
Last update: 2025-10-15 20:41:22 UTC
README
MagicWay Payment Gateway Integration - Laravel Library
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
Core Library Directory Structure
 |-- config/
    |-- magic_way.php
 |-- app/Library/MoMagic
    |-- MoMagicAbstraction.php (core file)
    |-- MoMagicInterface.php (core file)
    |-- MoMagicConnector.php (core file)
 |-- README.md
 |-- orders.sql
Instructions:
- 
Step 1: Download and extract the library files. 
- 
Step 2: Copy the Libraryfolder and put it in the laravel project'sapp/directory. If needed, then runcomposer dump -o.
- 
Step 3: Copy the config/magic_way.phpfile 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.phpfile.
- 
Step 4: Add STORE_ID,STORE_PASSWORD,STORE_USERandSTORE_EMAILvalues on your project's.envfile.
- 
Step 5: Copy the MoMagicPaymentControllerinto your project'sControllersfolder.
- 
Step 6: Copy the defined routes from routes/web.phpinto your project's route file.
- 
Step 7: Add the below routes into the $exceptsarray ofVerifyCsrfTokenmiddleware.
protected $except = [ '/success','/fail','/cancel','/ipn' ];
- Step 8: Copy the resources/views/*.blade.phpfiles 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. 
Contributors
Arifur Rahman