QuickBooks-V3-PHP-SDK
QuickBooks-V3-PHP-SDK copied to clipboard
No error message returned if subscription period has ended
The QuickBooksOnline\API\Core\Http\Serialization\XmlObjectSerializer::Deserialize() method returns NULL if Fault
is equal to the XML objects name
(line 245). This then prevents any future access to the error message.
$oneXmlElementName = (string)$oneXmlObj->getName(); if ('Fault'==$oneXmlElementName) { return null; }
Contents of $oneXmlObj:
object(SimpleXMLElement)#2962 (2) { ["@attributes"]=> array(1) { ["type"]=> string(15) "ValidationFault" } ["Error"]=> object(SimpleXMLElement)#3118 (3) { ["@attributes"]=> array(2) { ["code"]=> string(4) "6190" ["element"]=> string(0) "" } ["Message"]=> string(22) "Invalid Company Status" ["Detail"]=> string(322) "Subscription period has ended or canceled or there was a billing problem : You can't add data to QuickBooks Online Essentials because your trial or subscription period ended, you canceled your subscription, or there was a billing problem. To update your subscription, click the gear icon and view your account information." } }
Expected results: The error message should be accessible to library consumers Actual results: The error message is not accessible
@javabudd Thanks for bringing this to my attention. I will add a story to my the backlong, meanwhile if you have a fix, please send a PR.
I'll work towards getting a PR this week
Opening up our SDK for hacktoberfest contributions.