| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.huifu.bspay.sdk.opps.core.utils.RsaUtils; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.account.controller.AppOrderController; |
| | | import com.stylefeng.guns.modular.account.model.TEnterpriseWithdrawal; |
| | |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | import static org.bouncycastle.asn1.x500.style.RFC4519Style.uid; |
| | | |
| | | |
| | | /** |
| | | * 支付回调 |
| | |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private UserWithdrawalService userWithdrawalService; |
| | | @Autowired |
| | |
| | | |
| | | |
| | | /** |
| | | * 斗拱充值回调函数 |
| | | } |
| | | * @param request |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/DGCancelUserBalance") |
| | | public void DGCancelUserBalance(HttpServletRequest request, HttpServletResponse response) { |
| | | try { |
| | | System.out.println("DG额充值回调函数"); |
| | | String sign = request.getParameter("sign"); |
| | | String resp_data = request.getParameter("resp_data"); |
| | | System.out.println(sign); |
| | | System.out.println(resp_data); |
| | | resp_data = resp_data.replaceAll("& #40;", "(").replaceAll("& #41;", ")"); |
| | | |
| | | |
| | | boolean verify = RsaUtils.verify(resp_data, "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsWrruP9JBxrUd8uEX5Z8y7pg/UIr5RNHSgDnHqNI1hbi2MfTzB5vZ275wSFFaLDD9BesgDWqsUepPS/opROlDCg9y6WYH8mkN23NmHL9F8kT48OMmH722am+Hp0XVMMwXqA0oNt4f7oW6kDemjZW8/RT4vIE7cyxoxSsVRvjqSpx9wDgFLPWh3o0pHQaoxLyeUsGBATHFrxEDlosBvsuXjMcgjPKXALrcemzKOhBmBkLgyxNVmh61ZK+FNXd+/X4PeZlnWf54NRQAUKe1308E6IIaszo+CjneKuhj1m/X4f7AIvxAqlhuCV5E/DfKRmGopxaWqdtE960Y/H4SmBh2wIDAQAB", sign); |
| | | |
| | | if (verify) { |
| | | JSONObject jsonObject = JSONObject.parseObject(resp_data); |
| | | String order_id = jsonObject.get("out_trans_id").toString(); |
| | | String out_trade_no = jsonObject.get("req_seq_id").toString(); |
| | | String trans_stat = jsonObject.get("trans_stat").toString(); |
| | | if ("S".equals(trans_stat)) { |
| | | String[] split = out_trade_no.split("_"); |
| | | Integer uid = Integer.valueOf(split[0]); |
| | | Integer id = Integer.valueOf(split[1]); |
| | | String payAmt = jsonObject.get("pay_amt").toString(); |
| | | userInfoService.payCancelUserBalance(Integer.valueOf(uid), order_id, Integer.valueOf(id), 1); |
| | | appOrderController.createAllocationReqUser(1, Integer.valueOf(uid), 1, new BigDecimal(payAmt).divide(new BigDecimal(100)).doubleValue()); |
| | | // cloudPay(Integer.valueOf(uid),map.get("total_fee"),map.get("transaction_id"),1); |
| | | PrintWriter out = response.getWriter(); |
| | | out.write(200); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | |
| | | |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 微信余额充值回调函数 |
| | | * @param request |
| | | */ |