패키지, 저장소 및 앱 카테고리 검색

패키지 상세v6.0.0

tobias

사용자가 네이티브 Android/iOS/OpenHarmony 알리페이 SDK를 사용하여 인증 또는 결제할 수 있도록 허용하는 플러터 플러그인입니다.

AndroidiOS
30일 다운로드
2.7만
좋아요
106
Pub 점수
130

패키지 설치

flutter pub add tobias

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Tobias는 네이티브 Android, iOS 및 OpenHarmony AliPay SDK를 사용하여 원활한 인증 및 결제 통합을 가능하게 하는 Flutter 플러그인입니다. 개발자들이 Flutter 애플리케이션 내에서 AliPay의 안전하고 널리 채택된 결제 인프라를 활용할 수 있도록 합니다. 이 플러그인은 Flutter와 플랫폼별 AliPay 기능 사이에 브리지 역할을 하여 지원되는 장치에서 부드러운 사용자 경험을 보장합니다. 최소한의 설정으로 앱 내 결제 및 AliPay를 통한 사용자 인증을 모두 지원하며, 전자상거래 및 금융 중심 앱에 이상적입니다.

사용 사례

  • 앱 내 구매에 알리페이 사용
  • 알리페이를 통한 사용자 인증
  • 크로스 플랫폼 결제 솔루션
  • 중국 시장을 겨냥한 전자상거래 앱
  • 모바일 지갑 통합

주요 기능

  • 네이티브 알리페이 SDK 통합
  • Android, iOS 및 OpenHarmony 지원
  • 안전한 결제 및 인증 흐름
  • 필수 구성 최소화
  • 플랫폼별 최적화

적합한 대상

  • 결제 기능을 갖춘 앱을 개발하는 플러터 개발자
  • 중국 또는 알리페이를 사용하는 지역의 사용자를 대상으로 하는 앱
  • 원본 알리페이 기능이 필요한 개발자
  • 크로스 플랫폼 결제 지원이 필요한 프로젝트
  • 빠르게 알리페이를 통합하는 스타트업

고려 사항

  • 알리페이 계정 및 상인 설정이 필요합니다
  • 알리페이 지원 지역에 한정
  • 네이티브 SDK 버전에 따라 다름
  • 추가적인 준수 검사가 필요할 수 있습니다
  • OpenHarmony 지원은 실험적입니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

logo

pub package Build status GitHub stars GitHub forks GitHub license GitHub issues OpenFlutter

中文移步这里

Join QQ Group now: 1003811176

QQGroup

What's Tobias

Tobias is a flutter plugin for AliPaySDK, works on iOS, Android and OpenHarmony

Getting Started

I highly recommend that you read the official documents before using tobias.

  1. For iOS, you have to configure your Xcode project manually. See iOS Configuration.

  2. for OpenHarmony, you have to add scheme alipays to module.json5 in your project like this:

{
  "module": {
    "querySchemes": [
      "alipays"
    ],
  }
}

iOS Configuration

Breaking change in 6.0.0: tobias no longer modifies your Xcode project during pod install. The tobias: section in pubspec.yaml (url_scheme, no_utdid, ios.ignore_security, ios.universal_link) is obsolete and is ignored. Configure the following by hand.

Swift Package Manager

tobias supports both Swift Package Manager and CocoaPods. To use SPM, enable it once:

flutter config --enable-swift-package-manager

Nothing else is required — Flutter picks up ios/tobias/Package.swift automatically. If SPM is not enabled, the CocoaPods podspec is used as before.

1. Info.plist

Add your own url scheme (a unique string used to resume your app, _ is not allowed):

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

Allow your app to query the Alipay app:

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>alipays</string>
</array>

Alipay still serves some content over HTTP, so unless you know what you are doing, add:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
    <key>NSAllowsArbitraryLoadsInWebContent</key>
    <true/>
</dict>
2. Runner.entitlements

Universal link is required by Alipay. Enable the Associated Domains capability and add the host of your universal link:

<key>com.apple.developer.associated-domains</key>
<array>
    <string>applinks:your.domain.com</string>
</array>

See example/ios/Runner for a working setup.

Payment

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

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.

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.

NOTE: the no_utdid variant of the iOS SDK has been removed in 6.0.0. If you depend on it, stay on 5.x for now.

Auth

import 'package:tobias/tobias.dart' ;
Tobias tobias = Tobias();
tobias.auth("your auth str);

Check AliPay Installation

Tobias tobias = Tobias();
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 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];
}
Donate

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 개

  • plugin_platform_interface^2.0.2

소스 저장소

이 패키지를 사용하는 프로젝트

순위