paytm payment gateway integration

paytm payment gateway integration

How to integrate paytm payment gateway by using Asp.net & c#

हैलो दोस्तों आज का topic बहुत ही बेहतरीन है ,उन students के लिए जो technical और non technical background से belong करते है ।


Translate : Hello friends, today’s topic is very good, for those students who belong to technical and non technical background.

do you know how to work the Paytm payment integration model?

दोस्तों ये जानना बहुत जरूरी है ,की हम क्यों इसे पढ़ रहे है और पढ़ने का उद्देश क्या है ,

दोस्तों online की दुनिया मे हर व्यक्ति वो चाहे एक customer हो या एक whole seller हो सभी को एक बात का हमेशा ध्यान होता है, की हमारा customer payment देने के लिए किस माध्यम का उपयोग कर रहा है ,और हमेशा इस बात का ध्यान रखा जाता है की ,हमारे customer को कम से कम तकलीफों का सामना करना पड़े ।

Translate :Friends, in the world of online, every person, whether a customer or a whole seller, always takes care of one thing, what medium our customer is using to pay, and it is always taken care of, Our customer has to face the least problems.

दोस्तों अब हम आपको कुछ ऐशे तरीके बताने जा रहा हु जो आप अपने website मे कोड को add करके आप Asp.net & c # के project मे paytm payment gateway integrate कर सकते है ।

Translate : Friends, now we are going to tell you some ways that you can integrate the Paytm payment gateway in Asp.net & c # project by adding code to your website

  • दोस्तों सबसे पहले html फाइल को क्रीऐट करेगे

Payment.aspx:

<%@ Page Title="" Language="C#" MasterPageFile="~/user/user.Master" AutoEventWireup="true" CodeBehind="payment.aspx.cs" Inherits="mini_project.user.payment" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">


     <br /> <br /> 
    <center><div class="card" style="width: 28rem;">
 <a class="navbar-brand" href="#">
    <img src="../img/logo.png" width="120" height="120" alt="">
  </a>
  <div class="card-body">
    <h5 class="card-title">ENTE YOUR PAYMENT DETAIL</h5><br />
      <asp:TextBox ID="TextBox1"  Placeholder="Enter your Order-id" runat="server"></asp:TextBox> <br />  <br />
      <asp:TextBox ID="TextBox2"  Placeholder="Enter your Cusomer-id" runat="server"></asp:TextBox> <br />  <br />
      <asp:TextBox ID="TextBox3" Placeholder="Enter your Email-id"  runat="server"></asp:TextBox> <br />  <br />
      <asp:TextBox ID="TextBox4"  Placeholder="Enter your Phone number"  runat="server"></asp:TextBox> <br />  <br />
      <asp:TextBox ID="TextBox5"  Placeholder="Enter your Amount"  runat="server"></asp:TextBox> <br />  <br />
       <asp:Button ID="Button1" runat="server" Text="Pay Now" OnClick="Button1_Click" />  
</div></center>
    
     <br />  <br />  <br />  <br /> <br />  <br />  <br />  <br />
</asp:Content>


  • दोस्तों उसके बाद c# backend फाइल को क्रीऐट करेगे

Payment.aspx.cs:

using paytm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace mini_project.user
{
    public partial class payment : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
                           }

        protected void Button1_Click(object sender, EventArgs e)
        {

            string ord = TextBox1.Text;
            string cus = TextBox2.Text; 
            string email = TextBox3.Text;
            string phone = TextBox4.Text;
            string am = TextBox5.Text;
            String merchantKey = "your merchant key";
            Dictionary<string, string> parameters = new Dictionary<string, string>();
            parameters.Add("MID", "your mechant id");
            parameters.Add("CHANNEL_ID", "WEB");
            parameters.Add("INDUSTRY_TYPE_ID", "Retail");
            parameters.Add("WEBSITE", "WEBSTAGING");
            parameters.Add("EMAIL", email);
            parameters.Add("MOBILE_NO", phone);
            parameters.Add("CUST_ID", cus);
            parameters.Add("ORDER_ID", ord);
            parameters.Add("TXN_AMOUNT", am);
            parameters.Add("CALLBACK_URL", ""); //This parameter is not mandatory. Use this to pass the callback url dynamically.

            string checksum = CheckSum.generateCheckSum(merchantKey, parameters);
            string paytmURL = "https://securegw-stage.paytm.in/theia/processTransaction?orderid=";

            string outputHTML = "<html>";
            outputHTML += "<head>";
            outputHTML += "<title>Merchant Check Out Page</title>";
            outputHTML += "</head>";
            outputHTML += "<body>";
            outputHTML += "<center><h1>Please do not refresh this page...</h1></center>";
            outputHTML += "<form method='post' action='" + paytmURL + "' name='f1'>";
            outputHTML += "<table border='1'>";
            outputHTML += "<tbody>";
            foreach (string key in parameters.Keys)
            {
                outputHTML += "<input type='hidden' name='" + key + "' value='" + parameters[key] + "'>";
            }
            outputHTML += "<input type='hidden' name='CHECKSUMHASH' value='" + checksum + "'>";
            outputHTML += "</tbody>";
            outputHTML += "</table>";
            outputHTML += "<script type='text/javascript'>";
            outputHTML += "document.f1.submit();";
            outputHTML += "</script>";
            outputHTML += "</form>";
            outputHTML += "</body>";
            outputHTML += "</html>";
            Response.Write(outputHTML);
 
        }
    }
}

OUTPUT:



concusion :

दोस्तों आप इस post मे आपने सीखा की हम paytm payment gateway integration अपनी website मे कैसे करते है । अगर आपको किसी भी प्रकार मे समस्या हो तो आप हमे comment या admin@webtecsolution.in पर message करे धन्यबाद ।

Translate : Friends, in this post you learned how we do Paytm payment gateway integration in our website. If you have any kind of problem, thank you for your comments or message on admin@webtecsolution.in.

सुझाव:

दोस्तों आपको पोस्ट कैसे लगा आप अपने सुझाव हमे कमेन्ट या mail के जरिए अवश्य दे ,और मेरे प्रिय मित्र इस पोस्ट को अधिक से अधिक लोग share करो नीचे दिए हुए whatsapp button के जरिए ।

Translate : Friends, how did you find the post, you must give us your suggestions via comment or mail, and my dear friend, more and more people share this post through the WhatsApp button given below.

One Comment