If you are using .NET then please select language which you are using for your client side. In BrainTree we have multiple platform integration's.
Here I have done with Javascript.
Follow the js code mentioned in the guide, after passing the values to the javascript function you will get the nonce value.
<form runat="server" id="checkout" method="post">
<div>
<div id="dropin">
<input type="submit" id="btn" value="Pay" onclick="btn_Click" />
</div>
<asp:HiddenField ID="hdn" runat="server" Value="" />
</div>
</form>
<script src="https://js.braintreegateway.com/v2/braintree.js"></script>
<script type="text/javascript">
bt();
function bt() {
braintree.setup(document.getElementById('hdn').value,
'dropin', {
container: 'dropin'
});
}
</script>
For this we have to pass the 'hdn'(client token value generated by Brain Tree) value from code behind.
BraintreeGateway gateway = new BraintreeGateway();
var clientToken = gateway.ClientToken.generate(
new ClientTokenRequest
{
CustomerId = customerID,
}
);
hdn.Value = clientToken.ToString();
Once we pass the client token value, a unique nonce value would get generated. We can get that nonce value in the code behind with the name 'payment_method_nonce'.
string nonce = string.Empty;
NameValueCollection nvc = Request.Form;
nonce = nvc["payment_method_nonce"];