Braintree.ClientToken (Braintree v0.13.0)
Generate a token required by the client SDK to communicate with Braintree.
For additional reference see: https://developers.braintreepayments.com/reference/request/client-token/generate/ruby
Link to this section Summary
Functions
Create a client token, or return an error response.
Link to this section Functions
Link to this function
generate(params \\ %{}, opts \\ [])
@spec generate(map(), Keyword.t()) :: {:ok, binary()} | {:error, Braintree.ErrorResponse.t()}
Create a client token, or return an error response.
options
Options
:version
- The default value is 2. Current supported versions are 1, 2, and 3. Please check your client-side SDKs in use before changing this value.
example
Example
{:ok, token} = Braintree.ClientToken.generate()
Generate a specific token version:
{:ok, token} = Braintree.ClientToken.generate(%{version: 3})