QuickBooks-V3-PHP-SDK
QuickBooks-V3-PHP-SDK copied to clipboard
Property JournalEntry does not exist. Class IPPRecurringTransaction
Trying to retrieve a list of RecurringTransactions and I get this error.
$dataService->Query("select * from RecurringTransaction");
I am getting the following exception in PhpObjFromXml
in /src/Core/Http/Serialization/XmlObjectSerializer.php
of the SDK. I"m using version 6.0.1 of the SDK.
Property JournalEntry does not exist. Class QuickBooksOnline\API\Data\IPPRecurringTransaction
Managed to patch this by adding this to /src/Data/IPPRecurringTransaction.php
/**
* @xmlType element
* @xmlName JournalEntry
* @varz com\intuit\schema\finance\v3\JournalEntry
* @var IPPJournalEntry
*/
public $JournalEntry;
/**
* @xmlType element
* @xmlName Purchase
* @varz com\intuit\schema\finance\v3\Purchase
* @var IPPPurchase
*/
public $Purchase;
/**
* @xmlType element
* @xmlName Invoice
* @varz com\intuit\schema\finance\v3\Invoice
* @var IPPInvoice
*/
public $Invoice;
Had to also add this:
/**
* @xmlType element
* @xmlName SalesReceipt
* @varz com\intuit\schema\finance\v3\SalesReceipt
* @var IPPSalesReceipt
*/
public $SalesReceipt;
In order to get the correct error message, I have to modify error message in /src/DataService/DataService.php
with this in order to get the actual error message:
try {
$responseXmlObj = simplexml_load_string($responseBody);
if ($responseXmlObj && $responseXmlObj->QueryResponse) {
$tmpXML = $responseXmlObj->QueryResponse->asXML();
$parsedResponseBody = $this->responseSerializer->Deserialize($tmpXML, false);
$this->serviceContext->IppConfiguration->Logger->CustomLogger->Log(TraceLevel::Info, $parsedResponseBody);
}
} catch (\Exception $e) {
throw new \Exception("Exception appears in converting Response to XML.");
}
to
try {
$responseXmlObj = simplexml_load_string($responseBody);
if ($responseXmlObj && $responseXmlObj->QueryResponse) {
$tmpXML = $responseXmlObj->QueryResponse->asXML();
$parsedResponseBody = $this->responseSerializer->Deserialize($tmpXML, false);
$this->serviceContext->IppConfiguration->Logger->CustomLogger->Log(TraceLevel::Info, $parsedResponseBody);
}
} catch (\Exception $e) {
echo print_r($e);
throw new \Exception("Exception appears in converting Response to XML.");
}
Looks like this is the complete list of types that should probably be added to support: Bill, Purchase, CreditMemo, Deposit, Estimate, Invoice, JournalEntry, RefundReceipt, SalesReceipt, Transfer, VendorCredit, and PurchaseOrder