/********在WXEntryActivity的onResp里面接收回调,示例全码*******/ @Override public void onResp(BaseResp r) { if (r.getType() == ConstantsAPI.COMMAND_OPEN_BUSINESS_VIEW) { WXOpenBusinessView.Resp launchMiniProgramResp = (WXOpenBusinessView.Resp) r; String text = String.format("nextMsg=%snerrStr=%snbusinessType=%s", resp.extMsg, resp.errStr, resp.businessType); Toast.makeText(this, text, Toast.LENGTH_lONG).show(); } }
无论是否开通返回结果都是:nextMsg={}nerrStr=nullnbusinessType=wxpayScoreEnable,无法区分是否开通成功
不是太明白你的具体问题,请详细描述
if (wxSdkVersion >= Build.OPEN_BUSINESS_VIEW_SDK_iNT) {
WXOpenBusinessView.Req req = new WXOpenBusinessView.Req();
req.businessType = "wxpayScoreEnable";
req.query = "mch_id=1230000109&service_id=88888888000011&
out_request_no=1234323JKHDFE1243252&
timestamp=1530097563&nonce_str=zyx53Nkey8o4bHpxTQvd8m7e92nG5mG2&
sign_type=HMAC-SHA256&sign=029B52F67573D7E3BE74904BF9AEA";
req.extInfo = "{\"miniProgramType\": 0}";
Boolean ret = api.sendReq(req);
} else {
/*需提示用户升级微信版本*/
}
/********在WXEntryActivity的onResp里面接收回调,示例全码*******/
@Override
public void onResp(BaseResp r) {
if (r.getType() == ConstantsAPI.COMMAND_OPEN_BUSINESS_VIEW) {
WXOpenBusinessView.Resp launchMiniProgramResp = (WXOpenBusinessView.Resp) r;
String text = String.format("nextMsg=%snerrStr=%snbusinessType=%s",
resp.extMsg, resp.errStr, resp.businessType);
Toast.makeText(this, text, Toast.LENGTH_lONG).show();
}
}
以上是文档中Android端开启支付分的方法,在用户跳转到微信进行开通服务返回后,在onResp的回调里无法获取支付分开通的结果