A super light weight and simple ruby wrapper for Esewa.
In you gemfile
gem 'esewa', :git => 'https://github.com/Grasruts/esewa.git'
Run bundle install
In your development.rb
and production.rb
add
Esewa.merchant_code = < Your esewa merchant/service code>
Esewa.verification_url = "https://ir-user.esewa.com.np/epay/transrec"
To verfiy your payment, run
extend Esewa::Payment::Verification
verify_esewa_payment({
pid: params[:oid],
amt: params[:amt],
rid: params[:refId]
});
To check the response from the verification
extend Esewa::Payment::Verification
response = verify_esewa_payment({
pid: params[:oid],
amt: params[:amt],
rid: params[:refId]
});
Nokogiri::XML(response.body)
You need to initialize merchant code by setting value for
Esewa.merchant_code = ""
You need to initialize merchant code by setting value for
Esewa.verification_url = "https://ir-user.esewa.com.np/epay/transrec"