0

我使用所有有效输入调用了 WebSitePayment Pro doDirectPayment API,但在 API 响应中我得到以下错误

“由于商家配置无效,无法处理此交易。”

为了获得更多帮助,我在这里写下了我的应用程序代码

PayPalResponse oResponse = new PayPalResponse ( );
Profile oProfile = new Profile ( );
RequestDetail oRequestDetail = new RequestDetail ( );
DoDirectPayment oDoPayment = new DoDirectPayment ( );
string Responsestring = "";
oProfile.APIUsername = ConfigurationManager.AppSettings["apiusername"];
oProfile.APIPassword = ConfigurationManager.AppSettings["apipassword"];
oProfile.APISignature = ConfigurationManager.AppSettings["apisignature"];
oProfile.Environment = ConfigurationManager.AppSettings["environment"];

oRequestDetail.IPAddress = Request.ServerVariables["LOCAL_ADDR"].ToString ( );
oRequestDetail.MerchantSessionId = Session.SessionID;

oResponse = oDoPayment.DoDirectPaymentCode ( "1.0", txtlastname.Text, txtFirstname.Text, txtaddress1.Text , txtaddress2.Text , txtCity.Text ,txtState.Text ,txtzipcode.Text,
                                         "Visa", txtcardno.Text,txtcvv2.Text, Convert.ToInt32(txtExpMonth.Text), Convert.ToInt32(txtExpYear.Text), PaymentActionCodeType.Sale, oProfile, "USA", CountryCodeType.US, CurrencyCodeType.USD, oRequestDetail );
if (oResponse.ErrorLog.Count > 0)
{
    foreach (KeyValuePair<string, string> o in oResponse.ErrorLog)
    {
        Response.Write ( o.Value.ToString ( ) + "<br/>" );
    }
}

任何人都可以帮我解决这个问题吗,此代码适用于 Sandbox,但不适用于 Live 环境。我已完成企业帐户的所有计费协议。

4

1 回答 1

0

确保您的配置具有您的实时数据。沙盒 URL 和 API 值不同。
确保 API USERNAME、PASSWORD、SUBJECT 和 SIGNATURE 值是实时值,而不是沙盒值。
我这样做的方法是直接从沙箱站点上的报告中复制值并将它们粘贴到配置中。

于 2009-10-02T19:45:47.920 回答