Skip to content

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

Fix using get_client_token for Braintree

Marcin Gębala8a49f5f3a553
diff --git a/docs/guides/payments.rst b/docs/guides/payments.rst
index 170798405f..bd252b8c2c 100644
--- a/docs/guides/payments.rst
+++ b/docs/guides/payments.rst
@@ -17,7 +17,7 @@ Your changes should live under the
After completing those steps you will also need to integrate your payment
gateway 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_token
diff --git a/saleor/order/views.py b/saleor/order/views.py
index 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,