我使用所有有效输入调用了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环境。我已完成商业帐户的所有结算协议。
答案 0 :(得分:0)
确保您的配置包含实时数据。沙箱URL和API值不同
确保API USERNAME,PASSWORD,SUBJECT和SIGNATURE值是实时值而不是沙箱值。
我这样做的方法是直接从沙箱网站上的报告中复制值并将它们粘贴到配置中。