Skrill 重定向错误 "JBWEB000120: The request sent by the client was syntactically incorrect."

Skrill redirect error "JBWEB000120: The request sent by the client was syntactically incorrect."

我在 asp.net 网络应用程序中使用 Skrill 付款方式。

当点击预订按钮时,它会重定向到 Skrill 进行付款:

protected void btnBook_Click(object sender, EventArgs e)
{
    // Mastercard   5438311234567890
    // Visa         4000001234567890
    // Amex         371234500012340

    string url = "https://pay.skrill.com/?";

    // Merchant Details
    url += "pay_to_email=" + "demoqco@sun-fish.com";
    url += "&recipient_description=" + "Banquet Halls Booking System";
    url += "&language=" + "EN";
    url += "&status_url=" + "";

    // Customer Details
    url += "&country=" + "Pakistan";

    // Payment Details
    url += "&amount=" + string.Format("{0:0.00}", (double.Parse(lblGrandTotal.Text) / 110.00));
    url += "&currency=" + "USD";
    url += "&amount2_description=" + Persons.Text + ":";
    url += "&amount2=" + lblPersons.Text;
    url += "&amount3_description=" + PerHeadRate.Text + ":";
    url += "&amount3=" + lblPerHeadRate.Text;
    url += "&amount4_description=" + Tax.Text + ":";
    url += "&amount4=" + lblTax.Text + "%";
    url += "&detail1_description=" + "Booking ID:";
    url += "&detail1_text=" + objDLBkg.SelectLastBkID();
    url += "&detail2_description=" + "Description:";
    url += "&detail2_text=" + "View all bookings in your Account.";
    url += "&detail3_description=" + "Banquet Hall:";
    url += "&detail3_text=" + lblBqtName.Text;
    url += "&detail4_description=" + "Booking Date:";
    url += "&detail4_text=" + DateTime.Now.Date.ToString("MM/dd/yyyy");

    // Split Gateway
    url += "&payment_methods=" + "WLT,ACC";

    Response.Redirect(url);
}

并在重定向到 Skrill 时显示错误:

JBWEB000065: HTTP Status 400 -


JBWEB000309: type JBWEB000067: Status report
JBWEB000068: message
JBWEB000069: description JBWEB000120: The request sent by the client was syntactically incorrect.


JBoss Web/7.5.9.Final-redhat-1

我该如何解决?我哪里错了?

提前致谢!

尝试对您的查询字符串参数进行编码以转义特殊字符,答案 HERE 中提供了如何执行此操作的示例:

string url = string.Format("https://yourdomain.com/api/add?t={0}&mac={1}&portName={2}&name={3}&location={4}&description={5}&comment={6}",
            HttpUtility.UrlEncode(appToken),
            HttpUtility.UrlEncode(macAddress),
            HttpUtility.UrlEncode(PortName),
            HttpUtility.UrlEncode(name),
            HttpUtility.UrlEncode(Location),
            HttpUtility.UrlEncode(description),
            HttpUtility.UrlEncode(Comment));

这里报告了类似的错误:JBWEB000069

我发现我的重定向服务器中使用了一个特殊字符 %-URL 导致了这里的错误:

url += "&amount4=" + lblTax.Text + "%";

刚刚从 URL 中删除了 % 个字符,它起作用了。