pikaju / flutter-braintree

Flutter plugin that wraps the native Braintree SDKs. Enables payments with credit cards, PayPal, Google Pay and more.
https://pub.dev/packages/flutter_braintree
MIT License
64 stars 119 forks source link

Hello , #31

Closed atta1234 closed 4 years ago

atta1234 commented 4 years ago

Do i need to add google merchant id some where in the code?

pikaju commented 4 years ago

Yes, for creating Google Pay requests you should include your merchant ID in the BraintreeGooglePaymentRequest object instance. This is optional in sandbox mode. See: https://pub.dev/documentation/flutter_braintree/latest/flutter_braintree/BraintreeGooglePaymentRequest-class.html

atta1234 commented 4 years ago

but i have seen the option for web, but in your code i don't see merchant id,

here i the code how to include apple pay and google merchant id, Future loadpaymenthod()async{ var request = BraintreeDropInRequest( tokenizationKey: tokenizationKey, collectDeviceData: true, googlePaymentRequest: BraintreeGooglePaymentRequest( totalPrice: widget.total, currencyCode: 'USD', billingAddressRequired: false, ), paypalRequest: BraintreePayPalRequest( amount: widget.total, displayName: 'FFF', ), ); BraintreeDropInResult result = await BraintreeDropIn.start(request); if (result != null) { showNonce(result.paymentMethodNonce); } } }

pikaju commented 4 years ago

The example code does not include a Google merchant ID because it runs in sandbox mode. For production, you need to write:

BraintreeGooglePaymentRequest(
  totalPrice: widget.total,
  currencyCode: 'USD',
  billingAddressRequired: false,
  googleMerchantID: "<Your merchant ID>",
),