如何从原子支付网关集成响应页面获取支付ID [英] How to get payment id from atom payment gateway integration response page

查看:111
本文介绍了如何从原子支付网关集成响应页面获取支付ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的付款响应页面

This Is my Payment Response Page

protected void Page_Load(object sender, EventArgs e)
{
try
{
    if (!IsPostBack)
    {
    NameValueCollection nvc = Request.Form;
    string mmp_Transaction = nvc["mmp_txn"].ToString();
    string PaymentStatus = nvc["f_code"].ToString();
    string MerchantTransactionId = Request.Form["mer_txn"];

    string Amount = Request.Form["amt"];
    string Product = Request.Form["prod"];
    string TransactionDate = Request.Form["date"];
    string BankTransactionId = Request.Form["bank_txn"];
    string ClientCode = Request.Form["clientcode"]; // Encrypted User Information
    string BankName = Request.Form["bank_name"];

    //User Details
    string Udf1 = Request.Form["udf1"]; //First Name
    string Udf2 = Request.Form["udf2"]; //Email
    string Udf3 = Request.Form["udf3"]; //Mobile
    string Udf4 = Request.Form["udf4"]; //Address
    string Udf5 = Request.Form["udf5"]; //Bank Name
    string Udf6 = Request.Form["udf6"]; //EMI Option

    string strResponceIP = HttpContext.Current.Request.UserHostAddress;
    string strRemarks = "txnId:" + MerchantTransactionId + ", txnStatus:" + PaymentStatus + ", amount:" + Amount + ", pgTxnId:" + mmp_Transaction + ", BankTransactionId:" + BankTransactionId + ", Udf1:" + Udf1 + ", Udf2:" + Udf2 + ", Udf3:" + Udf3 + ", Udf4:" + Udf4 + ", Udf5:" + Udf5 + ", Udf6:" + Udf6;


    string ATOMPaymentIP = ConfigurationManager.AppSettings["ATOMPaymentIP"].ToString();//203.114.240.183--Stage
    //Verify the Response Server
    if (Request.UrlReferrer.Host.Trim() != ATOMPaymentIP)
    {
        // REDIRECT TO ERROR PAGE IF RESPONSE IP IS NOT VERIFIED
    }

    // CHECK THE PAYMENT STATUS AND VALIDATE THE TRANSACTION ID
    if (PaymentStatus.ToUpper().Trim() == "OK" && transactionid.Trim()==MerchantTransactionId.Trim())
    {
        //"Transaction proceed successfully."

        // UPDATE THE TRANSACTION STATUS IN DB
        //
        // CODE FOR UPDATE STATUS
        //
        //

        // REDIRECT TO SUCCESS PAGE OR SHOW THE PAYMENT RESPONSE ON SAME PAGE

    }
    else
    {
        // PAYMENT STATUS IS NOT SUCCESS OR TRANSACTION ID IS NOT VERIFIED
        // REDIRECT TO ERROR PAGE
    }
    }
}
catch (Exception ex)
{
    // HANDLE ERROR
}
}

推荐答案

永远不要接受来自不安全网站的代码来处理任何与真钱有关的事情。

你不知道是谁给你代码,你不知道它是什么是的,您不知道它将钱正确地放入适当的帐户,而不将细节传递给任何第三方。



只从您的支付网关获取此类代码公司 - 否则欺诈的范围太大。请记住,如果您的行为被视为疏忽,您本人可能要对任何损失承担责任 - 从公共论坛获取您的代码肯定会是!
Never, ever, accept code from a insecure website to handle anything to do with real money.
You do not know who is giving you the code, you do not know what it does, you do not know that it places the monies correctly into the appropriate account, without passing the details to any third parties.

Only get such code from your payment gateway company - the scope for fraud otherwise is far too large. And remember, you personally could be liable for any monies lost if your action is seen to be negligent - which getting your code from a public forum would most certainly be!


这篇关于如何从原子支付网关集成响应页面获取支付ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆