Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix using get_client_token for Braintree
Marcin Gębala8a49f5f3a553
diff --git a/docs/guides/payments.rst b/docs/guides/payments.rstindex 170798405f..bd252b8c2c 100644--- a/docs/guides/payments.rst+++ b/docs/guides/payments.rst@@ -17,7 +17,7 @@ Your changes should live under theAfter completing those steps you will also need to integrate your paymentgateway into your SPA Storefront's workflow.-get_client_token(connection_params)+get_client_token(config)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^A client token is a signed data blob that includes configuration and@@ -31,8 +31,8 @@ Example.. code-block:: python- def get_client_token(connection_params: Dict) -> str:- gateway = get_payment_gateway(**connection_params)+ def get_client_token(config: GatewayConfig) -> str:+ gateway = get_payment_gateway(**config.connection_params)client_token = gateway.client_token.generate()return client_tokendiff --git a/saleor/order/views.py b/saleor/order/views.pyindex 47c975bef0..4e742b38e4 100644--- a/saleor/order/views.py+++ b/saleor/order/views.py@@ -131,7 +131,7 @@ def start_payment(request, order, gateway):return redirect("order:payment-success", token=order.token)return redirect(order.get_absolute_url())- client_token = payment_gateway.get_client_token(connection_params=connection_params)+ client_token = payment_gateway.get_client_token(config=gateway_config)ctx = {"form": form,"payment": payment,