支付宝
implementation fileTree('..\\app\\lib\\alipaySdk-15.6.5-20190718211148.aar')
implementation fileTree(dir: 'libs', include: ['*.aar','*.jar'])
String orderInfo = orderinfoBean.getResult().getOrderInfo();
new Thread(() -> {
PayTask payTask = new PayTask(this);
Map<String, String> result = payTask.payV2(orderInfo, false);
Message msg = new Message();
msg.what = SDK_PAY_FLAG;
msg.obj =result;
handler.sendMessage(msg);
}).start();
private Handler handler = new Handler(){
@SuppressLint("HandlerLeak")
@Override
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
switch (msg.what){
case SDK_PAY_FLAG:
boolean isSucceed = false;
Map<String, String> result = (Map<String, String>) msg.obj;
String resultStatus = result.get("resultStatus");
if (resultStatus.equals("9000")){
}else {
if (resultStatus.equals("8000")) {
} else if (resultStatus.equals("6001")) {
} else {
}
}
break;
}
}
};