开发者

Chargify API - XML issue - '<' not found

开发者 https://www.devze.com 2023-02-05 16:33 出处:网络
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/

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号