Skip to content

Commit d9dce92

Browse files
committed
1 parent f6156eb commit d9dce92

File tree

69 files changed

+1356
-792
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1356
-792
lines changed

.flutter-plugins

Lines changed: 0 additions & 1 deletion
This file was deleted.

.gitattributes

Lines changed: 0 additions & 2 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@
33

44
.packages
55
.pub/
6-
pubspec.lock
76

87
build/
9-
.idea

.idea/.gitignore

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/Project.xml

Lines changed: 116 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/Dart_SDK.xml

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/Flutter_Plugins.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/Flutter_for_Android.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/example_lib_main_dart.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.metadata

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: f139b11009aeb8ed2a3a3aa8b0066e482709dde3
8+
channel: stable
9+
10+
project_type: plugin

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
## [0.1.1]
2-
* 使用强类型保存支付结果
3-
1+
## 0.0.1
42

3+
* TODO: Describe initial release.

LICENSE

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1 @@
1-
MIT License
2-
3-
Copyright (c) 2018 JZoom
4-
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
1+
TODO: Add your license here.

README.md

Lines changed: 31 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -5,100 +5,76 @@ A flutter plugin to use alipay.
55
有任何问题,欢迎加入qq群854192563交流
66

77

8-
## Features
8+
## 功能列表
99

10+
* 调用支付
1011

11-
## Install
1212

13-
Add this to your package's pubspec.yaml file:
13+
## 安装
14+
15+
增加依赖 pubspec.yaml
1416
```
1517
dependencies:
16-
flutter_alipay: "^0.1.0"
18+
flutter_alipay: "^1.0.0"
1719
```
1820

19-
## Getting Started
20-
21-
* Android
21+
## 开始
2222

23-
* Add following permissions to your AndroidManifest.xml
24-
```
25-
<uses-permission android:name="android.permission.INTERNET" />
26-
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
27-
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
28-
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
29-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
23+
* ios集成
3024

31-
```
3225

33-
* ios
3426

35-
* Add a URL scheme in info.plist
27+
+ 在info.plist增加一条URL scheme
3628

3729
```
3830
<key>CFBundleURLTypes</key>
3931
<array>
4032
<dict>
41-
<key>CFBundleURLName</key>
42-
<string>alipay</string>
4333
<key>CFBundleTypeRole</key>
4434
<string>Editor</string>
4535
<key>CFBundleURLSchemes</key>
4636
<array>
47-
<string>YOUR APP SCHEME NAME</string>
37+
<string>org.zoomdev.flutter.alipay</string>
4838
</array>
4939
</dict>
5040
</array>
5141
```
42+
如果需要定制URL scheme可以这么做:
5243

53-
Make sure you have a CFBundleURLName=alipay in CFBundleURLTypes.
54-
55-
56-
* In AppDelegate.m, do header import
57-
58-
```
59-
#import "FlutterAlipayPlugin.h"
60-
```
61-
62-
and add following code
63-
64-
```
65-
// ios 8.x or older
66-
-(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{
67-
68-
return [FlutterAlipayPlugin handleOpenURL:url];
69-
}
70-
// ios 9.0+
71-
-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options{
72-
return [FlutterAlipayPlugin handleOpenURL:url];
73-
}
44+
+ 或者
7445

75-
```
76-
77-
## How to use
7846
```
79-
import 'package:flutter_alipay/flutter_alipay.dart';
47+
<key>CFBundleURLTypes</key>
48+
<array>
49+
<dict>
50+
<key>CFBundleTypeRole</key>
51+
<string>Editor</string>
52+
<key>CFBundleURLSchemes</key>
53+
<array>
54+
<string>__YOUR APP SCHEME NAME__</string>
55+
</array>
56+
</dict>
57+
</array>
8058
```
8159

60+
然后在app中调用
61+
8262
```
83-
var result = await FlutterAlipay.pay("you pay info from server");
63+
await FlutterAlipay.setIosUrlSchema('YOUR APP SCHEME NAME');
8464
```
8565

86-
## Using flutter_alipay in Swift
8766

88-
Edit `Runner-Bridging-Header.h`,add
8967

68+
## 使用
9069
```
91-
#import <flutter_alipay/FlutterAlipayPlugin.h>
92-
70+
import 'package:flutter_alipay/flutter_alipay.dart';
9371
```
9472

95-
Edit `AppDelegate.swift`,add
9673

97-
```
74+
* 调取支付
9875

99-
override func application(_ application: UIApplication, handleOpen url: URL) -> Bool {
100-
return FlutterAlipayPlugin.handleOpen(url);
101-
}
76+
```
77+
var result = await FlutterAlipay.pay("you pay info from server");
10278
```
10379

10480

0 commit comments

Comments
 (0)