lewsid / chargify-php

Chargify API wrapper for PHP
http://chargify.com
6 stars 1 forks source link

XML error #3

Open ghost opened 6 years ago

ghost commented 6 years ago

Hi

I'm very new to this so please excuse my ignorance. I am using the test script like below

require_once "./lib/ChargifyConnector.php"; $test_mode = true; $connector = new ChargifyConnector($test_mode); $products = $connector->getAllProducts(); var_dump($products);

However, I get the following error returned :

Fatal error: Uncaught Exception: String could not be parsed as XML in C:\websites\invoicing\chargify\lib\ChargifyConnector.php:171 Stack trace: #0 C:\websites\invoicing\chargify\lib\ChargifyConnector.php(171): SimpleXMLElement->__construct('') #1 C:\websites\invoicing\chargify\chargify.php(7): ChargifyConnector->getAllProducts() #2 {main} thrown in C:\websites\invoicing\chargify\lib\ChargifyConnector.php on line 171

I have changed the API key and URL to mine and I do have 1 product in my Chargify account.

Any suggestions ?

lewsid commented 6 years ago

Sorry for the delay in getting back to you. It's pretty likely you already got this sorted out, but in these cases it's helpful to echo the response from the API to see what you're getting. When you get an error stating that the string could not be parsed as XML, it's usually because some other error is being spit out from the API. It would be helpful to know what that error is. It's possible this wrapper has simply fallen too out of date to work with the latest version of Chargify (I've not updated it in 9 years).