Skip to content

Commit

Permalink
Add randomness to the reference when setting up gocardless
Browse files Browse the repository at this point in the history
We must pass a unique reference to gocardless and if our existing one
expired we cannot re-use the one. So add a random uuid to the reference
string and hope that solves it.
  • Loading branch information
mhagander committed Dec 22, 2024
1 parent 4c22c96 commit 8fa3381
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion postgresqleu/util/payment/gocardless.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import io
import json
import time
import uuid

from postgresqleu.util.widgets import StaticTextWidget, MonospaceTextarea
from postgresqleu.util.forms import SubmitButtonField
Expand Down Expand Up @@ -173,7 +174,7 @@ def get_bank_connection_link(self, bank):
self.method.id,
),
'institution_id': bank,
'reference': str(self.method.id),
'reference': "{}-{}".format(self.method.id, uuid.uuid1()),
'agreement': r.json()['id'],
'user_language': 'EN',
}, timeout=20)
Expand Down

0 comments on commit 8fa3381

Please sign in to comment.