Solved

Create Recurring Payment with PayPal API 'Profile is Invalid'

Posted on 2014-04-08
1
1,416 Views
Last Modified: 2016-03-24
Hi all,

I am trying to setup a recurring payment profile in Paypal (currently sandbox). However I am getting the following error message;


ErrorCode=11581&Desc=Invalid Data&Desc2=Profile description is invalid

I am calling the method as follows;

if (bSandbox)
        {
            pEndPointURL = pEndPointURL_SB;
        }

        NVPCodec encoder = new NVPCodec();
        encoder["METHOD"] = "CreateRecurringPaymentsProfile";
        encoder["TOKEN"] = token;
        encoder["EMAIL"] = payerEmail;
        encoder["PROFILESTARTDATE"] = startdate.ToUniversalTime().ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'");
        encoder["BILLINGFREQUENCY"] = "12";
        encoder["BILLINGPERIOD"] = "Month";
        encoder["AMT"] = "19.99";
        encoder["DESC"] = "MyDomains.com Monthly Subscription";

        string pStrrequestforNvp = encoder.Encode();
        string pStresponsenvp = HttpCall(pStrrequestforNvp);

        decoder = new NVPCodec();
        decoder.Decode(pStresponsenvp);

        string strAck = decoder["ACK"].ToLower();
        if (strAck != null && (strAck == "success" || strAck == "successwithwarning"))
        {
            return true;
        }
        else
        {
            retMsg = "ErrorCode=" + decoder["L_ERRORCODE0"] + "&" +
                "Desc=" + decoder["L_SHORTMESSAGE0"] + "&" +
                "Desc2=" + decoder["L_LONGMESSAGE0"];

            return false;
        }

Open in new window


now from what I can see I am passing this in the DESC.

Am I missing a field?
0
Comment
Question by:flynny
1 Comment
 
LVL 11

Accepted Solution

by:
Andrew Angell earned 500 total points
ID: 39986076
You need to make sure the description value is the same throughout the entire process.  It should be included in SetExpressCheckout in the billing agreement parameters and then again in CreateRecurringPaymentsProfile like you've done.  If it doesn't match exactly this error can happen.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
The viewer will learn how to count occurrences of each item in an array.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now