eSewa website payment gateway| wooCommerce WordPress plugin

esewa payment gateway

With the increase in online digital selling business in Nepal, there is a high demand for trustable and reliable online payment gateway. And when it comes to reliability, Nepal No.1 digital wallet; eSewa comes in. It provides a wide and easy payment solution for your online business like online shopping sites and apps. This can be the easiest payment gateway for Nepalese digital sellers as receiving local payment. Some advantage of using eSewa payment gateway are listed below:

  • Get paid instantly and easily to your account.
  • Gain more local customers.
  • Track and view payment history.

Manual integration for eSewa payment gateway:


    <form action="" method="POST">
    <input value="100" name="tAmt" type="hidden">
    <input value="90" name="amt" type="hidden">
    <input value="5" name="txAmt" type="hidden">
    <input value="2" name="psc" type="hidden">
    <input value="3" name="pdc" type="hidden">
    <input value="epay_payment" name="scd" type="hidden">
    <input value="ee2c3ca1-696b-4cc5-a6be-2c40d929d453" name="pid" type="hidden">
    <input value="" type="hidden" name="su">
    <input value="" type="hidden" name="fu">
    <input value="Submit" type="submit">

Javascript Integration

var path="";
var params= {
    amt: 100,
    psc: 0,
    pdc: 0,
    txAmt: 0,
    tAmt: 100,
    pid: "ee2c3ca1-696b-4cc5-a6be-2c40d929d453",
    scd: "epay_payment",
    su: "",
    fu: ""

function post(path, params) {
    var form = document.createElement("form");
    form.setAttribute("method", "POST");
    form.setAttribute("action", path);

    for(var key in params) {
        var hiddenField = document.createElement("input");
        hiddenField.setAttribute("type", "hidden");
        hiddenField.setAttribute("name", key);
        hiddenField.setAttribute("value", params[key]);


Code for Python

import requests as req

url =""
d = {'amt': 100,
    'pdc': 0,
    'psc': 0,
    'txAmt': 0,
    'tAmt': 100,
resp =, d)

PHP integration

$url = "";
$data =[
    'amt'=> 100,
    'pdc'=> 0,
    'psc'=> 0,
    'txAmt'=> 0,
    'tAmt'=> 100,
    'scd'=> 'epay_payment',

    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    $response = curl_exec($curl);

eSewa payment integration using wordpress plugin

It has become far more easier with the integration of online payment in business site with the releasing of wordpress plugin. You can simply intall and setup for establishing a payment gateway solution.