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

Suddenly getting json.decoder.JSONDecodeError #14

Open
karaburmication opened this issue Nov 26, 2021 · 1 comment
Open

Suddenly getting json.decoder.JSONDecodeError #14

karaburmication opened this issue Nov 26, 2021 · 1 comment

Comments

@karaburmication
Copy link

karaburmication commented Nov 26, 2021

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': '[email protected]',
        '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?

@Anddr3s
Copy link

Anddr3s commented Dec 20, 2021

I've the same problem, were you able to solve this problem?

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