Announcement

Collapse
No announcement yet.

Null pointer exception thrown on getOperation

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

  • CnP.Support.AM
    replied
    Duplicate post of the following: https://forums.clickandpledge.com/fo...n-getoperation

    Leave a comment:


  • dgarcia
    started a topic Null pointer exception thrown on getOperation

    Null pointer exception thrown on getOperation

    Hi All,

    We're trying to set up an integration with the C&P Salesforce API to submit a transaction and no matter how we try it we keep getting a null pointer exception on FATAL_ERROR Class.CnP_IaaS.PaaS_Class.getOperation_node: line 81, column 1. We have even tried making a static version of one of the sample classes and even though the debugger shows the same data, our class still gets the exception while the sample class submits the transaction successfully. Below is the code that we are using for one of the test scenarios:

    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);
    Our dev sandbox org is 00D1g0000008hZT and we are blocked by this issue. Could we get some help with creating a static method for this or what we would need to change? Thanks
Working...
X