In Part-161 of Advance E-commerce series, we will start working on integrating Payumoney Payment Gateway in our website. Payumoney Payment gateway will allow Indian users to make payment with their banks, debit card, credit card, wallets, UPI and lot more options.
We will install Laravel softon/indipay package that will support Indian Payment Gateways. like CCAvenue, PayUMoney, EBS, CitrusPay, InstaMojo etc. And, we will configure PayUMoney after installing the package.
Step 1: Install package using composer
composer require softon/indipay
Some of the time "Allowed memory size of 1610612736 bytes exhausted" error comes then run below command with composer :-
COMPOSER_MEMORY_LIMIT=-1 composer require softon/indipay
Step 2: Publish the config & Middleware by running in your terminal
php artisan vendor:publish --all
or
php artisan vendor:publish --provider="Softon\Indipay\IndipayServiceProvider"
Step 3: Modify the app\Http\Kernel.php to use the new Middleware. This is required so as to avoid CSRF verification on the Response Url from the payment gateways. You may adjust the routes in the config file config/indipay.php to disable CSRF on your gateways response routes.
Step 4: Update indipay.php
Replace with the name of default gateway with PayUMoney
Also, we require test merchant key and salt for integrating Payumoney test payment gateway.
Step 5: Integrate Test Payumoney account :-
Search for keyword "payu Web Integration FAQ" in Google and open below link :-
https://testdeveloper.payubiz.in/docu...
For the Test environment, below are the credentials :
Merchant ID : gtKFFx
Salt : eCwWELxi
We will update indipay.php file and add Payumoney test merchant key and salt.
Step 6: Update checkout.blade.php file :-
We will add radio button for Payumoney payment gateway with value payumoney as well in checkout.blade.php file.
Step 7: Update checkout function
Update checkout function to add condition for Payumoney payment gateway as well so that user will redirect to payumoney page.
Step 8: Create PayumoneyController
We will create PayumoneyController by running below artisan command where we will create all payumoney related functions.
php artisan make:controller Front/PayumoneyController
Step 9: Create Route :-
We will create GET route for payumoney like below :-
//Payumoney Page
Route::get('payumoney','PayumoneyController@payumoneyPayment');
Step 10: Create payumoneyPayment function :-
Now we will create payumoneyPayment function where we will send test parameters first to check if payumoney works fine or not.
Step 11: Include Header Statement :-
Now add below statement at the top of PayumoneyController :-
use Softon\Indipay\Facades\Indipay;
Step 12: Update PayUMoneyGateway.php
Comment service_provider statement as shown in video.
Step 13: Update payumoney.blade.php
Update payment form in payumoney.blade.php by removing udf and pg fields as shown in video.
Now Payumoney payment gateway must work fine.
In next video, we will make it dynamic with actual order. Right now we are passing test parameters but in next video we will pass order parameters.
Join this channel to get complete code/support:
https://www.youtube.com/channel/UCExO...
No comments:
Post a Comment