I'm trying to run some API scripts found in this github https://github.com/abraham/chargify
with this library https://github.com/jforrest/Chargify-PHP-Client/When I run the subscriptions.php file, I get this error:
Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 1: parser error : Start tag expected, '<' not found in /Applications/MAMP/htdocs/abraham-chargify-ace5a40/lib/ChargifyConnector.php on line 557
What is causing this error/How do开发者_运维百科 I get rid of it?
Well sorry to say this problem turned out to be a settings problem. If the customer doesn't submit a shipping address (required) then that apparently generates the above error. Just input an address or remove the shipping address requirement if you fall into this error with Chargify.
This happens when there is an error and the response is not XML as expected. Chargify-PHP-Client still tries to parse the response as XML and throws this error. If you look at the response before Chargify tries to parse it, you'll usually see an error message that will lead you to the actual problem.
精彩评论