Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Get store_card and auto_capture for all gateways from env

Jakub Draganek58bc79900e51
diff --git a/saleor/settings.py b/saleor/settings.py
index 878156d36f..5742cc36d8 100644
--- a/saleor/settings.py
+++ b/saleor/settings.py
@@ -607,8 +607,8 @@ PAYMENT_GATEWAYS = {
BRAINTREE: {
"module": "saleor.payment.gateways.braintree",
"config": {
- "auto_capture": True,
- "store_card": False,
+ "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),
@@ -621,8 +621,8 @@ PAYMENT_GATEWAYS = {
RAZORPAY: {
"module": "saleor.payment.gateways.razorpay",
"config": {
- "store_card": False,
- "auto_capture": None,
+ "store_card": get_bool_from_env("RAZORAY_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"),
@@ -636,8 +636,8 @@ PAYMENT_GATEWAYS = {
STRIPE: {
"module": "saleor.payment.gateways.stripe",
"config": {
- "store_card": False,
- "auto_capture": True,
+ "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"),