Solved

Create Recurring Payment with PayPal API 'Profile is Invalid'

Posted on 2014-04-08
1
1,475 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 Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to dynamically set the form action using jQuery.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

792 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