|
@ -1348,7 +1348,69 @@ public class PatientPrescriptionPayService extends BaseService {
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
public String getSignFamilyPayResult(String outChargeNo, String accessToken, String appId, String appSecret) throws Exception {
|
|
|
int flag = 0;
|
|
|
Boolean isSuccess = true;
|
|
|
String msgBody = "";
|
|
|
String response = "";
|
|
|
String error = "";
|
|
|
String result = null;
|
|
|
|
|
|
// *************************** 测通流程 ***************************************
|
|
|
OnepayDefaultClient onepayClient = new OnepayDefaultClient(config.getOnepayApi(), appId, appSecret, signType, encryptType);
|
|
|
|
|
|
try {
|
|
|
RequestParams requestParams = new RequestParams();
|
|
|
requestParams.setAppId(appId);
|
|
|
requestParams.setTimestamp(DateUtil.getCurrentDateTime());
|
|
|
requestParams.setSignType(signType);
|
|
|
requestParams.setEncryptType(encryptType);
|
|
|
requestParams.setTransType(config.getChargeQueryType());
|
|
|
|
|
|
//业务参数
|
|
|
JSONObject params = new JSONObject();
|
|
|
params.put("outChargeNo", outChargeNo); //接入应用结算业务流水号
|
|
|
params.put("wxToken", accessToken);
|
|
|
|
|
|
requestParams.setParam(params);
|
|
|
msgBody = JSON.toJSONString(requestParams);
|
|
|
|
|
|
// *************************** 测通流程 ***************************************
|
|
|
//执行支付 返回原生返回值
|
|
|
ResponseParams<JSONObject> res = onepayClient.execute(requestParams);
|
|
|
response = JSON.toJSONString(res);
|
|
|
|
|
|
if (OnepayDefaultClient.isSuccessful(res)) {
|
|
|
//业务处理*******************
|
|
|
// 只返回业务出参
|
|
|
flag = 1;
|
|
|
result = JSON.toJSONString(res.getParam());
|
|
|
|
|
|
logger.info("请求成功,返回参数: " + result);
|
|
|
} else {
|
|
|
isSuccess = false;
|
|
|
error = "请求失败,返回结果:" + res.getRespCode() + "," + res.getRespMsg();
|
|
|
}
|
|
|
} catch (Exception ex) {
|
|
|
isSuccess = false;
|
|
|
StringWriter sw = new StringWriter();
|
|
|
PrintWriter pw = new PrintWriter(sw);
|
|
|
ex.printStackTrace(pw);
|
|
|
error = sw.toString();
|
|
|
}
|
|
|
|
|
|
//type = 3易联众接口保存http日志
|
|
|
logger.info("api - " + config.getChargeQueryType());
|
|
|
logger.info("request - " + msgBody);
|
|
|
logger.info("responses - " + response);
|
|
|
logger.info("error - " + error);
|
|
|
|
|
|
if (!isSuccess) {
|
|
|
throw new Exception(error);
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
}
|
|
|
|