Skip to content

JSONException on 405 error #7

@rougou

Description

@rougou

Hi, we got the following exception calling updateCheckoutSession in our production (LIVE) environment.
Not sure the cause of the 405 to begin with, but the SDK attempts to convert the response to JSON despite it being HTML.

A JSONObject text must begin with '{' at character 1 of <html>
<head><title>405 Not Allowed</title></head>
<body bgcolor="white">
<center><h1>405 Not Allowed</h1></center>
<hr><center>Server</center>
</body>
</html>
net.sf.json.JSONException: A JSONObject text must begin with '{' at character 1 of <html>
<head><title>405 Not Allowed</title></head>
<body bgcolor="white">
<center><h1>405 Not Allowed</h1></center>
<hr><center>Server</center>
</body>
</html>
        at net.sf.json.util.JSONTokener.syntaxError(JSONTokener.java:499)
        at net.sf.json.JSONObject._fromJSONTokener(JSONObject.java:972)
        at net.sf.json.JSONObject._fromString(JSONObject.java:1201)
        at net.sf.json.JSONObject.fromObject(JSONObject.java:165)
        at net.sf.json.JSONObject.fromObject(JSONObject.java:134)
        at com.amazon.pay.api.AmazonPayClient.processRequest(AmazonPayClient.java:215)
        at com.amazon.pay.api.AmazonPayClient.callAPI(AmazonPayClient.java:163)
        at com.amazon.pay.api.WebstoreClient.updateCheckoutSession(WebstoreClient.java:128)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions