Hello!
I am suddenly unable to make Dwolla accounts. The code I’ve written for this is longstanding and has worked until now. Here’s git blame output:
24d7567ab (Fox Piacenti 2018-03-16 12:24:54 -0500 22) def make_dwolla_account(request, user, first_name, last_name):
4233daaa7 (Fox Piacenti 2019-04-16 11:27:17 -0500 23) if user.artist_profile.dwolla_url:
4233daaa7 (Fox Piacenti 2019-04-16 11:27:17 -0500 24) return user.artist_profile.dwolla_url
24d7567ab (Fox Piacenti 2018-03-16 12:24:54 -0500 25)
5b1538900 (Fox Piacenti 2018-03-12 17:10:00 -0500 26) request_body = {
24d7567ab (Fox Piacenti 2018-03-16 12:24:54 -0500 27) 'firstName': first_name,
24d7567ab (Fox Piacenti 2018-03-16 12:24:54 -0500 28) 'lastName': last_name,
5b1538900 (Fox Piacenti 2018-03-12 17:10:00 -0500 29) 'email': user.email,
24d7567ab (Fox Piacenti 2018-03-16 12:24:54 -0500 30) 'ipAddress': get_client_ip(request)[0]
5b1538900 (Fox Piacenti 2018-03-12 17:10:00 -0500 31) }
5b1538900 (Fox Piacenti 2018-03-12 17:10:00 -0500 32)
5b1538900 (Fox Piacenti 2018-03-12 17:10:00 -0500 33) with dwolla as api:
4233daaa7 (Fox Piacenti 2019-04-16 11:27:17 -0500 34) user.artist_profile.dwolla_url = api.post('customers', request_body).headers['location']
4233daaa7 (Fox Piacenti 2019-04-16 11:27:17 -0500 35) user.artist_profile.save()
4233daaa7 (Fox Piacenti 2019-04-16 11:27:17 -0500 36) return user.artist_profile.dwolla_url
The dwolla variable here is a context manager I’ve created to generate a token for the duration of the code in the with statement. Its code is also longstanding and works for every other request to the Dwolla service. I can check transfer statuses just fine, for instance.
I’m unable to reproduce this issue on the sandbox. The error I’m receiving is:
{"code":"Forbidden","message":"The supplied credentials are not authorized for this resource."}
