cbs8接口
This commit is contained in:
parent
351ed98ab4
commit
2f6f7e1755
|
@ -4,10 +4,7 @@ import cn.hutool.core.convert.Convert;
|
|||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.cbs8.dto.req.ElecRequestDTO;
|
||||
import com.hzya.frame.cbs8.dto.req.PayRequestDTO;
|
||||
import com.hzya.frame.cbs8.dto.req.PayResultRequestDTO;
|
||||
import com.hzya.frame.cbs8.dto.req.TransactionDetailReqDTO;
|
||||
import com.hzya.frame.cbs8.dto.req.*;
|
||||
import com.hzya.frame.cbs8.service.ICbs8ExtService;
|
||||
import com.hzya.frame.cbs8.util.CBSUtil;
|
||||
import com.hzya.frame.cbs8.util.CbsAccessToken;
|
||||
|
@ -85,6 +82,30 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
|
|||
return entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 代发代扣 支付申请
|
||||
*
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public SysExtensionApiEntity agentPayApply(SysExtensionApiEntity entity) {
|
||||
String boyds = entity.getBodys();
|
||||
if (StrUtil.isNotEmpty(boyds)){
|
||||
AgentPayRequestDTO agentPayRequest = JSONObject.parseObject(boyds,AgentPayRequestDTO.class);
|
||||
String requestData = JSONObject.toJSONString(agentPayRequest);
|
||||
//签名
|
||||
long timestamp = System.currentTimeMillis();
|
||||
String sign = CBSUtil.sign(requestData,timestamp);
|
||||
//加密
|
||||
byte[] encryptedData = CBSUtil.encrypt(requestData);
|
||||
Map<String,String> header = getHeaders(sign,timestamp);
|
||||
entity.setBodys(Base64.getEncoder().encodeToString(encryptedData));
|
||||
entity.setHeaders(header);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 交易结果查询
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue