-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from yeliulee/ohos
add support for OpenHarmony
- Loading branch information
Showing
42 changed files
with
1,042 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
![logo](./arts/tobias_logo.png) | ||
|
||
[![pub package](https://img.shields.io/pub/v/tobias.svg)](https://pub.dartlang.org/packages/tobias) | ||
![Build status](https://github.com/OpenFlutter/tobias/actions/workflows/build_test.yml/badge.svg) | ||
[![GitHub stars](https://img.shields.io/github/stars/OpenFlutter/tobias)](https://github.com/OpenFlutter/tobias/stargazers) | ||
[![GitHub forks](https://img.shields.io/github/forks/OpenFlutter/tobias)](https://github.com/OpenFlutter/tobias/network) | ||
[![GitHub license](https://img.shields.io/github/license/OpenFlutter/tobias)](https://github.com/OpenFlutter/tobias/blob/master/LICENSE) | ||
[![GitHub issues](https://img.shields.io/github/issues/OpenFlutter/tobias)](https://github.com/OpenFlutter/tobias/issues) | ||
<a target="_blank" href="https://qm.qq.com/q/TJ29rkzywM"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="OpenFlutter" title="OpenFlutter"></a> | ||
|
||
[中文移步这里](./README_CN.md) | ||
|
||
|
@@ -9,27 +16,43 @@ | |
|
||
## What's Tobias | ||
|
||
Tobias is a flutter plugin for AliPaySDK. | ||
Tobias is a flutter plugin for AliPaySDK, works on iOS, Android and OpenHarmony | ||
|
||
## Getting Started | ||
|
||
I highly recommend that you read [the official documents](https://docs.open.alipay.com/204/105051/) before using tobias. | ||
|
||
1. You have to config `url_scheme` in [pubspec.yaml](./example/pubspec.yaml). Url scheme is a unique string to | ||
1. You have to config `url_scheme` in [pubspec.yaml](./example/pubspec.yaml). Url scheme is a unique string to | ||
resume you app on iOS but please note that `_` is invalid. | ||
|
||
2. for OpenHarmony, you have to add scheme `alipays` to module.json5 in your project like this: | ||
|
||
```json5 | ||
{ | ||
"module": { | ||
"querySchemes": [ | ||
"alipays" | ||
], | ||
} | ||
} | ||
``` | ||
|
||
## Payment | ||
|
||
It's simple,pass Tobias your order info from server : | ||
|
||
```dart | ||
import 'package:tobias/tobias.dart' ; | ||
Tobias tobias = Tobias(); | ||
tobias.pay(yourOrder); | ||
``` | ||
|
||
If you're working with iOS, please add and pass universal link. See [how to configure universal link](https://opendocs.alipay.com/open/0b9qzi). | ||
|
||
The result is map contains results from AliPay.The result also contains an external filed named `platform` which | ||
means the result is from `iOS` or `android`. | ||
Result sample: | ||
|
||
```dart | ||
{ | ||
result: partner="2088411752388544"&seller_id="[email protected]"&out_trade_no="180926084213001"&subject="test pay"&total_fee="0.01"¬ify_url="http://127.0.0.1/alipay001"&service="mobile.securitypay.pay"&payment_type="1"&_input_charset="utf-8"&it_b_pay="30m"&return_url="m.alipay.com"&success="true"&sign_type="RSA"&sign="nCZ8MDhsNvYNAbrLZJZ2VUy6vydgAp+JCq1aQo6ORDYtI9zwtnja3qNGQNiDJCuktoIj7fSTM487XhjPDqnOreZjIA1GJpxu9D1I3nMXIn1M7DfZ0noDwXcYZ438/jbYac7g8mhpwdKGweLCAni9mO3Y6q3iBFkox8i9PcsGxJY=", | ||
|
@@ -39,9 +62,9 @@ resultStatus: 9000, | |
} | ||
``` | ||
|
||
> NOTE:Tobias use pay_V2. | ||
> If you're facing conflicts with `utdid` on iOS, you can set `no_utdid: true` in [pubspec.yaml](./example/pubspec.yaml) | ||
## Auth | ||
|
@@ -61,10 +84,9 @@ var result = await tobias.isAliPayInstalled; | |
|
||
You can also call `tobias.version` which returns a map contains `version` and `platform`. | ||
|
||
|
||
## Upgrade to 1.0.0 | ||
|
||
There's no need to override `AppDelegate` since `tobais 1.0.0`. If you have done that before, please remove | ||
There's no need to override `AppDelegate` since `tobais 1.0.0`. If you have done that before, please remove | ||
the following code in your `AppDelegate`: | ||
|
||
```objective-c | ||
|
@@ -79,6 +101,7 @@ the following code in your `AppDelegate`: | |
``` | ||
|
||
If you have to override these two functions, make sure you have called the `super`: | ||
|
||
```objective-c | ||
|
||
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { | ||
|
@@ -92,20 +115,18 @@ If you have to override these two functions, make sure you have called the `supe | |
} | ||
``` | ||
|
||
|
||
|
||
### Donate | ||
|
||
Buy me a cup of coffee。 | ||
|
||
<img src="./arts/wx.jpeg" height="300"> <img src="./arts/ali.jpeg" height="300"> | ||
|
||
|
||
### Subscribe Us On WeChat | ||
|
||
![subscribe](./arts/wx_subscription.png) | ||
|
||
## LICENSE | ||
|
||
|
||
Copyright 2018 OpenFlutter Project | ||
|
||
Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
|
Oops, something went wrong.