Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add template path to braintree plugin gateway settings
Jakub Draganek02bf19cd5866
diff --git a/saleor/order/views.py b/saleor/order/views.pyindex 6a07aa5a62..fa07e3ae78 100644--- a/saleor/order/views.py+++ b/saleor/order/views.py@@ -1,6 +1,5 @@import logging-from django.conf import settingsfrom django.contrib import auth, messagesfrom django.contrib.auth.decorators import login_requiredfrom django.db import transactiondiff --git a/saleor/payment/gateways/braintree/plugin.py b/saleor/payment/gateways/braintree/plugin.pyindex f7638e201d..8d009d1f10 100644--- a/saleor/payment/gateways/braintree/plugin.py+++ b/saleor/payment/gateways/braintree/plugin.py@@ -38,6 +38,13 @@ def require_active_plugin(fn):class BraintreeGatewayPlugin(BasePlugin):PLUGIN_NAME = "braintree"CONFIG_STRUCTURE = {+ "Template path": {+ "type": ConfigurationTypeField.STRING,+ "help_text": pgettext_lazy(+ "Plugin help text", "Location of django payment template for gateway."+ ),+ "label": pgettext_lazy("Plugin label", "Template path"),+ },"Public API key": {"type": ConfigurationTypeField.STRING,"help_text": pgettext_lazy(@@ -114,7 +121,7 @@ class BraintreeGatewayPlugin(BasePlugin):"public_key": configuration["Public API key"],"private_key": configuration["Secret API key"],},- template_path="",+ template_path=configuration["Template path"],store_customer=configuration["Store customers card"],require_3d_secure=configuration["Require 3D secure"],)@@ -126,6 +133,7 @@ class BraintreeGatewayPlugin(BasePlugin):"description": "","active": False,"configuration": [+ {"name": "Template path", "value": "order/payment/braintree.html"},{"name": "Public API key", "value": ""},{"name": "Secret API key", "value": ""},{"name": "Use sandbox", "value": True},@@ -187,3 +195,7 @@ class BraintreeGatewayPlugin(BasePlugin):@require_active_plugindef get_client_token(self, token_config: "TokenConfig", previous_value):return get_client_token(self._get_gateway_config(), token_config)++ @require_active_plugin+ def get_payment_template(self, previous_value) -> str:+ return self._get_gateway_config().template_path