diff --git a/ReadMe.md b/ReadMe.md index 520180d..513a0d6 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -11,7 +11,7 @@ implementation 'com.github.bumptech.glide:glide:4.6.1' annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1' - implementation 'com.sdwfqin.quicklib:quicklib:1.1.8' + implementation 'com.sdwfqin.quicklib:quicklib:1.1.9' > 最低支持api16,编译版本27,gradle4.1 diff --git a/quicklib/build.gradle b/quicklib/build.gradle index 2cb443f..cd3e7c7 100644 --- a/quicklib/build.gradle +++ b/quicklib/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' apply plugin: 'com.jfrog.bintray' -version = "1.1.8" +version = "1.1.9" // gradlew install // gradlew bintrayUpload diff --git a/quicklib/src/main/java/com/sdwfqin/quicklib/module/alipay/AliPayTools.java b/quicklib/src/main/java/com/sdwfqin/quicklib/module/alipay/AliPayTools.java index 62cf56f..1605a6b 100644 --- a/quicklib/src/main/java/com/sdwfqin/quicklib/module/alipay/AliPayTools.java +++ b/quicklib/src/main/java/com/sdwfqin/quicklib/module/alipay/AliPayTools.java @@ -33,7 +33,6 @@ public void handleMessage(Message msg) { PayResult payResult = new PayResult((Map) msg.obj); //对于支付结果,请商户依赖服务端的异步通知结果。同步通知结果,仅作为支付结束的通知。 - String resultInfo = payResult.getResult();// 同步返回需要验证的信息 String resultStatus = payResult.getResultStatus(); // 判断resultStatus 为9000则代表支付成功 @@ -59,10 +58,10 @@ public void handleMessage(Message msg) { * @param isRsa2 * @param alipay_rsa_private * @param aliPayModel - * @param onRxHttp1 + * @param onRequestListener */ - public static void aliPay(final Activity activity, String appid, boolean isRsa2, String alipay_rsa_private, AliPayModel aliPayModel, OnRequestListener onRxHttp1) { - sOnRequestListener = onRxHttp1; + public static void aliPay(final Activity activity, String appid, boolean isRsa2, String alipay_rsa_private, AliPayModel aliPayModel, OnRequestListener onRequestListener) { + sOnRequestListener = onRequestListener; Map params = AliPayOrderInfoUtil.buildOrderParamMap(appid, isRsa2, aliPayModel.getOut_trade_no(), aliPayModel.getName(), aliPayModel.getMoney(), aliPayModel.getDetail()); String orderParam = AliPayOrderInfoUtil.buildOrderParam(params); @@ -86,4 +85,27 @@ public static void aliPay(final Activity activity, String appid, boolean isRsa2, payThread.start(); } + /** + * 支付 + * + * @param activity + * @param orderInfo + * @param onRequestListener + */ + public static void aliPay(final Activity activity, String orderInfo, OnRequestListener onRequestListener) { + sOnRequestListener = onRequestListener; + Runnable payRunnable = () -> { + PayTask alipay = new PayTask(activity); + Map result = alipay.payV2(orderInfo, true); + + Message msg = new Message(); + msg.what = SDK_PAY_FLAG; + msg.obj = result; + mHandler.sendMessage(msg); + }; + + Thread payThread = new Thread(payRunnable); + payThread.start(); + } + }