Skip to content

Commit

Permalink
fix alipay
Browse files Browse the repository at this point in the history
  • Loading branch information
sdwfqin committed Mar 5, 2018
1 parent d4bb277 commit b32c323
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion quicklib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public void handleMessage(Message msg) {
PayResult payResult = new PayResult((Map<String, String>) msg.obj);

//对于支付结果,请商户依赖服务端的异步通知结果。同步通知结果,仅作为支付结束的通知。

String resultInfo = payResult.getResult();// 同步返回需要验证的信息
String resultStatus = payResult.getResultStatus();
// 判断resultStatus 为9000则代表支付成功
Expand All @@ -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<String, String> params = AliPayOrderInfoUtil.buildOrderParamMap(appid, isRsa2, aliPayModel.getOut_trade_no(), aliPayModel.getName(), aliPayModel.getMoney(), aliPayModel.getDetail());
String orderParam = AliPayOrderInfoUtil.buildOrderParam(params);

Expand All @@ -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<String, String> 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();
}

}

0 comments on commit b32c323

Please sign in to comment.