stripe_flutter_channel

Integration between Stripe payment gateway and flutter using native library iOS and Android

Getting Started

To use this plugin, add shared_preferences as a dependency in your pubspec.yaml file.

Usage

Create Stripe flutter using constructor with publishable key
StripeFlutterChannel stripeClient = StripeFlutterChannel(stripePublishableKey, backendServerLink);
Monitor instance is initialized
bool _isInit = false;

onInitialized() {
    setState(() {
      _isInit = stripeClient.initializeNotifier.value;
    });
}

stripeClient.initializeNotifier.addListener(onInitialized);

///Remember to dispose listeners when page deallocate
stripeClient.initializeNotifier.removeListener(onInitialized);
Create card token by card info
String cardToken = await stripeClient.getCardToken('4242424242424242', 5, 2020, '123');
Create charge request to your backend server
bool isCharged = await stripeClient.createCharge(cardToken, /*10.29*/1029, chargeRequestId: 'YOUR_CHARGE_REQUEST_ID')

Libraries

stripe_channel_constant
stripe_flutter_channel

Dart

VM

dart:ffi
Foreign Function Interface for interoperability with the C programming language. [...]

Web

dart:html
HTML elements and other resources for web-based applications that need to interact with the browser and the DOM (Document Object Model). [...]
dart:js
Low-level support for interoperating with JavaScript. [...]
dart:js_util
Utility methods to efficiently manipulate typed JSInterop objects in cases where the name to call is not known at runtime. You should only use these methods when the same effect cannot be achieved with @JS annotations. These methods would be extension methods on JSObject if Dart supported extension methods.