0

I tried both 'Sandbox' and 'Live' and that didn't change anything. ACK code is giving "Failure" & as for the "accountStatus" It's giving me (same goes with CountryCode & UserInfo fields) :

Object reference not set to an instance of an object.

Here is the code and I'm using PayPal Adaptive Accounts SDK btw :

Dictionary<string, string> config = new Dictionary<string, string>();
    config.Add("mode", "live");
    config.Add("account1.apiUsername", "xxxxxx_api1.outlook.com");
    config.Add("account1.apiPassword", "BDxxxxxxVMH8CC422");
    config.Add("account1.apiSignature", "AnUrp2fCnv5wuh1OOXxxxxxxtsA4ek2pihCAfCZodv21T9TY6Yidln");


    AdaptiveAccountsService service = null;
    GetVerifiedStatusResponse resp = null;

    GetVerifiedStatusRequest getVerifiedStatusRequest = new GetVerifiedStatusRequest
    {


        emailAddress = "xxxxxx@outlook.com",
        firstName = "MyName",
        lastName = "MyLastName",
         matchCriteria = "NAME"


    };


     service = new AdaptiveAccountsService(config);
     resp = service.GetVerifiedStatus(getVerifiedStatusRequest);

    TextBox1.Text = resp.responseEnvelope.ack.ToString() + resp.accountStatus.ToString();
ekad
  • 14,436
  • 26
  • 44
  • 46
Da black ninja
  • 359
  • 1
  • 6
  • 19
  • 1
    If you're trying to call this on behalf of 3rd party users you'll probably have to grant permission for your app to make the API request for their account. What is the error code that you're getting back when you try it? – Drew Angell Aug 15 '16 at 02:38
  • Error is "Object reference not set to an instance of an object." as I said above. API key generated = my API code generated by my PayPal account , and same thing goes for the call , I'm calling using my personal account – Da black ninja Aug 15 '16 at 10:42
  • What @AndrewAngell meant by **the error code** is the error code returned by the Paypal API as explained [here](https://developer.paypal.com/docs/classic/api/adaptive-accounts/GetVerifiedStatus_API_Operation/) under "GetVerifiedStatus Errors" section, i.e 500000, 520002, etc. The error code should be in `resp.error`, so you need to check the content of `resp.error` and tell us what the error code **inside** `resp.error` is. – ekad Aug 15 '16 at 13:58
  • @ekad At first I was getting the 500000 but for some reasons , I'm not getting anymore . resp.error is returning what I told you yesterday (the System Generic list thing) – Da black ninja Aug 15 '16 at 17:37
  • Generic List is the *type* of `resp.error`, **not** the *value* of what's inside. You're dealing with objects, not only strings like in Pascal or Delphi. You need to inspect the content of `resp.error` and you can't use `ToString()` on everything. Learn [how to use Autos and Locals Windows](https://msdn.microsoft.com/en-us/library/bhawk8xd.aspx) to inspect the content of `resp.error`. – ekad Aug 16 '16 at 00:25
  • Possible duplicate of [What is a NullReferenceException, and how do I fix it?](http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – ekad Sep 18 '16 at 09:56

0 Answers0