Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML parse errors returned when Spreedly sends errors #17

Open
dgmstuart opened this issue Apr 12, 2012 · 2 comments
Open

XML parse errors returned when Spreedly sends errors #17

dgmstuart opened this issue Apr 12, 2012 · 2 comments

Comments

@dgmstuart
Copy link

There are a couple of scenarios in which I get the following XML parse error:

MultiXml::ParseError: Start tag expected, '<' not found"

Firstly when trying to repeat an action like trying to create a subscriber with a customer ID that already exists. The workaround is for me to make sure that before I try and do Anything, I check that it hasn't already been done, but I'd really prefer RSpreedly to return me something sensible.

The other (and far more worrying) scenario is when sending invalid payment details - e.g. the visa 4012888888881881 example from here: http://spreedly.com/manual/integration-reference/payments-api/pay-invoice

I'm not sure what the expected response should be in these cases, but my guess is that the api call is returning something other than XML.

I'd try and patch this myself, but I fear my Ruby-fu is too weak :(


EDIT:
I think this might actually just be a bug in response code handling? Here's the response object I get when creating an invoice with an invalid subscriber record - doing this call results in the XML parse error above:

#<HTTParty::Response:0x8 @parsed_response=nil, @response=#<Net::HTTPNotFound 404 Not Found readbody=true>, @headers={"server"=>["nginx"], "date"=>["Thu, 12 Apr 2012 16:23:55 GMT"], "content-type"=>["text/html"], "connection"=>["close"], "status"=>["404 Not Found"], "content-length"=>["0"], "x-runtime"=>["0.006309"]}> 
@dgmstuart
Copy link
Author

Actually I think this is an issue at the Spreedly end:

Request:

curl -i -u OUR_API_KEY:X -X PUT -H 'Content-Type: application/xml' -d "`cat speedly.xml`"       'https://spreedly.com/api/v4/dgmstuart-test/invoices/0bda902fc1c0f77b0d45c91a7a5d46778c0100ec/pay.xml'

Response:

HTTP/1.1 403 Forbidden
Server: nginx
Date: Tue, 17 Apr 2012 14:54:30 GMT
Content-Type: application/xml; charset=utf-8  <---- It says it's XML
Transfer-Encoding: chunked
Connection: keep-alive
Status: 403 Forbidden
Cache-Control: no-cache
X-UA-Compatible: IE=Edge,chrome=1
X-Runtime: 2.222238

Charge not authorized  <---- But it's not XML

I've emailed someone at Spreedly.

@villanopack
Copy link

is there any solution for this ??

have anybody responded to you at Spreedly ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants