4

我们需要实现CCAvenue支付网关选项。如何使用 ASP.net/C# 做到这一点?

4

3 回答 3

2

请查看 ccavenue 官方网站的集成手册。希望对您有所帮助

http://world.ccavenue.com/content/works_any_shoppingcart.jsp

于 2010-02-23T07:40:30.540 回答
1

我已经解决了。是的,CCAvenue 提供了良好的支持。但是使用 asp.net 论坛的人总是会寻找 asp.net 代码和直接答案。:)

我希望这会对某人有所帮助。我在后面的代码中创建了两个属性。一种是返回校验和值,另一种是返回有关结帐项目的详细信息。

public string CCAvenueItemList
{
    get
    {
        StringBuilder CCAvenueItems = new StringBuilder();
        DataTable dt = new DataTable();
        DataTable dtClientInfo = new DataTable();
        dt = (DataTable)Session["CheckedItems"];
        dtClientInfo = (DataTable)Session["ClientInfo"];
        for (int i = 0; i <= dt.Rows.Count - 1; i++)
        {

            string amountTemplate = "<input type=\"hidden\" name=\"Amount\" value=\"$Amount$\" />\n";
            string orderTemplate = "<input type=\"hidden\" name=\"Order_Id\" value=\"$Order_Id$\" />\n";

            // BILLING INFO
            string billingNameTemplate = "<input type=\"hidden\" name=\"billing_cust_name\" value=\"$billing_cust_name$\" />\n";
            string billingCustAddressTemplate = "<input type=\"hidden\" name=\"billing_cust_address\" value=\"$billing_cust_address$\" />\n";
            string billingCountryTemplate = "<input type=\"hidden\" name=\"billing_cust_country\" value=\"$billing_cust_country$\" />\n";
            string billingEmailTemplate = "<input type=\"hidden\" name=\"billing_cust_email\" value=\"$billing_cust_email$\" />\n";
            string billingTelTemplate = "<input type=\"hidden\" name=\"billing_cust_tel\" value=\"$billing_cust_tel$\" />\n";
            string billingStateTemplate = "<input type=\"hidden\" name=\"billing_cust_state\" value=\"$billing_cust_state$\" />\n";
            string billingCityTemplate = "<input type=\"hidden\" name=\"billing_cust_city\" value=\"$billing_cust_city$\" />\n";
            string billingZipTemplate = "<input type=\"hidden\" name=\"billing_zip_code\" value=\"$billing_zip_code$\" />\n";

            billingCustAddressTemplate = billingCustAddressTemplate.Replace("$billing_cust_address$", dtClientInfo.Rows[0]["Address"].ToString());
            billingCountryTemplate = billingCountryTemplate.Replace("$billing_cust_country$", dtClientInfo.Rows[0]["Country"].ToString());
            billingEmailTemplate = billingEmailTemplate.Replace("$billing_cust_email$", dtClientInfo.Rows[0]["Email_ID"].ToString());
            billingTelTemplate = billingTelTemplate.Replace("$billing_cust_tel$", dtClientInfo.Rows[0]["Phone_no"].ToString());
            billingStateTemplate = billingStateTemplate.Replace("$billing_cust_state$", dtClientInfo.Rows[0]["State"].ToString());
            billingCityTemplate = billingCityTemplate.Replace("$billing_cust_city$", dtClientInfo.Rows[0]["City"].ToString());
            billingZipTemplate = billingZipTemplate.Replace("$billing_zip_code$", dtClientInfo.Rows[0]["ZipCode"].ToString());

            strAmount = dt.Rows[i]["INR"].ToString();
            amountTemplate = amountTemplate.Replace("$Amount$", dt.Rows[i]["INR"].ToString());
            orderTemplate = orderTemplate.Replace("$Order_Id$", dt.Rows[i]["ClientID"].ToString());
            billingNameTemplate = billingNameTemplate.Replace("$billing_cust_name$", dtClientInfo.Rows[0]["Name"].ToString());

            CCAvenueItems.Append(amountTemplate)
                .Append(orderTemplate)
                .Append(billingNameTemplate)
                .Append(billingCustAddressTemplate)
                .Append(billingCountryTemplate)
                .Append(billingEmailTemplate)
                .Append(billingTelTemplate)
                .Append(billingStateTemplate)
                .Append(billingCityTemplate)
                .Append(billingZipTemplate)
                .Append(deliveryNameTemplate)
                .Append(deliveryCustAddressTemplate)
                .Append(deliveryCountryTemplate)
          }
        return CCAvenueItems.ToString();
    }
}

返回校验和的另一个属性是

public string propcheckSum
{
    get {
        libfuncs objLib = new libfuncs();
        string strCheckSum = objLib.getchecksum("YourMerchantID", Session["ClientID"].ToString(), strAmount, "UrReturnUrl", "your working key");
        return strCheckSum;
    }
}

并在设计源视图中使用此属性,如下所示

<div>
    <%=CCAvenueItemList%>
    <input type="hidden" name="Merchant_Id" value="yourmerchantID" />
    <input type="hidden" name="Checksum" value="<%=propcheckSum%>" />
    <input type="hidden" name="Redirect_Url" value="YourWebsite'sThankyoupage.aspx" />
    <input type="submit" value="Submit" runat="server" />
</div> 

您可以在 CCAvenue 网站获取商户 ID 并生成工作密钥。那是在商家登录中。

希望这至少可以帮助某人。

于 2014-06-10T07:26:16.730 回答
0

您必须先注册联系他们并索取他们的付款集成手册。我认为这与在您的网站中集成贝宝不同。

于 2010-02-25T06:45:39.207 回答