stripe_payment 0.0.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 45

stripe_payment #

A flutter plugin to integrate the stripe plugin for iOS and Android. Currently only adding a credit card as source is implemented.

Usage #

To set your publishable key set:

import 'package:stripe_payment/stripe_payment.dart';
StripeSource.setPublishableKey("pk_test_MA0JmL7HowNa25IxNKp4toZF");

from somewhere in your code, e.g. your main.dart file.

To open the dialog:

StripeSource.addSource.then((String token) {
    print(token); //your stripe card source token
});

Android #

Please be aware that your main activity must extend from FlutterFragmentActivity. Otherwise the Android dialog would've looked very nasty.

TODO #

  • [ ] better error handling
  • [ ] internationalization
  • [ ] more stripe library implementations?

[0.0.1] - 29.01.2018

  • Initial release.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:stripe_payment/stripe_source.dart';

void main() {
  runApp(new MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';

  @override
  initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  initPlatformState() async {
    String platformVersion;
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
      platformVersion = await StripeSource.platformVersion;
    } on PlatformException {
      platformVersion = 'Failed to get platform version.';
    }

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted)
      return;

    setState(() {
      _platformVersion = platformVersion;
    });
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('Plugin example app'),
        ),
        body: new Center(
          child: new Text('Running on: $_platformVersion\n'),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  stripe_payment: ^0.0.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or 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:stripe_payment/stripe_payment.dart';
  
Version Uploaded Documentation Archive
0.1.0 Feb 22, 2019 Go to the documentation of stripe_payment 0.1.0 Download stripe_payment 0.1.0 archive
0.0.9 Feb 7, 2019 Go to the documentation of stripe_payment 0.0.9 Download stripe_payment 0.0.9 archive
0.0.8 Dec 8, 2018 Go to the documentation of stripe_payment 0.0.8 Download stripe_payment 0.0.8 archive
0.0.7 Dec 3, 2018 Go to the documentation of stripe_payment 0.0.7 Download stripe_payment 0.0.7 archive
0.0.6 May 16, 2018 Go to the documentation of stripe_payment 0.0.6 Download stripe_payment 0.0.6 archive
0.0.5 Mar 20, 2018 Go to the documentation of stripe_payment 0.0.5 Download stripe_payment 0.0.5 archive
0.0.4 Jan 29, 2018 Go to the documentation of stripe_payment 0.0.4 Download stripe_payment 0.0.4 archive
0.0.3 Jan 29, 2018 Go to the documentation of stripe_payment 0.0.3 Download stripe_payment 0.0.3 archive
0.0.2 Jan 29, 2018 Go to the documentation of stripe_payment 0.0.2 Download stripe_payment 0.0.2 archive
0.0.1 Jan 29, 2018 Go to the documentation of stripe_payment 0.0.1 Download stripe_payment 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
90
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
45
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://dart.dev/dart-2#migration.

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <2.0.0