Solved

Create Recurring Payment with PayPal API 'Profile is Invalid'

Posted on 2014-04-08
1
1,374 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

743 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

14 Experts available now in Live!

Get 1:1 Help Now