his is a continuation of the previous question:
I am taking over implementation of this.
The previous developer response:
I've created a live transaction and attempting to process a refund for it with a valid transaction number.
When I attempt:
* I am using Live Transactions (in my settings)
I get a "null pointer exception" when I attempt to call:
Examining the schema, I see
So I attempt to directly assign:
This does not change the behavior from within the package code.
* This is odd because reviewing another method ( previously implemented ) for payments, and the call to xmlstring.getOperation_node(...) works normally
I am taking over implementation of this.
The previous developer response:
I've created a live transaction and attempting to process a refund for it with a valid transaction number.
When I attempt:
Code:
CnP_IaaS.PaaS_Class xmlstring = new CnP_IaaS.PaaS_Class(); CnP_IaaS.PaaS_Class.Operation xmloperation = new CnP_IaaS.PaaS_Class.Operation(); CnP_IaaS.PaaS_Class.Application xmlapplication = new CnP_IaaS.PaaS_Class.Application(); CnP_IaaS.PaaS_Class.Order XmlOrder = new CnP_IaaS.PaaS_Class.Order(); CnP_IaaS.PaaS_Class.Authentication XmlAuthentication = new CnP_IaaS.PaaS_Class.Authentication(); CnP_IaaS.PaaS_Class.cnpTransaction xmltransaction = new CnP_IaaS.PaaS_Class.cnpTransaction(); CnP_IaaS.PaaS_Class.Receipt xmlReceipt = new CnP_IaaS.PaaS_Class.Receipt(); xmloperation.DeclineFraud = false; xmloperation.EnableRestriction = false; //xmlstring.getApplication_node(xmlapplication); XmlAuthentication.AccountID = PaymentProcessor.SETTINGS.Click_Pledge_Account_ID__c; XmlAuthentication.AccountGuid = PaymentProcessor.SETTINGS.Click_Pledge_Account_GUID__c; if (PaymentProcessor.SETTINGS.Enable_Live_Transactions__c == true) { XmlOrder.OrderMode = 'Production'; } else { XmlOrder.OrderMode = 'Test'; } ////XmlOrder.setTracker(tracker); xmlReceipt.SendReceipt = false; xmltransaction.TransactionType = 'Refund'; xmltransaction.OrderNumber = transactionNumber; // Transaction Ordernumber //xmlstring.getRefundTransactionDetails_node(xmltransaction); xmlstring.getOperation_node(xmloperation); xmlstring.getOrder_node(XmlOrder); xmlstring.getAuthentication_node(XmlAuthentication); xmlstring.getreceipt_node(xmlReceipt); xmlstring.getTransactionType(); xmlstring.getgeneratexml(xmlstring); System.debug('************* -- ' + xmlstring.xmlfile); //System.debug(xmlstring.xmlfile); xmlstring.Send_Transaction_api(xmlstring.xmlfile); TransactionResult result = new TransactionResult(); System.debug(xmlstring); if (xmlstring.TransactionResultCode == 0) { result.isSuccess = true; } else { result.isSuccess = false; } //result.transactionResultCode = xmlstring.TransactionResultCode; //result.errorData = xmlstring.ErrorData; //result.transactionNumber = xmlstring.TransactionNumber; //result.VaultGUID = cnpXmlString.VaultGUID; //result.AdditionalInfo = cnpXmlString.AdditionalInfo; return null;
I get a "null pointer exception" when I attempt to call:
Code:
xmlstring.getOperation_node(xmloperation);
Code:
<xsd:element name="Operation"> <xsd:complexType> <xsd:sequence> <xsd:element ref="OperationType"/> <xsd:element ref="IPAddress" minOccurs="0"/> <xsd:element ref="DeclineFraud" minOccurs="0"/> <xsd:element ref="KountSessionID" minOccurs="0"/> <xsd:element ref="EnableRestriction" minOccurs="0"/> <xsd:element ref="UrlReferrer" minOccurs="0"/> </xsd:sequence> </xsd:complexType> </xsd:element>
Code:
xmloperation.OperationType = 'Refund'; xmlstring.getOperation_node(xmloperation);
* This is odd because reviewing another method ( previously implemented ) for payments, and the call to xmlstring.getOperation_node(...) works normally
Comment