eyflutter_pays 0.0.3 copy "eyflutter_pays: ^0.0.3" to clipboard
eyflutter_pays: ^0.0.3 copied to clipboard

in app purchase

eyflutter_pays #

A new Flutter project.

Getting Started #

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

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

###内购例子

final _eyflutterPaysPlugin = EyflutterPays();

@override void initState() { super.initState();

/// 支付相关回调
_eyflutterPaysPlugin.addListen(getProductError: (arguments) {
  //获取产品失败
  print('获取产品失败$arguments');
  dismissLoading();
}, verifyPurchaseResult: (arguments) {
  //校验支付结果
  showLoading();
      print('去服务端校验支付结果$arguments');
}, buyProductError: (arguments) {
  dismissLoading();
  print('购买失败$arguments');
});

}

/// 购买产品 - 传产品id _eyflutterPaysPlugin.buyProduct( productId: "399319749353275461");

注: 服务端校验完成以后, 记得移除本地存储的凭证 - 因为本地记录了支付凭证, 防止丢包 _eyflutterPaysPlugin.deleteByPaymentVoucher(arguments);