eSewa is a digital payment service provider based in Nepal. It allows users to make various types of online transactions such as mobile recharge, bill payment, ticket booking, online shopping, and money transfer through its platform. eSewa is an easy-to-use and secure platform that provides a convenient way for Nepali users to carry out their financial transactions digitally without the need for physical cash.
eSewa can also be integrated with business websites to facilitate online payments. By integrating eSewa’s payment gateway, businesses in Nepal can offer their customers a secure and convenient way to make payments online. This not only enhances the customer experience but also helps businesses streamline their payment processes and reduce operational costs associated with manual payment handling. Overall, eSewa’s integration with business websites makes it a valuable tool for businesses of all sizes in Nepal looking to expand their online presence and offer a seamless payment experience to their customers.
Read Also: Step by Step installation guide to create first project in laravel
Is Esewa API free?
No, Esewa API is not free but you can test it for free.
How much does esewa API integration cost?
Esewa API integration cost around 15k to 20k NPR one time fee depending on business type.
What are the payment methods of eSewa?
The payment methods of eSewa is payment from eSewa wallet. Its competitor Khalti supports payment from banks and cards along with wallet.
Steps to integrate eSewa in Laravel 10:
- Install cixware/esewa-php-sdk package into your Laravel project using the command composer require cixware/esewa-php-sdk. You can find the official documentation of the package in this link: https://packagist.org/packages/cixware/esewa-php-sdk
- Configure your credentials in .env file. The requirements for setting up eSewa are:
- Merchant code provided by eSewa. You can get the merchant code by signing up for the eSewa merchant form. The link is provided below. https://merchant.esewa.com.np/auth/register-merchant
- Your environment for eSewa. During development and testing purposes, the environment is development, and after deployment, the environment is production. Based on this environment, eSewa redirects the users when they choose to pay.
- After setting up the environment, the next step is to provide the success and failure path. After the payment is successful, eSewa redirects to the respective URL.
- After this, set up the new client and your eSewa controller as below.It is good to initialize in constructor, it will be easier to use in multiple functions.
The steps are mentioned below:
use Cixware\Esewa\Client;
use Cixware\Esewa\Config;
class eSewaController extends Controller
{
private $merchantCode;
private $environment;
private $esewaConfig;
private $esewaClient;
public function __construct()
{
$this->successURL = env('APP_URL') . '/'. env('ESEWA_SUCCESS_URL');
$this->errorURL = env('APP_URL') . '/'. env('ESEWA_FAILURE_URL');
$this->merchantCode = env('ESEWA_MERCHANT_CODE');
$this->environment = env('APP_ENVIRONMENT');
$this->esewaConfig = new Config($this->successURL, $this->errorURL, $this->merchantCode, $this->environment);
$this->esewaClient = new Client($this->esewaConfig);
}
}
Now you can process the payment from any function as below:
public function processPayment()
{
$this->esewaClient->process($trasactionCode, $transactionAmount,$taxAmount, $serviceCharge);
}
This will redirect to the eSewa payment page as below:

The user inputs all the credentials and after that, you will get a response:
Response Snippet
For Successful Payment
http://merchant.com.np/page/esewa_payment_success?q=su&oid=ee2c3ca1-696b-4cc5-a6be-2c40d929d453&amt=100&refId=000AE01
For Failed or Pending Payment
http://merchant.com.np/page/esewa_payment_failure
For payment verification, you have to call the following function:
public function verifyPayment()
{
$paymentVerification = $this->esewaClient->verify($refId,$oId,$paymentAmount);
}
You will get true for successful payment and false for failed payment.
The credentials for the development environment are:
Merchant ID: EPAYTEST
eSewa ID: 9806800001/2/3/4/5
Password: Nepal@123
Token: 123456
After this, you can store the payment data in your database and process it accordingly.
For more reference, you can visit: https://developer.esewa.com.np/#/epay