Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Refactor payment_error
Aleksander Spyra3e746efe4423
diff --git a/saleor/payment/gateways/braintree/forms.py b/saleor/payment/gateways/braintree/forms.pyindex 55bc036f10..6e3e07674b 100644--- a/saleor/payment/gateways/braintree/forms.py+++ b/saleor/payment/gateways/braintree/forms.py@@ -2,6 +2,7 @@ from django import formsfrom django.core.exceptions import ValidationErrorfrom django.utils.translation import pgettext_lazy+from ....graphql.core.utils.error_codes import PaymentErrorCodefrom ...interface import PaymentData@@ -32,7 +33,7 @@ class BraintreePaymentForm(forms.Form):"payment error","Unable to process transaction. Please try again in a moment",)- raise ValidationError(msg, code="payment_error")+ raise ValidationError(msg, code=PaymentErrorCode.PAYMENT_ERROR)return cleaned_datadef get_payment_token(self):