Skip to content

This plugin is to help flutter developers to enable simple payments within their apps

License

Notifications You must be signed in to change notification settings

pasc0al/simple_payments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Payments

This plugin is to help make payments easy again in Flutter.

Usage

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

Example

import 'package:flutter/material.dart';
import 'package:simple_payments/simple_payments.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      body: Center(
      child: RaisedButton(
        onPressed: _payEasy,
        child: Text('Pay Easy'),
        ),
      ),
    ),
  ));
}

_payEasy() async {
  try {
    var response = await SimplePayments.payWithStripe(map: {"body": {"amount": 10.0, "desc": "Some description optional", "more": "data to pass"}, "url": "The API for Stripe charges", "stripePub": "The Pub key of Stripe"});
  } on TimeoutException {
    print("Timeout");
  } on DeferredLoadException {
    print("Library fails to load");
  }
}

Notes

Your API should expect to receive the following in the POST body:

  • tokenStripe;
  • Your data that is in the body map (you can also add more) shown in the example above.

Also this plugin is using Stripe for payments, in the near future will have PayPal, M-Pesa, etc.

About

This plugin is to help flutter developers to enable simple payments within their apps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published