Stripe: Filter statement_descriptor postfix for unacceptable characters

This commit is contained in:
Martin Gross
2024-01-22 12:15:21 +01:00
parent 4fb49820af
commit cff9ae6b18

View File

@@ -556,7 +556,7 @@ class StripeMethod(BasePaymentProvider):
# the postfix. # the postfix.
return '{code} {postfix}'.format( return '{code} {postfix}'.format(
code=payment.order.code, code=payment.order.code,
postfix=self.settings.postfix, postfix=re.sub('[^a-zA-Z0-9 ]', '', str(self.settings.postfix)),
)[:length] )[:length]
else: else:
# If no custom postfix is set, we transmit the event slug and event name for backwards compatibility # If no custom postfix is set, we transmit the event slug and event name for backwards compatibility