Skip to content

Suddenly getting json.decoder.JSONDecodeError #14

@karaburmication

Description

@karaburmication

Suddenly getting this error during authorization request:

File "C:\Users\Nik\AppData\Local\Programs\Python\Python39\Lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\Nik\AppData\Local\Programs\Python\Python39\Lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I'm using the exact same test code as before:

@blueprint.route('/order', methods=['POST'])
def order():
    # Setup credentials and environment
    twocheckout.Api.auth_credentials({
        'private_key': 'my-private-key',
        'seller_id': 'my-id'
    })
# Setup arguments for authorization request
args = {
    'merchantOrderId': '123',
    'token': request.form["token"],
    'currency': 'USD',
    'total': '1.00',
    'billingAddr': {
        'name': 'Testing Tester',
        'addrLine1': '123 Test St',
        'city': 'Columbus',
        'state': 'OH',
        'zipCode': '43123',
        'country': 'USA',
        'email': 'example@2co.com',
        'phoneNumber': '555-555-5555'
    }
}

# Make authorization request
try:
    result = twocheckout.Charge.authorize(args)
    return result.responseCode
except TwocheckoutError as error:
    return error.msg`

Anyone knows how to resolve it?

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