tobias 0.0.6

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 79

logo pub package

中文移步这里

What's Tobias

Tobias is a flutter plugin for AliPaySDK.

Getting Started

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

Libraries Used In Tobias

We'd better know what tobias used. For Android:

    implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.0'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.0'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.0'

Tobias uses alipaySdk-15.5.7-20181023110917.aar in Android. For iOS:

  s.dependency 'OpenAliPaySDK', '~> 15.5.7'

Usage

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
}

In order to handle the result of payment, you have to add the following code in your AppDelegate.m file:

#import <tobias/TobiasPlugin.h>

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{

    return  [TobiasPlugin handleOpenURL:url];
}

// NOTE: 9.0以后使用新API接口
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options{

    return  [TobiasPlugin handleOpenURL:url];
}

NOTE:Tobias use pay_V2.

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>tobias_example</string>
   			</array>
   		</dict>
   	</array>

You can also call tobias.version() which returns a map contains version and platform.

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.

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: ^0.0.6

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages 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';
  
Version Uploaded Documentation Archive
0.0.6 Nov 7, 2018 Go to the documentation of tobias 0.0.6 Download tobias 0.0.6 archive
0.0.5 Oct 10, 2018 Go to the documentation of tobias 0.0.5 Download tobias 0.0.5 archive
0.0.4 Sep 26, 2018 Go to the documentation of tobias 0.0.4 Download tobias 0.0.4 archive
0.0.3 Sep 8, 2018 Go to the documentation of tobias 0.0.3 Download tobias 0.0.3 archive
0.0.2 Sep 7, 2018 Go to the documentation of tobias 0.0.2 Download tobias 0.0.2 archive
0.0.1 Sep 5, 2018 Go to the documentation of tobias 0.0.1 Download tobias 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
63
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
79
Learn more about scoring.

We analyzed this package on Nov 14, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.6
  • Flutter: 0.11.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While there is nothing inherently wrong with versions of 0.0.*, it usually means that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.58.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8