Paypal Website payment Pro DoDirect Payment Integr

2019-08-19 01:54发布

问题:

I had called WebSitePayment Pro doDirectPayment API with all valid inputs but in API Response I get below error

"This transaction cannot be processed due to an invalid merchant configuration."

for more help i wrote down my application code here

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/>" );
    }
}

can any body help me to resolve this issue,this code is work with Sandbox but don't work with Live environment. I have complete all billing agreement for business account.

回答1:

Make sure that your configuration has your live data. The sandbox URL and API values are different.
Make sure the API USERNAME, PASSWORD, SUBJECT, AND SIGNATURE values are the live values and not the sandbox values.
My method of doing this is to copy the values directly from the report on the sandbox site and paste them into the configuration.



标签: paypal