QuickBooks-V3-PHP-SDK icon indicating copy to clipboard operation
QuickBooks-V3-PHP-SDK copied to clipboard

No error message returned if subscription period has ended

Open javabudd opened this issue 4 years ago • 3 comments

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 avatar Oct 29 '19 21:10 javabudd

@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.

bsivalingam avatar Mar 26 '20 21:03 bsivalingam

I'll work towards getting a PR this week

javabudd avatar Apr 06 '20 01:04 javabudd

Opening up our SDK for hacktoberfest contributions.

abisalehalliprasan avatar Sep 22 '20 00:09 abisalehalliprasan