Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lishuhao/sy_flutter_alipay
支付宝flutter插件
https://github.com/lishuhao/sy_flutter_alipay
alipay flutter
Last synced: 3 months ago
JSON representation
支付宝flutter插件
- Host: GitHub
- URL: https://github.com/lishuhao/sy_flutter_alipay
- Owner: lishuhao
- License: other
- Created: 2018-10-30T13:09:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-22T02:10:24.000Z (about 5 years ago)
- Last Synced: 2023-08-20T23:19:50.829Z (over 1 year ago)
- Topics: alipay, flutter
- Language: Ruby
- Size: 344 KB
- Stars: 86
- Watchers: 3
- Forks: 23
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# I'm sorry I cannot offer support for this package any more. Feel free to fork it, you have the source
# sy_flutter_alipay
flutter 支付宝插件
## 安装
首先在pubspec.ymal 添加依赖
### iOS
添加urlScheme
![添加urlScheme](https://t.alipayobjects.com/images/rmsweb/T1lThhXj4cXXXXXXXX.png)
[参考支付宝文档](https://docs.open.alipay.com/204/105295/)
### Android
无需配置
## 示例
``` dart
import 'package:flutter/material.dart';
import 'package:sy_flutter_alipay/sy_flutter_alipay.dart';void main() => runApp(new MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => new _MyAppState();
}class _MyAppState extends State {
@override
void initState() {
super.initState();
}@override
Widget build(BuildContext context) {
return new MaterialApp(
home: new Scaffold(
appBar: new AppBar(
title: const Text('sy_flutter_alipay example'),
),
body: new Center(
child: RaisedButton(
child: Text('支付'),
onPressed: () async {
const payInfo ="从服务端获取的支付参数";
var result = await SyFlutterAlipay.pay(
payInfo,
urlScheme: '你的ios urlScheme', //前面配置的urlScheme
isSandbox: true //是否是沙箱环境,只对android有效
);
print(result);
}),
),
),
);
}
}```
####
其它Flutter plugin- [微信](https://github.com/lishuhao/sy_flutter_wechat)
- [Flutter组件库](https://github.com/lishuhao/sy_flutter_widgets)
- [高德定位](https://github.com/lishuhao/sy_flutter_amap)
- [七牛云存储SDK](https://github.com/lishuhao/sy_flutter_qiniu_storage)