Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Remove not used settings and clean up
Jakub Draganek749260bb4c44
diff --git a/saleor/order/views.py b/saleor/order/views.pyindex c42838f674..9be5bfa9d8 100644--- a/saleor/order/views.py+++ b/saleor/order/views.py@@ -133,7 +133,7 @@ def start_payment(request, order, gateway):"client_token": client_token,"order": order,}- template_path = settings.PAYMENT_GATEWAYS[gateway]["config"]["template_path"]+ template_path = settings.PAYMENT_GATEWAYS[gateway]["template_path"]return TemplateResponse(request, template_path, ctx)diff --git a/saleor/settings.py b/saleor/settings.pyindex 071c06870b..cfc9090ce7 100644--- a/saleor/settings.py+++ b/saleor/settings.py@@ -615,61 +615,12 @@ BRAINTREE = "braintree"RAZORPAY = "razorpay"STRIPE = "stripe"-CHECKOUT_PAYMENT_GATEWAYS = {- DUMMY: pgettext_lazy("Payment method name", "Dummy gateway")-}-+# TODO: remove this after graphql schema stops generating enum from thisPAYMENT_GATEWAYS = {- DUMMY: {- "module": "saleor.payment.gateways.dummy",- "config": {- "auto_capture": True,- "store_card": False,- "connection_params": {},- "template_path": "order/payment/dummy.html",- },- },- BRAINTREE: {- "module": "saleor.payment.gateways.braintree",- "config": {- "auto_capture": get_bool_from_env("BRAINTREE_AUTO_CAPTURE", True),- "store_card": get_bool_from_env("BRAINTREE_STORE_CARD", False),- "template_path": "order/payment/braintree.html",- "connection_params": {- "sandbox_mode": get_bool_from_env("BRAINTREE_SANDBOX_MODE", True),- "merchant_id": os.environ.get("BRAINTREE_MERCHANT_ID"),- "public_key": os.environ.get("BRAINTREE_PUBLIC_KEY"),- "private_key": os.environ.get("BRAINTREE_PRIVATE_KEY"),- },- },- },- RAZORPAY: {- "module": "saleor.payment.gateways.razorpay",- "config": {- "store_card": get_bool_from_env("RAZORPAY_STORE_CARD", False),- "auto_capture": get_bool_from_env("RAZORPAY_AUTO_CAPTURE", None),- "template_path": "order/payment/razorpay.html",- "connection_params": {- "public_key": os.environ.get("RAZORPAY_PUBLIC_KEY"),- "secret_key": os.environ.get("RAZORPAY_SECRET_KEY"),- "prefill": get_bool_from_env("RAZORPAY_PREFILL", True),- "store_name": os.environ.get("RAZORPAY_STORE_NAME"),- "store_image": os.environ.get("RAZORPAY_STORE_IMAGE"),- },- },- },- STRIPE: {- "module": "saleor.payment.gateways.stripe",- "config": {- "store_card": get_bool_from_env("STRIPE_STORE_CARD", False),- "auto_capture": get_bool_from_env("STRIPE_AUTO_CAPTURE", True),- "template_path": "order/payment/stripe.html",- "connection_params": {- "public_key": os.environ.get("STRIPE_PUBLIC_KEY"),- "secret_key": os.environ.get("STRIPE_SECRET_KEY"),- },- },- },+ DUMMY: {"template_path": "order/payment/dummy.html"},+ BRAINTREE: {"template_path": "order/payment/braintree.html"},+ RAZORPAY: {"template_path": "implement_me"},+ STRIPE: {"template_path": "implement_me"},}GRAPHENE = {diff --git a/tests/api/test_payment.py b/tests/api/test_payment.pyindex 8465af90a7..5afcd0d621 100644--- a/tests/api/test_payment.py+++ b/tests/api/test_payment.py@@ -525,18 +525,8 @@ def set_braintree_customer_id(customer_user, braintree_customer_id):return customer_user-def enable_braintree(settings):- settings.CHECKOUT_PAYMENT_GATEWAYS = {"braintree": None}- return settings--def test_list_payment_sources(- mocker,- enable_braintree,- braintree_customer_id,- set_braintree_customer_id,- user_api_client,+ mocker, braintree_customer_id, set_braintree_customer_id, user_api_client):query = """{diff --git a/tests/settings.py b/tests/settings.pyindex e434780d99..b4d69c550e 100644--- a/tests/settings.py+++ b/tests/settings.py@@ -29,13 +29,6 @@ if "sqlite" in DATABASES["default"]["ENGINE"]: # noqa"MIRROR": None,}-CHECKOUT_PAYMENT_GATEWAYS = {- DUMMY: "Dummy gateway",- BRAINTREE: "Braintree",- RAZORPAY: "Razorpay",- STRIPE: "Stripe",-}-COUNTRIES_ONLY = NoneMEDIA_ROOT = None