| | |
| | | import com.stylefeng.guns.modular.cloudPayment.example.DepositExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.DepositReq; |
| | | import com.stylefeng.guns.modular.enums.PaymentTypeEnum; |
| | | import com.stylefeng.guns.modular.huifu.biz.DouGongPayUtil; |
| | | import com.stylefeng.guns.modular.system.model.Company; |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.model.UserWithdrawal; |
| | |
| | | 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()); |
| | | // 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 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/DGCancelUserBalanceZfb") |
| | | public void DGCancelUserBalanceZfb(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), 2); |
| | | |
| | | // cloudPay(Integer.valueOf(uid),map.get("total_fee"),map.get("transaction_id"),1); |
| | | PrintWriter out = response.getWriter(); |
| | | out.write(200); |