Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Ian Smedley 97 posts 192 karma points
    Sep 15, 2016 @ 21:01
    Ian Smedley

    Resolved: Brain Tree Payments Token Issue


    Everything was working for Brain Tree's Sandbox, but as soon as I changed the setting to "Production" and put in the new keys, payments stopped.

    In the console I'm seeing the error:

    Braintree API Client Misconfigured: clientToken required.

    For some reason token is blank, any ideas, just waiting for this to go live!

    • Thanks in advance!
  • Ian Smedley 97 posts 192 karma points
    Sep 17, 2016 @ 13:48
    Ian Smedley

    I think, Braintree just haven't 'activated' the production account yet.

  • Ian Smedley 97 posts 192 karma points
    Sep 29, 2016 @ 11:19
    Ian Smedley


    So the account is all active now, and yet I'm not getting the Token field being populated when using the Production API, everything works fine for Sandbox, but Production I'm still not getting the Token nonce output to the page...

    Any suggestions of what I could look at please ?


  • Ian Smedley 97 posts 192 karma points
    Sep 30, 2016 @ 11:31
    Ian Smedley

    I'm getting an Authentication error in the logs:

     ERROR Merchello.Providers.Payment.Braintree.Services.BraintreeApiServiceBase - Braintree API request failed.
    Braintree.Exceptions.AuthenticationException: Exception of type 'Braintree.Exceptions.AuthenticationException' was thrown.

    But when I try the keys with the Braintree C# example, I get a client token OK, and as I said, this works in Sandbox..

  • Ian Smedley 97 posts 192 karma points
    Oct 03, 2016 @ 21:02
    Ian Smedley


    After using Fiddler to see what was going on, it turns out Merchello was sending the data to sandbox still!

    I checked the JSON stored in the database, and it was incorrect, it referenced Sandbox even though Production was chosen in the settings tab.

    I just altered the JSON in the database,and now it is sending requests to the Production API and I get a token!


  • Chaz Klein 17 posts 88 karma points
    Apr 11, 2017 @ 20:10
    Chaz Klein

    Thank you man! I know this is an old post but you just saved me after about 2 hours of frustration!!!

  • Dan 1248 posts 3733 karma points admin c-trib
    Jul 12, 2018 @ 16:25

    Thanks Ian. Was banging my head against a wall there wondering why everything in Sandbox mode was working but I was getting a "Failed to retrieve and/or create a Braintree Customer" when using the Production Braintree credentials. Turns out there's a bug in Merchello whereby it doesn't save the updated environmentType key value in the 'extendedData' field of the 'merchGatewayProviderSettings' table. All other API credentials had saved correctly (including the 'environment' value which was a red-herring!) but nestled at the end of that JSON config the 'environmentType' was still set to 'Sandbox'. Note, I had to restart the app pool for this to take effect.

Please Sign in or register to post replies

Write your reply to: