0
votes

I'm using BrainTree payment gateway in my flutter app and using this library https://pub.dev/packages/braintree_payment for payment.

So the code is also given on that page like this :

String clientNonce = " GET YOUR CLIENT NONCE FROM YOUR SERVER";

BraintreePayment braintreePayment = new BraintreePayment();
var data = await braintreePayment.showDropIn(
        nonce: clientNonce, amount: "2.0", enableGooglePay: true);

But i don't know how to get clientNonce or Nonce from server, So can anyone suggest how to get the nonce that we need to pass in order to show the drop in UI?

Thanks in advance.

1

1 Answers

-1
votes

Use an HTTP library to fetch the data from an endpoint on your server.

For example, this one: https://flutter.dev/docs/cookbook/networking/fetch-data

When your server endpoint receives this request, it must obtain a new nonce and return it.