简体   繁体   中英

How to integrate instamojo payment gateway in asp.net web forms

I am new to integrating payment gateway in ASP.Net. So I want to know the steps to do for integrating that to my ASP.Net web app. I have downloaded the C# wrapper from Github provided as a reference by Instamojo. But my mind is null/NIL cause I don't know what and how to do. So I need someone to shed some light on this topic. I tried searching the internet, unfortunately no results..

I tried nothing so far. I just have my ASP.Net web app and the C# .NET wrapper (That is what they call it as..) with me.

Integrating Instamojo payment gateway in asp.net c#

I'll list it in steps:

Step 1 : There are two accounts provided by Instamojo

  • Live / Production account - www.Instamojo.com
  • Test account - test.instamojo.com so create an account in test.instamojo.com and go to the dashboard and create your new test credentials as shown below [clientID and client Secret will be provided]

在此处输入图片说明

Step 2 : Go to https://github.com/Instamojo/instamojo-csharp and download the c# wrapper [filename] from there and extract it and open

Steo 3 : Just copy the InstamojoAPI folder from the downloaded/extracted folder and paste it in your project desired

在此处输入图片说明

Step 4 : Copy the code unser the section named Create new payment order under payments API in the github link - https://github.com/Instamojo/instamojo-csharp and copy that in your project in a new form/file

Step 5 : After copying, in your code Replace client id with your test client id, client secret with your test client secret, endpoint with the following url : https://test.instamojo.com/v2/ and authendpoint with the following url : https://test.instamojo.com/oauth2/token/

Instamojo objClass = InstamojoImplementation.getApi( “[client_id]”, “[client_secret]”, “[endpoint]”, “[auth_endpoint]”);

Step 6 : You have to provide these parameters as shown below 在此处输入图片说明

Step 7 : Then find the below code in your project and replace the messagebox with response.redirect like below

在此处输入图片说明

Thats it you are good to go. Fire the run button and see the results as below

First your localhost home page will fire. you have to create a form like this below 在此处输入图片说明

Then on pay button click this should appear 在此处输入图片说明

Then..this.. [Your test/sandbox acnt details in here - https://support.instamojo.com/hc/en-us/articles/208485675-Test-or-Sandbox-Account] [ 在此处输入图片说明 ] 7

then finally 在此处输入图片说明

then after payment it should redirect to your redirection_url as specified before. like this

objPaymentRequest.redirect_url = “redirect_url”;

Thats it.. Happy coding

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM