In Part-162 of Advance E-commerce series, we will continue working on integrating Payumoney Payment Gateway in our website.
In this video, we will make Payumoney dynamic with actual order.
We will also work on Payumoney response. If user successfully makes payment then we will update the order status with "Paid" and will send order confirmation email to user.
For getting Payumoney response after making transaction with test card, client need to register with PayUmoney website and can get credentials after activating the account.
Recently PayUMoney has changed their process. This is for both production and sandbox. To start with website integration, we need an active account. So get your account activated. After that you can start integration.
Once your account is active, you can test your integration code. It will work. You can start receiving payments as well.
But in this video, we presume that our account has been activated by Payu and will add success condition to test it.
1) Update payumoneyPayment function
We will update payumoneyPayment function to get the order details to return them to payumoney payment gateway.
2) Add Header Statements :-
Add below statements at top of PayumoneyController to include Order model and Session :-
use Session;
use App\Order;
Now actual order with order id and amount is going to Payumoney payment gateway.
Now, we will work on Payumoney response. If user successfully makes payment then we will update the order status with "Paid" and will send order confirmation email to user.
3) Create Route :-
We will create route for payumoney response in web.php file like below :-
Route::post('payumoney/response','PaymentController@payumoneyResponse');
4) Create payumoneyResponse function :-
Now we will create payumoneyResponse function in which we will check payumoney response status is success or not. If success then we will update order with "Payment Captured" status and will send order confirmation email to user. And if fail then we will update order status to "Payment Fail".
5) Update indipay.php file :-
We will resolve CSRF token error by update indipay.php file with response link payumoney/response as shown in video.
6) Create Routes for Payumoney success and fail pages :-
Create Get route for Payumoney success and fail pages in web.php file like below :-
// Payumoney Success
Route::get('/payumoney/success','PayumoneyController@success');
// Payumoney Fail
Route::get('/payumoney/fail','PayumoneyController@fail');
7) Create success and fail functions :-
Now create success and fail functions in PayumoneyController file :-
8) Create success.blade.php and fail.blade.php files :-
Finally, we will create success.blade.php and fail.blade.php files in payumoney folder same like Paypal.
Now we will test if payment is successful then payumoney success page will come and if payment fails then fail page will come.
Join this channel to get complete sourc code:
https://www.youtube.com/channel/UCExO...
Saturday, September 24, 2022
Integrate Payumoney in Laravel (I) | Install Indipay Package | Debit/Credit Cards / Banks / Wallets
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...
Subscribe to:
Posts (Atom)