Skip to content

Commit

Permalink
Accept new format references on gocardless redirects as well
Browse files Browse the repository at this point in the history
  • Loading branch information
mhagander committed Dec 22, 2024
1 parent 8fa3381 commit 9071599
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion postgresqleu/gocardless/backendviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ def connect_to_gocardless(request, paymentmethodid):
impl = paymentmethod.get_implementation()

if request.method == 'GET' and 'ref' in request.GET:
if request.GET['ref'] != str(paymentmethodid):
# Reference is <paymentmethod>-<uuid>, so split it
if '-' not in request.GET['ref']:
return HttpResponse("Invalid reference format")
if request.GET['ref'].split('-', 1)[0] != str(paymentmethodid):
return HttpResponse("Invalid reference")

# Return from authorization, so we should be good to go!
Expand Down

0 comments on commit 9071599

Please sign in to comment.