tobias 1.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 92

logo pub package

中文移步这里

QQ Group:892398530。

What's Tobias #

Tobias is a flutter plugin for AliPaySDK.

Getting Started #

I highly recommend that you read the official documents before using tobias. Tobias helps you to do something but not all. For example, you have to configure your URL Scheme on iOS.

Payment #

It's simple,pass Tobias your order info from server :

import 'package:tobias/tobias.dart' as tobias;
tobias.pay(yourOrder);

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:

{
result: partner="2088411752388544"&seller_id="etongka123@163.com"&out_trade_no="180926084213001"&subject="test pay"&total_fee="0.01"&notify_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=",
resultStatus: 9000,
 memo: ,
 platform:iOS
}

NOTE:Tobias use pay_V2.

Auth #

    tobias.auth("your auth str");

Check AliPay Installation #

    var result = await tobias.isAliPayInstalled();
   

If you want to check alipay installation of Alipay on iOS,make sure you have added alipays into your whitelist in info.plist.

For iOS,yout have to add url schema named alipay. On Xcode GUI: url_schema

in your info.plist:

     <array>
   		<dict>
   			<key>CFBundleTypeRole</key>
   			<string>Editor</string>
   			<key>CFBundleURLName</key>
   			<string>alipay</string>
   			<key>CFBundleURLSchemes</key>
   			<array>
   				<string>tobiasexample</string>
   			</array>
   		</dict>
   	</array>

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 the following code in your AppDelegate:


- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
  return [TobiasPlugin handleOpenURL:url];
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options
{
  return [TobiasPlugin handleOpenURL:url];
}

If you have to override these two functions, make sure you have called the super:


- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    
  return [super application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options
{
    
  return [super application:application openURL:url options:options];
}

Buy me a cup of coffee。

Subscribe Us On WeChat #

subscribe

LICENSE #

Copyright 2018 OpenFlutter Project

Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements.  See the NOTICE file distributed with this work for
additional information regarding copyright ownership.  The ASF licenses this
file to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License.  You may obtain a copy of
the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
License for the specific language governing permissions and limitations under
the License.

1.2.0 #

  • 将一些方法重命名,未来这些方法将会被移除。
  • Kotlin: 1.3.50,gradle-wrapper: 5.4.1

1.1.0+2 #

  • 修复ios获取版本的bug。

1.1.0+1 #

  • 兼容swift

1.1.0 #

  • 升级sdk,同时ios源换成官方源

1.0.0+1 #

  • 按照pub意见进行修改

1.0.0 #

  • ios不必重写AppDelegate

0.1.6+2 #

  • 按照pub意见进行修改

0.1.6+1 #

  • 按照pub意见进行修改

0.1.6 #

  • 支付宝SDK升级到15.6.4
  • 升级Kotlin

0.1.5 #

  • 支持检查客户端是否安装了支付宝App。

0.1.4 #

  • Fix #18

0.1.3 #

  • Android支持沙箱了

0.1.2 #

  • 修复在ios上调用登录报错的问题

0.1.1 #

  • 修复ios上通过webview登录无回调的问题

0.1.0 #

  • 支持支付宝登录了。

0.0.8 #

  • kotlin升级至1.3.21
  • kotlinx-coroutines升级至1.1.1
  • AliPaySDK升级至15.6.0

0.0.7 #

  • android构建工具升级
  • AliPaySDK升级至15.5.9

0.0.6 #

  • android构建工具升级
  • AliPaySDK升级至15.5.7

0.0.5 #

  • build.gradle升级到了3.2.0
  • kotlin升级到了1.2.71

0.0.4 #

  • 修复iOS无回调问题

0.0.3 #

  • 删除AliPayModel

0.0.2 #

  • 修复iOS支付bug

0.0.1 #

  • first released.

example/README.md

tobias_example #

Demonstrates how to use the tobias plugin.

Getting Started #

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  tobias: ^1.2.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:tobias/tobias.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
85
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
92
Learn more about scoring.

We analyzed this package on Oct 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test