Skip to content

thaingo/flutter_payments

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flutter_payments

Flutter In App Purchases For Humans.

pub package

Getting Started

This plugin makes it easy to make products or subscriptions for both Apple App Store and Google Play.

Subscriptions

You can use the built-in SubscriptionManager which provides a Stream interface for purchase states and abstracts away most of the logic around subscription management. However, it does not perform extended validation of a Subscription, so it may be possible to inject an invalid Subscription depending on the platform and device security settings. It is recommended that you perform server-side validation of all purchases, if that is a concern.

SubscriptionManager Example

In App Purchases (Non-subscription Products)

You can run the included example app on an Android device to test the payment flow with test product SKUs.

Example App

FlutterPayments.billingEnabled

Determine if Billing is available on the device.

final bool billingEnabled = await FlutterPayments.billingEnabled;

FlutterPayments.getProducts

Fetch Product metadata from the store.

final List<Product> getProducts = await FlutterPayments.getProducts(
  skus: <String>[
    'android.test.purchased',
    'android.test.canceled',
  ],
  type: ProductType.InApp,
);

FlutterPayments.purchase

List<Purchase> purchase = await FlutterPayments.purchase(
  sku: 'android.test.purchased',
  type: ProductType.InApp,
);

FlutterPayments.getPurchaseHistory

Get the User's purchase history from the Store. Returns a list of Purchase instances.

final List<Purchase> purchaseHistory = await FlutterPayments.getPurchaseHistory(ProductType.InApp);
print('purchaseHistory: $purchaseHistory');

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 48.9%
  • Kotlin 24.6%
  • Swift 15.3%
  • Ruby 8.1%
  • Java 1.9%
  • Objective-C 1.2%