|
|
@@ -1135,6 +1135,45 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public String v3TransferNotifyWithCompanyId(Long companyId, String notifyData, HttpServletRequest request) {
|
|
|
+ logger.info("分公司回调V3::companyId:{}",companyId);
|
|
|
+ logger.info("zyp \n【收到转账回调V3::分公司】:{}",notifyData);
|
|
|
+ try {
|
|
|
+// String json = configService.selectConfigByKey("redPacket.config");
|
|
|
+ String json = companyConfigMapper.selectRedPacketConfigByKey(companyId);
|
|
|
+ RedPacketConfig config = JSONUtil.toBean(json, RedPacketConfig.class);
|
|
|
+
|
|
|
+ //创建微信订单
|
|
|
+ WxPayConfig payConfig = new WxPayConfig();
|
|
|
+ BeanUtils.copyProperties(config,payConfig);
|
|
|
+ WxPayService wxPayService = new WxPayServiceImpl();
|
|
|
+ wxPayService.setConfig(payConfig);
|
|
|
+ SignatureHeader signatureHeader = new SignatureHeader();
|
|
|
+ signatureHeader.setTimeStamp(request.getHeader("Wechatpay-Timestamp"));
|
|
|
+ signatureHeader.setNonce(request.getHeader("Wechatpay-Nonce"));
|
|
|
+ signatureHeader.setSerial(request.getHeader("Wechatpay-Serial"));
|
|
|
+ signatureHeader.setSignature(request.getHeader("Wechatpay-Signature"));
|
|
|
+ TransferBillsNotifyResult result = wxPayService.parseTransferBillsNotifyV3Result(notifyData,signatureHeader);
|
|
|
+ logger.info("到零钱回调1:{}",result.getResult());
|
|
|
+ if (result.getResult().getState().equals("SUCCESS")) {
|
|
|
+ R r = redPacketLogService.syncRedPacket(result.getResult().getOutBillNo(),result.getResult().getTransferBillNo());
|
|
|
+ logger.info("result:{}",r);
|
|
|
+ if (r.get("code").equals(200)){
|
|
|
+ return WxPayNotifyResponse.success("处理成功");
|
|
|
+ }else {
|
|
|
+ return WxPayNotifyResponse.fail("");
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ return WxPayNotifyResponse.fail("");
|
|
|
+ }
|
|
|
+ } catch (WxPayException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ logger.error("zyp \n【转账回调异常】:{}", e.getReturnMsg());
|
|
|
+ return WxPayNotifyResponse.fail(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public R sendRedPacketTest(WxSendRedPacketParam param) {
|