Integration of esewa into website, documentation to integrate esewa, sandbox of esewa

Integration of esewa into website, documentation to integrate esewa, sandbox of esewa

I am working on Stylish Nepal and according to their requirement we have to integrate the esewa payment module but i did not find out easy documentation of esewa so i thought to make one. I am making one developer sandbox section and live version documentation.

:: The Flow of the esewa payment system

When customer chooses esewa as on-line payment option from merchant site, then s/he(user) is temporarily redirected to eSewa, where user have to login and confirm the transaction to proceed. After successful transaction in esewa, the user is redirected back to merchant site(success page). If transaction fails due to any reason, the user is informed by failure message and redirected back to merchant site(failure page).

For every successful transaction by user, the merchant account is credited accordingly and notified via email about transaction with details.

:: Integrating eSewa epay feature into merchant site

When user chooses esewa as on-line payment, the merchant site calls following URL with nine different parameters

URL : (For TEST environment) -

          (For LIVE environment) -

    Parameters :
    a) amt       - Amount(NRs) of the product/item which user have selected from merchant site for purchase/order.

    b) txAmt     - Tax amount(NRs) on the selected product/item.

    c) psc        - Product service charge, or service charge.

    d) pdc        - Product delivery charge, amount to be charge in case product/item have to be home delivered or so.

    e) tAmt        - Total amount(NRs), it is the final price after sum of base price, tax, and other charges.
              Eg : tAmt = amt + txAmt + psc + pdc  esewa will provide merchant with a code/id that will represent the merchant during transaction.

              For TEST, merchant can use "testmerchant" as merchant code.
              For LIVE, please contact esewa management to receive the code.

    g)pid        - Product ID, a unique id/code that represents the item.
              Eg : 121234 or MER121234 or soon

    h)su         - Success URL, a url to redirect after successful transaction in esewa. The merchant will recieve three different parameters as query string.
              Eg :
                oid = pid (sent by merchant)
                amt = total amount (tAmt)
                refId = unique Id send by eSewa.

    i)fu        - Failure URL, a url to redirect after failed transaction in esewa & with no parameters as query string.

    NOTE ::  i.  All parameters are of type String.
         ii. Parameters (amt, tAmt, scd, pid, su & fu) are required/mandatory.
         iii.Parameters (txAmt, psc, pdc value should be '0' if not required by merchant)

2) Sample code for integration of esewa into merchant site

   -- Written in HTML, refer this as source and develop your application accordingly --

   -- Code start --

    <form action = "" method="POST">
        <input value="100" name="tAmt" type=" hidden">
            <input value="90" name="amt" type="hidden">
            <input value="10" name="txAmt" type="hidden">
            <input value="0" name="psc" type="hidden">
            <input value="0" name="pdc" type="hidden">
            <input value="testmerchant" name="scd" type="hidden”>
            <input value="121234" name="pid" type=" hidden”>
            <input value=",html?q=su" type="hidden" name="su">
            <input value="" type="hidden" name="fu">
        <input value="Submit" type="submit">

    -- Code end --

3) Merchant can verify the every transaction(s) occurred through eSewa using our verification method.

:: How to ?
    As already stated, for every successful transaction by users from eSewa, they are redirect to merchant success page with query string containing parameters,         namely : 
    " oid, amt & refId "
    Store these parameters value, and send a request to given url with following parameters : (Verification process should be automated behind the scene, unknown to     user)

    URL :  For test : ""    
           For Live : ""
    Parameters     Description
    m    :    set value to "ver", always!
    amt     :     transaction amount 
    pid    :     product id (oid you received or pid merchant send to eSewa for transaction)
    rid     :     reference id (refId received by merchant after successful transaction)
    scd     :     merchant code that esewa provides  

    Sample code :
    <form action = "" method="POST">
               <input type="hidden" value="ver" name="m"/>
            <input type="hidden" value="testmerchant" name="scd"/>
            <input type="hidden" value="121234" name="pid"/>
            <input type="hidden" value="100" name="amt">
            <input type="hidden" value="12345" name="rid">
            <input value="Verify" type="submit">

P.S :: For further technical help please contact F1Soft International.

Write a review

Please login or register to review

Instant Download

Order and download Instantly.

  • Views: 9947
  • Product Code: MOD_25
  • Availability: In Stock
140 Product(s) Sold
  • $0.00
  • Ex Tax: $0.00

OpenCart Module Development Tutorials

Admin files created to make Testimonial Management

  • Form Creation (edit and insert)
  • Listing page creation
  • Language file creation
  • Model Creation
  • Template file creation
  • Links to listing page added in primary menu through use of OCMOD

Front end files creation

  • Controller creation
  • Model Creation
  • Language file creation
  • Template file creation
I study around 10 days to explore how import export works thus i am now able to create my own import..
text_tax $50.00
This module shows manufacturers chosen from the admin.DEMO  ..
$15.00 $10.00
text_tax $10.00
Today I am giving away the Google Map Module for opencart for free. By which we can show Google Map ..
text_tax $0.00
Products show at home page for each category. This is products display of selected category.At t..
$15.00 $10.00
text_tax $10.00  one of the best eCommerce for dresses and bottoms. One of the best site i..
text_tax $0.00
Today i worked out on GharPort.Com and now it is ready to launch.I have added the two modules in..
text_tax $0.00
I got project to integrate the EBS into OpenCart so i researched about the module whether it is free..
text_tax $0.00
We have recently worked out in Multi-language Banner Management in opencart, images of banner a..
$20.00 $18.00
text_tax $18.00
Just completed another module.What was the requirement? List out all the products as per t..
$30.00 $25.00
text_tax $25.00
Better to send us the information and we will provide the quote, please mention your budget as well ..
$200.00 $180.00
text_tax $180.00
I am working on Stylish Nepal and according to their requirement we have to integrate the ..
text_tax $0.00
Order it for free.Download the moduleINSTALLATION:If your ftp is enabled from the admin section:Unzi..
text_tax $0.00
Latest OpenCart module of displaying all the products is at the following link https://webo..
text_tax $0.00