Announcement

Collapse
No announcement yet.

Null pointer exception thrown on getOperation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Null pointer exception thrown on getOperation

    We're writing a class that will submit a transaction using the Salesforce integration but any code we use, beyond the samples, always throws a null pointer exception on Class.CnP_IaaS.PaaS_Class.getOperation_node. We have even gone to extent of basically copying one of the sample classes and just made sure that we call it statically and it still throws the exception

    Code:
    Example_Min_Fields trans = new Example_Min_Fields();
    
    trans.cnpxmlstring.ItemsList = new List<CnP_IaaS.Paas_Class.Items>();
    CnP_IaaS.Paas_Class.Items i = new CnP_IaaS.Paas_Class.Items();
    i.ItemName = 'Donation';
    i.UnitPrice = 22;
    trans.cnpxmlstring.ItemsList.add(i);
    trans.BillingInfo.BillingFirstName = 'Test';
    trans.BillingInfo.BillingLastName = 'Donor';
    trans.BillingAddress.BillingStateProvince = 'California';
    
    trans.PaymentMethod.NameOnCard = 'Test Donor';
    trans.PaymentMethod.CardNumber = '4111111111111111';
    trans.PaymentMethod.Cvv2 = '123';
    trans.PaymentMethod.ExpirationMonth = '12';
    trans.PaymentMethod.ExpirationYear = '18';
    
    trans.Process();
    System.debug(trans.cnpxmlstring.TransactionResultCode);
    System.debug(trans.cnpxmlstring.ErrorData);
    System.debug(trans.cnpxmlstring.TransactionNumber);
    The org ID is 00D1g0000008hZT. If this is the wrong way to go about it then do you have any examples of submitting a transaction through a static method?

  • #2
    Good day @dgarcia

    We don't have access to your instance.

    However, are you using the above code in VF page? If not, then you will need to send the IP address to that node in order to fix it.

    CnP_IaaS.PaaS_Class.Operation operationlist= new CnP_IaaS.PaaS_Class.Operation();

    operationlist.IPAddress = system IP address should be assigned

    Hope that helps.
    Regards,
    Click & Pledge Support Department

    On Salesforce? Help us by rating our app: Click & Pledge Donor Management on AppExchange

    Join us @ the educational webinars: https://clickandpledge.com/webinars/
    Live Support available Join between 3:00 - 3:30 p.m. ET Monday - Thursday: https://clickandpledge.com/webinars/
    Are you on Salesforce? Join us at the Power of Us Hub: https://powerofus.force.com/0F980000000CjpC

    Comment


    • #3
      CnP.Support.AM thank you for responding, I've granted login access to the instance under my account [email protected]

      As far as the IP address for that, is that the current client's IP or another specific IP address?

      Comment


      • #4
        Good day @dgarcia

        It should be the current client's IP. Please include the IP and test it.

        If you need more assistance please let us know.
        Regards,
        Click & Pledge Support Department

        On Salesforce? Help us by rating our app: Click & Pledge Donor Management on AppExchange

        Join us @ the educational webinars: https://clickandpledge.com/webinars/
        Live Support available Join between 3:00 - 3:30 p.m. ET Monday - Thursday: https://clickandpledge.com/webinars/
        Are you on Salesforce? Join us at the Power of Us Hub: https://powerofus.force.com/0F980000000CjpC

        Comment

        Working...
        X