braintree_payment 1.2.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 92

Braintree Payment #

Available for Android and IOS

Braintree Payment plugin for Flutter apps by Deligence Technologies. This plugin lets you integrate Braintree DropIn payment UI in just 4 easy steps.

Minimum Requirements #

Android : To use this plugin you must migrate to AndroidX and set your minSdkVersion to at least 21.

Steps to Enable Payment #

Step 1- To enable the payment support follow below given steps:

Paypal #

Android: #

To add support for Paypal Payment add below lines inside AndroidManifest.xml.

    <activity android:name="com.braintreepayments.api.BraintreeBrowserSwitchActivity"
            <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" />

IOS: #

To add support for Paypal Payment on IOS. 

Basic insturctions from braintree:

1. Register URL Type
2. Update application delegate to setReturnUrlScheme
3. Update application delegate to pass the payment authorization URL to Braintree for finalization

For Detailed instuction follow steps here :-

Google Pay #

To add support for Google Pay add below lines inside AndroidManifest.xml.

<meta-data android:name="" android:value="true"/>

Step 2- Import the plugin:

import 'package:braintree_payment/braintree_payment.dart';

Step 3- Create a object of BraintreePayment and pass Client nonce.


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

Step 4- Variable data will have the payment nonce. Send the paymne nonce to the server for further processing of the payment:

var data = await braintreePayment.showDropIn(
        nonce: clientNonce, amount: "2.0", enableGooglePay: true);
print("Response of the payment $data");

// In case of success
//{"status":"success","message":"Payment successful. Send the payment nonce to the server for the further processing.":"paymentNonce":"jdsfhedbyq772_34dfsf"}

// In case of Failure
//{"status":"fail","message":"User canceled the payment"}

Screenshot #

1.2.2 #

Added authors

1.2.0 #

Added new parameter to the function

1.1.9 #

Updated documentation

1.1.8 #

Added support for Sandbox

1.0.2 #

Changed IOS code from Swift to Objective C

1.0.1 #

Fixed bug in Boolean value

1.0.0 #

Google Pay support

0.0.3 #

Updated Documentation

0.0.2 #

Migrate to Android X.

0.0.1 #

Initial Release.


example #

A new Flutter project.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  braintree_payment: ^1.2.2

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:braintree_payment/braintree_payment.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Dec 13, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.1+4
  • Flutter: 1.12.13+hotfix.4

Health issues and suggestions

Document public APIs. (-1 points)

4 out of 4 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies