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) - http://esewa.f1dev.com/epay/main

          (For LIVE environment) - https://esewa.com.np/epay/main

    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 : http://www.merchantsite.com/success?q=su&oid=121234&amt=100&refId=110761
              Where,
                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 = "http://esewa.f1dev.com/epay/main" 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="http://merchantsite.com/success,html?q=su" type="hidden" name="su">
            <input value="http://merchantsite.com/failure.html?q=fu" type="hidden" name="fu">
        <input value="Submit" type="submit">
    </form>

    -- 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 : "http://esewa.f1dev.com/epay/transrec"    
           For Live : "https://esewa.com.np/epay/transrec"
    
    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 = "http://esewa.f1dev.com/epay/transrec" 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">
    </form>

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: 6380
  • Product Code: MOD_25
  • Availability: In Stock
79 Product(s) Sold
  • $0.00
  • Ex Tax: $0.00

I study around 10 days to explore how import export works thus i am now able to create my own import..
$50.00
text_tax $50.00
This module shows manufacturers chosen from the admin. DEMO   ..
$15.00 $10.00
text_tax $10.00
Feedback Module for Opencart for Free -eCommerce SolutionFeedback or Testimonial Module is the modul..
$0.00
text_tax $0.00
I got project to integrate the EBS into OpenCart so i researched about the module whether it is free..
$0.00
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..
$0.00
text_tax $0.00
Klarra.com  one of the best eCommerce for dresses and bottoms. One of the best site i..
$0.00
text_tax $0.00
Special thanks to me Rupak Nepali who work on Opencart module and provide most for free. After lo..
$0.00
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
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 ..
$0.00
text_tax $0.00
Latest OpenCart 2.0.1.1 module of displaying all the products is at the following link https://webo..
$0.00
text_tax $0.00
Coming SoonDemo NepalEverest OpenCart free theme..
$0.00
text_tax $0.00