Skip to content

Commit b523bdc

Browse files
committed
[#3793] Switch back to 32 chars for order ID, add a TODO comment
1 parent 1dc7913 commit b523bdc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/openforms/payments/migrations/0008_auto_20240130_1436.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Migration(migrations.Migration):
2020
field=models.CharField(
2121
blank=True,
2222
help_text="The order ID to be sent to the payment provider. This ID is built by concatenating an optional global prefix, the submission public reference and a unique incrementing ID.",
23-
max_length=255,
23+
max_length=32,
2424
verbose_name="Order ID",
2525
),
2626
),

src/openforms/payments/models.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ def create_for(
4444

4545
@staticmethod
4646
def create_public_order_id_for(payment: SubmissionPayment) -> str:
47+
"""Create a public order ID to be sent to the payment provider."""
48+
49+
# TODO it isn't really clear what the required format/max length is
50+
# for payment providers. Ogone seems to allow up to 40 characters or so,
51+
# So this might fail at some point.
4752
config = GlobalConfiguration.get_solo()
4853
prefix = config.payment_order_id_prefix.format(year=payment.created.year)
4954
if prefix:
@@ -82,7 +87,7 @@ class SubmissionPayment(models.Model):
8287
# TODO Django 5.2 Update to a `GeneratedField`
8388
public_order_id = models.CharField(
8489
_("Order ID"),
85-
max_length=255,
90+
max_length=32,
8691
blank=True,
8792
help_text=_(
8893
"The order ID to be sent to the payment provider. This ID is built by "

0 commit comments

Comments
 (0)