locked
DoDirectPayment - PayPal NVP API RRS feed

  • Question

  • User-1451901242 posted

    Hi Experts,

    I have using Credit card payment integration using DoDirectPayment - PayPal NVP API

    we have add the dll using Encore.PayPal.Nvp;

    please find the code

    NvpDoDirectPayment ppPay = new NvpDoDirectPayment();
            ppPay.Add(NvpCommonRequest.USER, "merchant_api1.mydomain.com");
            ppPay.Add(NvpCommonRequest.PWD, "mypa$$word");
            ppPay.Add(NvpCommonRequest.SIGNATURE, "AFcWxV21C7fd0v3bYYYRCpSSRl31A7Sn4smTAR9ZR0aqq");
            // Add the required parameters
            ppPay.Add(NvpDoDirectPayment.Request._IPADDRESS, "127.0.0.1");
            ppPay.Add(NvpDoDirectPayment.Request._AMT, "99.98");
            ppPay.Add(NvpDoDirectPayment.Request._PAYMENTACTION, NvpPaymentActionCodeType.Sale);
            ppPay.Add(NvpDoDirectPayment.Request._CREDITCARDTYPE, NvpCreditCardTypeType.Visa);
            ppPay.Add(NvpDoDirectPayment.Request._ACCT, "4038168007770947");
            ppPay.Add(NvpDoDirectPayment.Request._EXPDATE, "092011");
            ppPay.Add(NvpDoDirectPayment.Request.CVV2, "123");
            ppPay.Add(NvpDoDirectPayment.Request._FIRSTNAME, "John");
            ppPay.Add(NvpDoDirectPayment.Request._LASTNAME, "Doe");
            // Post the API call
            if (ppPay.Post())
            {
                // Payment was successful. Display the results.

                 Response.Write("TRANSACTIONID=" + NvpDoDirectPayment.Response.TRANSACTIONID);
                Response.Write(",AMT=" + NvpDoDirectPayment.Response.AMT);
                Response.Write(",AVSCODE=" + NvpDoDirectPayment.Response.AVSCODE);
                Response.Write(",CVV2MATCH=" + NvpDoDirectPayment.Response.CVV2MATCH);
            }
            else
            {
                // Payment was unsuccessful. Take appropriate action.

                Response.Write("Code=" + ppPay.ErrorList[0].Code);
                Response.Write(",Severity=" + ppPay.ErrorList[0].Severity);
                Response.Write(",ShortMessage=" + ppPay.ErrorList[0].ShortMessage);
                Response.Write(",LongMessage=" + ppPay.ErrorList[0].LongMessage);
            }


    After press the checkout button we have get the below error message

    Code=10002,Severity=Error,ShortMessage=Security error,LongMessage=Security header is not valid

    kindly help this cod.how resolve this one please 


    Thanks an advance


    Saturday, October 24, 2009 3:24 AM

All replies

  • User1344924657 posted

    were you able to fix this issue? 

    Tuesday, December 8, 2009 11:47 AM
  • User573009730 posted

    You just need to encode your url string.

    System.Web.HttpUtility .UrlEncode (urlString);

    Thursday, June 17, 2010 1:41 PM