braintree 0.0.1 copy "braintree: ^0.0.1" to clipboard
braintree: ^0.0.1 copied to clipboard

discontinuedreplaced by: flutter_braintree
outdated

A flutter plugin wrapping the native Braintree Drop-in UI SDKs

Braintree for Flutter #

A Flutter plugin that wraps the native Braintree Drop-In UI SDKs. Currently only supports Android.

Installation #

Add braintree to your pubspec.yaml file:

dependencies:
  ...
  braintree: ^0.0.1

Android #

In order for your Drop-in to support PayPal payments, you must allow for PayPal's browser switch by adding an intent filter to your AndroidManifest.xml:

<activity android:name="com.braintreepayments.api.BraintreeBrowserSwitchActivity"
    android:launchMode="singleTask">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="${applicationId}.braintree" />
    </intent-filter>
</activity>

Make sure the scheme contains only lowercase letters, and ends with .braintree. If your package contains underscores, remove them from the specified scheme!

Usage #

Import the plugin:

import 'package:braintree/braintree.dart';

Then launch the Drop-in UI:

BraintreeDropInResult result = await BraintreeDropIn.launch(
  clientToken: '<INSERT YOUR CLIENT TOKEN HERE>',
  collectDeviceData: false,
);

Access the payment nonce:

if (result != null) {
  print('Nonce: ${result.paymentMethodNonce.nonce}');
} else {
  print('Payment was canceled.');
}

See BraintreeDropInResult and BraintreePaymentMethodNonce for more documentation.

0
likes
0
points
32
downloads

Publisher

unverified uploader

Weekly Downloads

A flutter plugin wrapping the native Braintree Drop-in UI SDKs

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on braintree