rxreader / alipay_kit Goto Github PK
View Code? Open in Web Editor NEWFlutter版支付宝登录/支付
License: MIT License
Flutter版支付宝登录/支付
License: MIT License
FAILURE: Build failed with an exception.
Where:
Build file '/Users/ra1no3o/flutter/.pub-cache/hosted/pub.dartlang.org/alipay_kit-2.2.0-nullsafety/android/build.gradle' line: 22
What went wrong:
A problem occurred evaluating root project 'alipay_kit'.
Project with path ':alipay_kit' could not be found in root project 'alipay_kit'.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 538ms
The plugin alipay_kit could not be built due to the issue above.
group 'io.github.v7lin.alipay_kit'
version '2.2.0'
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
}
}
rootProject.allprojects {
repositories {
google()
jcenter()
// 私仓
flatDir {
dirs project(':alipay_kit').file('libs')
}
}
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 16
// library 混淆 -> 随 library 引用,自动添加到 apk 打包混淆
consumerProguardFiles 'consumer-rules.pro'
}
lintOptions {
disable 'InvalidPackage'
}
flavorDimensions 'vendor'
productFlavors {
vendor {
dimension 'vendor'
// library 混淆 -> 随 library 引用,自动添加到 apk 打包混淆
consumerProguardFiles 'consumer-vendor-rules.pro'
}
}
}
dependencies {
implementation 'androidx.annotation:annotation:1.0.0'
// v15.8.01
vendorImplementation(name: 'alipaysdk-15.8.01.210112203525', ext: 'aar')
}
大佬,同时引用这个插件和友盟的,会发生utdid冲突的
would be great to have null safety enabled early
是否計劃支持global alipay,AlipayHK目前無法使用
hi.alipay_kit里面仿佛没有支持 OpenAuthTask 这个类型的桥接调用,有什么特殊的原因吗?
作者写的这个插件很棒,不过这样存在巨大安全隐患就是把私钥暴露在app内部,一般流程私钥严禁写在app内部
支付宝SDK坑爹统计
maybe it will be better of pic can view.
哥们 支付宝支付 就需要一个 orderString 你搞那么多参数干啥
Because encrypt 5.0.0-beta.1 depends on pointycastle ^3.0.0-nullsafety.0 and every version of alipay_kit depends on pointycastle ^1.0.0, encrypt 5.0.0-beta.1 is incompatible with alipay_kit.
Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :alipay_kit project caused this error: /Users/hhyy/.pub-cache/hosted/pub.flutter-io.cn/alipay_kit-1.1.0/android/libs/alipaySdk-15.7.6-20200521195109.aar
"app_id=2021001186622059&charset=utf-8&format=JSON&version=1.0&sign_type=RSA2×tamp=2020-08-28+17%3A58%3A41¬ify_url=http%3A%2F%2F47.242.6.15%2Fapi%2Fmobile%2Fpay%2FnotifData&return_url=http%3A%2F%2F47.242.6.15%2Fapi%2Fmobile%2Fpay%2FreturnData&method=alipay.trade.app.pay&biz_content=%7B%22product_code%22%3A%22QUICK_MSECURITY_PAY%22%2C%22out_trade_no%22%3A1598608721%2C%22total_amount%22%3A0.01%2C%22subject%22%3A%22%E4%B8%80%E6%AC%A1%E4%BB%B7%E6%A0%BC%22%7D&sign=XVu9wUETy9CJpj1hA8ua7yl8EK0s4oEU4xpiEC7g3n5B%2BFhdLgqDtA5%2BHkQShSIlHCvnclX%2BK507vFDVEEKap2k1Tt%2FXIcCxldLhbBO1yd532H%2BvqIdiWlHaTewGcsRGtWiHMo77bMiJOxqLRCtWpuJ0YyrStt5pIegaFQU7Vd4rWCrWIaQ9iHJ%2B2RTgskIO%2FLm0iu6uWeh3na0XCTjQt0vkImGOWxZXw55durYgDRamPzeVSaouKv20yJHgQ3u8ecwIPaKrTQoq"
这是后台给的数据,在安卓设备上运行正常,在苹果设备上会闪退
纯flutter项目,支付是OK的,但是flutter和原生混合开发,调用支付会报错,请问是哪里配置的问题吗?
Unhandled Exception: MissingPluginException(No implementation found for method pay on channel v7lin.github.io/alipay_kit)
Non-directory inputs must have .jar extension: /Users/***/flutter/.pub-cache/hosted/pub.flutter-io.cn/alipay_kit-1.1.0/android/libs/alipaySdk-15.7.6-20200521195109.aar
我看到你回复让看 pubspec.lock
我看了,请问我要在这里更改什么内容,才能调起iOS的支付宝支付,
请帮助下我,感激不尽。
alipay_kit:
dependency: "direct main"
description:
name: alipay_kit
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.0"
和普通支付一个流程
后端设置 return_url: ${your app scheme}://${custom host}/alipay/page_sign/return_url
Future<bool> _showAlipayPageSignAlert(BuildContext context, {required String url}) async {
final dynamic result = await showCupertinoDialog(
context: context,
builder: (BuildContext context) {
return WillPopScope(
child: CupertinoAlertDialog(
content: SizedBox(
height: 40,
child: Stack(
children: <Widget>[
Visibility(
visible: false,
maintainState: true,
maintainAnimation: true,
maintainSize: true,
maintainInteractivity: false,
child: AlipayPageSignSlientExec(url: url),
),
Center(
child: CupertinoActivityIndicator(radius: 12),
),
],
),
),
),
onWillPop: () => Future<bool>.value(false),
);
},
barrierDismissible: false,
);
return result is bool && result;
}
// 先签约后扣费
// https://opendocs.alipay.com/open/00a05b?pathHash=4f048b01#%E6%97%A0%E7%BA%BF%E7%AB%AF%E5%94%A4%E8%B5%B7%E7%AD%BE%E7%BA%A6%E8%AF%B4%E6%98%8E
// url 后端处理
// [encodeURIComponent](https://blog.csdn.net/KokJuis/article/details/84140514)
// final String signParams = url.replace("https://openapi.alipay.com/gateway.do?","");
// url = "alipays://platformapi/startapp?appId=60000157&appClearTop=false&startMultApp=YES&sign_params="+ encodeURIComponent(signParams)
// url 客户端处理
// final String signParams = url.replaceAll('https://openapi.alipay.com/gateway.do?', '');
// url = 'alipays://platformapi/startapp?appId=60000157&appClearTop=false&startMultApp=YES&sign_params=${Uri.encodeQueryComponent(signParams)}';
class AlipayPageSignSlientExec extends StatefulWidget {
const AlipayPageSignSlientExec({
super.key,
required this.url,
});
final String url;
@override
State<StatefulWidget> createState() {
return _AlipayPageSignSlientExecState();
}
}
class _AlipayPageSignSlientExecState extends State<AlipayPageSignSlientExec> with WidgetsBindingObserver {
Route<dynamic>? _route;
late final StreamSubscription<String> _linkClickSubs;
@override
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
_linkClickSubs = LinkKitPlatform.instance.linkClickStream().listen((String event) {
_evalDeepLink(context, event);
});
launchUrlString(widget.url, mode: LaunchMode.externalApplication);
}
// ${your app scheme}://${custom host}/alipay/page_sign/return_url?msg=Success&charset=utf-8&code=10000&method=alipay.user.agreement.page.sign.return
Future<void> _evalDeepLink(BuildContext context, String url) async {
final Uri uri = Uri.parse(url);
if (uri.path == '/alipay/page_sign/return_url') {
if (kDebugMode) {
print('Alipay Page Sign: $url');
}
if (uri.queryParameters['code'] == '10000') {
if (_route?.isActive ?? false) {
Navigator.of(context).pop(true);
}
} else {
if (_route?.isActive ?? false) {
Navigator.of(context).pop(false);
}
}
}
}
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.resumed) {
_clearSubscription();
}
}
Future<void> _clearSubscription() async {
await Future<void>.delayed(const Duration(seconds: 1));// 取消事件不走 deep link 回调,只能在 resumed 里取消(这会与 deep link 回调冲突,故作延迟)
if (_route?.isActive ?? false) {
// ignore: use_build_context_synchronously
Navigator.of(context).pop(false);
}
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
_route ??= ModalRoute.of(context);
}
@override
void dispose() {
_linkClickSubs.cancel();
WidgetsBinding.instance.removeObserver(this);
super.dispose();
}
@override
Widget build(BuildContext context) {
return SizedBox();
}
}
你好,我没有找到沙盒的相关配置,我不知道它是否支持沙盒环境
调用支付宝失败,我用支付宝签名工具生成2048的RSA2私钥在编辑器里看了下长度是1624,你断言里要大于等于2048,到底是阿里签名错误还是你这里不应该校验长度大于2048?
Unhandled Exception: MissingPluginException(No implementation found for method isInstalled on channel v7lin.github.io/alipay_kit)
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method isInstalled on channel v7lin.github.io/alipay_kit)
#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:313:7)
#1 MethodChannelAlipayKit.isInstalled (package:alipay_kit/src/alipay_kit_method_channel.dart:46:12)
#2 _HomeState.build. (package:alipay_kit_example/main.dart:85:30)
Launching lib/main.dart on VOG AL00 in debug mode...
/Users/zhoufan/flutter/.pub-cache/hosted/pub.flutter-io.cn/alipay_kit-2.0.0/android/src/vendor/AndroidManifest.xml:6:9-63 Error:
Missing 'package' key attribute on element package at AndroidManifest.xml:6:9-63
/Users/zhoufan/flutter/.pub-cache/hosted/pub.flutter-io.cn/alipay_kit-2.0.0/android/src/vendor/AndroidManifest.xml Error:
Validation failed, exiting
FAILURE: Build failed with an exception.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Manifest merger failed with multiple errors, see logs
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 2s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 2,738ms
Exception: Gradle task assembleDebug failed with exit code 1
type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'Map<String, String>' in type cast
When the exception was thrown, this was the stack:
#0 Alipay.payOrderJson (package:alipay_kit/src/alipay.dart:77:41)
如题,IOS 的回调不能实现,android能正常回调,能正常唤起支付宝成功支付但没有回调……
Hi,v7lin:
我需要用到支付宝的身份验证,目前貌似没有办法通过fake_alipay使用,也搜不到:MethodChannel 传入的 v7lin.github.io/fake_alipay ,不知道自己该怎么搞(我是一个前端),所以提了此issue。
谢谢!
API中貌似没有看到沙箱环境的接口,请问一下,可以APP支付可以设置沙箱环境吗?
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
Affected Modules: alipay_kit
iOS到底选择哪一个版本呢???
Android Studio 4.2.1
classpath 'com.android.tools.build:gradle:4.2.1'
distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-bin.zip
Flutter SDK 2.2.1
使用命令打包:flutter build apk
FAILURE: Build failed with an exception.
Where:
Build file '*****/alipay_kit-2.2.0-nullsafety/android/build.gradle' line: 22
What went wrong:
A problem occurred evaluating root project 'alipay_kit'.
Project with path ':alipay_kit' could not be found in root project 'alipay_kit'.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 4s
The plugin alipay_kit could not be built due to the issue above.
rootProject.allprojects {
repositories {
google()
jcenter()
// 私仓
flatDir {
dirs project(':alipay_kit').file('libs') // 错误位置
}
}
}
使用usb连接手机测试,跳转支付宝时,提示丢失连接设备:lost device,导致无法获取支付结果回调。请问在支付之前是否需要做某些操作之类的?
我测试demo成功后没有返回用户信息,是不是只是支付的?新手,着实有点看不太懂好不容易找到你的插件.
以下是代码支付总是提示商家参数错误。。。
ListTile(
title: Text('支付'),
onTap: () {
Map<String, dynamic> bizContent = <String, dynamic>{
'timeout_express': '30m',
'total_amount': '0.01',
'product_code': 'QUICK_MSECURITY_PAY',
'body': '测试Body',
'subject': '1',
'out_trade_no': '2020072321300023155',
};
Map<String, dynamic> orderInfo = <String, dynamic>{
'app_id': _ALIPAY_APPID,
'method': 'alipay.trade.app.pay',
'charset': 'utf-8',
'timestamp': DateUtils.getNow(),
'version': '1.0',
'biz_content': json.encode(bizContent),
};
_alipay.payOrderJson(
orderInfo: json.encode(orderInfo),
signType: Alipay.SIGNTYPE_RSA2,
privateKey: _ALIPAY_PRIVATEKEY,
);
},
),
Duplicate class com.ta.utdid2.a.a.a found in modules jetified-alipaysdk-15.8.01.210112203525-runtime (:alipaysdk-15.8.01.210112203525:) and jetified-utdid-1.5.2.1 (com.umeng.umsdk:utdid:1.5.2.1)
这个是闪退的日志:DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
iOS端调用支付宝返回应用后不走回调
首先感谢开源。我看了你的demo,在payOrderMap和auth函数中,privateKey都是标注为@required,我个人感觉前端(客户端)保存这个值感觉有点不安全,被反编译了怎么办?privateKey无非是用来算sign,这个sign完全可以通过后台计算,而且必须由后台算,否则,比如前端拿到privateKey自己修改price,再自己调用支付宝api,那风险太大
大神支付宝增加了AES密钥,能加上吗?
https://opendocs.alipay.com/common/02mse3
AS控制台错误信息如下
Resolving dependencies of Podfile
[!] CocoaPods could not find compatible versions for pod "AlipaySDK-iOS":
In Podfile:
fake_alipay (from .symlinks/plugins/fake_alipay/ios
) was resolved to 0.0.1, which depends on
AlipaySDK-iOS (~> 15.5.5)
None of your spec sources contain a spec satisfying the dependency: `AlipaySDK-iOS (~> 15.5.5)`.
是否可以提供一个只传入orderinfo的函数
注: //flutter/.pub-cache/hosted/pub.flutter-io.cn/fake_alipay-0.2.3/android/src/main/java/io/github/v7lin/fakealipay/FakeAlipayPlugin.java使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用了未经检查或不安全的操作。
注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
作者您好:
目前使用您的SDK发现一个问题,您的SDK在调用支付时,验证了商户私钥的长度不能低于2048位,但是目前使用支付宝官方的密钥生成工具生成出来的密钥只有1000多位,即便在生成时选择了密钥长度为2048位。
请问这个问题怎么解决呢?
[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: Unsupported operation: PEMKey(MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCB0M........
#0 RsaKeyParser.parsePrivate (package:alipay_kit/src/crypto/rsa.dart:29:5)
#1 RsaSigner.sha256Rsa (package:alipay_kit/src/crypto/rsa.dart:96:24)
#2 Alipay._sign (package:alipay_kit/src/alipay.dart:191:31)
#3 Alipay.auth (package:alipay_kit/src/alipay.dart:150:25)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.