| | |
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | |
| | | import com.yeshi.fanli.dto.aitaoker.QrcodeLoginDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.CloudOrderMenuEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloud;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudGoods;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudGroup;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudService;
|
| | | import com.yeshi.fanli.service.manger.alipay.UserCloudAlipayManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.aitaoker.AitaokerApiUtil;
|
| | |
| | | import com.yeshi.fanli.util.suning.SuningUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.user.cloud.CloudOrderMenuVO;
|
| | | import com.yeshi.fanli.vo.user.cloud.UserCloudInfoVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | | |
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | | |
| | |
|
| | | /**
|
| | | * 查询开通记录
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | List<CloudOrderMenuVO> listMenu = new ArrayList<>();
|
| | | CloudOrderMenuEnum[] menus = CloudOrderMenuEnum.values();
|
| | | for (CloudOrderMenuEnum menuEnum: menus) {
|
| | | CloudOrderMenuVO menuVO = new CloudOrderMenuVO();
|
| | | menuVO.setMoney(BigDecimal.valueOf(menuEnum.getMoney()) );
|
| | | menuVO.setType(menuEnum.name());
|
| | | menuVO.setDesc(menuEnum.getDescShow());
|
| | | listMenu.add(menuVO);
|
| | | }
|
| | | |
| | | |
| | | UserCloudInfoVO cloudInfoVO = new UserCloudInfoVO();
|
| | | cloudInfoVO.setNickName(userInfo.getNickName());
|
| | | cloudInfoVO.setPortrait(userInfo.getPortrait());
|
| | | cloudInfoVO.setOpenState(0); // 未开通
|
| | |
|
| | | cloudInfoVO.setListMenu(listMenu);
|
| | | |
| | | |
| | | // 是否开通
|
| | | UserCloud userCloud = userCloudService.getLastByUid(uid);
|
| | | if (userCloud == null) {
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "pay")
|
| | | public void pay(String callback, AcceptData acceptData, Long uid, String type, HttpServletResponse response,
|
| | | PrintWriter out) {
|
| | | public void pay(String callback, AcceptData acceptData, Long uid, String type, PrintWriter out) {
|
| | | try {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | |
| | | // 创建支付信息
|
| | | String alipayForm = userCloudAlipayManager.getAlipayForm(uid, type);
|
| | |
|
| | | // 返回信息
|
| | | response.setContentType("text/html;charset=utf-8");
|
| | | PrintWriter print = response.getWriter();
|
| | | // 返回信息 - 缓存到session
|
| | | StringBuilder builder = new StringBuilder();
|
| | | builder.append("<html><head><title>alipay</title></head>");
|
| | | builder.append("<body>" + alipayForm + "</body></html>");
|
| | | JsonUtil.printMode(print, callback, builder.toString());
|
| | | print.close();
|
| | | |
| | | // 缓存到redis- 一分钟
|
| | | String key = RedisKeyEnum.cloudAlipayLink.getKey() + uid + "_" + type;
|
| | | key = StringUtil.Md5(key);
|
| | | redisManager.cacheCommonString(key , builder.toString() , 60*10);
|
| | | |
| | | System.out.println(builder.toString());
|
| | | |
| | | String link = "http://192.168.1.200:8008/fanli/client/v1/cloud/callback/payUrl?key=%s";
|
| | | JSONObject dataObject = new JSONObject();
|
| | | dataObject.put("link", String.format(link, key));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(dataObject));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "创建支付信息失败"));
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 支付完成
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "payEnd")
|
| | | public void payEnd(String callback, AcceptData acceptData, Long id, PrintWriter out) {
|
| | | if (id == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "参数信息缺失"));
|
| | | return;
|
| | | }
|
| | | try {
|
| | | userCloudAlipayManager.tradeQueryByOrderId(id);
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "检测失败"));
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 动态一键发单
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | public enum CloudOrderMenuEnum {
|
| | | robotMonth(20.00, 1, 1, "机器人月套餐");
|
| | |
|
| | | robotMonth(20.00, 1, 1, "机器人月套餐", "一个月"),
|
| | | robotMonth1(20.00, 1, 1, "机器人月套餐", "三个月"),
|
| | | robotMonth2(20.00, 1, 1, "机器人月套餐", "半年"),
|
| | | robotMonth3(20.00, 1, 1, "机器人月套餐", "一年");
|
| | | |
| | | private double money;
|
| | | private Integer type;
|
| | | private Integer month;
|
| | | private String desc;
|
| | | private String descShow;
|
| | |
|
| | | private CloudOrderMenuEnum(double money, Integer type, Integer month, String desc) {
|
| | | private CloudOrderMenuEnum(double money, Integer type, Integer month, String desc, String descShow) {
|
| | | this.money = money;
|
| | | this.type = type;
|
| | | this.month = month;
|
| | | this.desc = desc;
|
| | | this.descShow = descShow;
|
| | | }
|
| | |
|
| | | public double getMoney() {
|
| | |
| | | return desc;
|
| | | }
|
| | |
|
| | | public String getDescShow() {
|
| | | return descShow;
|
| | | }
|
| | |
|
| | | public static CloudOrderMenuEnum getMenuEnum(String type) {
|
| | | if (StringUtil.isNullOrEmpty(type))
|
| | |
| | | |
| | | <select id="getLasthourByUnpaid" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_user_cloud_order |
| | | WHERE crd_state = 0 AND crd_update_time > DATE_SUB(NOW(),INTERVAL 1 HOUR) |
| | | WHERE crd_state = 0 AND crd_update_time > DATE_SUB(NOW(),INTERVAL 2 HOUR) |
| | | </select> |
| | | |
| | | |
| | |
| | | }
|
| | | }
|
| | |
|
| | | RobotInfoDTO dto = null;
|
| | | if (renew) { // 续费
|
| | | dto = AitaokerApiUtil.robotRenewals(userCloud.getRobotId(), menuEnum.getMonth());
|
| | | } else {
|
| | | dto = AitaokerApiUtil.robotCreate(menuEnum.getMonth(), menuEnum.getType(), "wechatrobot", null);
|
| | | }
|
| | |
|
| | | if (dto == null) {
|
| | | LogHelper.cloudInfo("方法openCloud: [uid=" + uid + "][订单ID=" + orderId + "]机器人失败: 返回空值");
|
| | | throw new UserCloudException(1, "机器人获取失败");
|
| | | }
|
| | |
|
| | | String endTimeStr = dto.getEndTime();
|
| | | if (StringUtil.isNullOrEmpty(endTimeStr)) {
|
| | | LogHelper.cloudInfo("方法openCloud: [uid=" + uid + "][订单ID=" + orderId + "]机器人失败: 返回时间为空");
|
| | | throw new UserCloudException(1, "机器人返回时间为空");
|
| | | }
|
| | |
|
| | | long endTime = 0;
|
| | | try {
|
| | | endTime = Long.parseLong(endTimeStr);
|
| | | } catch (Exception e) {
|
| | | LogHelper.cloudInfo("方法openCloud: [uid=" + uid + "][订单ID=" + orderId + "]机器人失败: 返回时间格式不正确");
|
| | | throw new UserCloudException(1, "机器人返回时间格式不正确");
|
| | | }
|
| | |
|
| | | Integer robotId = dto.getId();
|
| | | if (robotId == null) {
|
| | | LogHelper.cloudInfo("方法openCloud: [uid=" + uid + "][订单ID=" + orderId + "]机器人失败: 机器人ID返回为空");
|
| | | throw new UserCloudException(1, "机器人ID返回为空");
|
| | | }
|
| | |
|
| | | Integer groupNum = dto.getGroupNum();
|
| | | if (groupNum == null) {
|
| | | LogHelper.cloudInfo("方法openCloud: [uid=" + uid + "][订单ID=" + orderId + "]机器人失败: groupNum返回为空");
|
| | | throw new UserCloudException(1, "groupNum返回为空");
|
| | | }
|
| | | // RobotInfoDTO dto = null;
|
| | | // if (renew) { // 续费
|
| | | // dto = AitaokerApiUtil.robotRenewals(userCloud.getRobotId(), menuEnum.getMonth());
|
| | | // } else { // 创建机器人
|
| | | // dto = AitaokerApiUtil.robotCreate(menuEnum.getMonth(), menuEnum.getType(), "wechatrobot", null);
|
| | | // }
|
| | | //
|
| | | // if (dto == null) {
|
| | | // LogHelper.cloudInfo("方法openCloud: [uid=" + uid + "][订单ID=" + orderId + "]机器人失败: 返回空值");
|
| | | // throw new UserCloudException(1, "机器人获取失败");
|
| | | // }
|
| | | //
|
| | | // String endTimeStr = dto.getEndTime();
|
| | | // if (StringUtil.isNullOrEmpty(endTimeStr)) {
|
| | | // LogHelper.cloudInfo("方法openCloud: [uid=" + uid + "][订单ID=" + orderId + "]机器人失败: 返回时间为空");
|
| | | // throw new UserCloudException(1, "机器人返回时间为空");
|
| | | // }
|
| | | //
|
| | | // long endTime = 0;
|
| | | // try {
|
| | | // endTime = Long.parseLong(endTimeStr);
|
| | | // } catch (Exception e) {
|
| | | // LogHelper.cloudInfo("方法openCloud: [uid=" + uid + "][订单ID=" + orderId + "]机器人失败: 返回时间格式不正确");
|
| | | // throw new UserCloudException(1, "机器人返回时间格式不正确");
|
| | | // }
|
| | | //
|
| | | // Integer robotId = dto.getId();
|
| | | // if (robotId == null) {
|
| | | // LogHelper.cloudInfo("方法openCloud: [uid=" + uid + "][订单ID=" + orderId + "]机器人失败: 机器人ID返回为空");
|
| | | // throw new UserCloudException(1, "机器人ID返回为空");
|
| | | // }
|
| | | //
|
| | | // Integer groupNum = dto.getGroupNum();
|
| | | // if (groupNum == null) {
|
| | | // LogHelper.cloudInfo("方法openCloud: [uid=" + uid + "][订单ID=" + orderId + "]机器人失败: groupNum返回为空");
|
| | | // throw new UserCloudException(1, "groupNum返回为空");
|
| | | // }
|
| | |
|
| | | UserCloud newCloud = new UserCloud();
|
| | | newCloud.setUid(uid);
|
| | | newCloud.setOrderId(orderId);
|
| | | newCloud.setGroupNum(groupNum);
|
| | | newCloud.setRobotId(robotId);
|
| | | // newCloud.setGroupNum(groupNum);
|
| | | // newCloud.setRobotId(robotId);
|
| | | newCloud.setRobotType(menuEnum.getType());
|
| | | if (renew) {
|
| | | newCloud.setStartTime(userCloud.getStartTime());
|
| | | } else {
|
| | | newCloud.setStartTime(new Date());
|
| | | }
|
| | | newCloud.setEndTime(new Date(endTime * 1000)); // Unix 转换 普通时间
|
| | | // if (renew) {
|
| | | // newCloud.setStartTime(userCloud.getStartTime());
|
| | | // } else {
|
| | | // newCloud.setStartTime(new Date());
|
| | | // }
|
| | | // newCloud.setEndTime(new Date(endTime * 1000)); // Unix 转换 普通时间
|
| | | newCloud.setCreateTime(new Date());
|
| | | userCloudMapper.insertSelective(newCloud);
|
| | |
|
| | |
| | | throw new UserCloudException(1, "套餐类型不匹配");
|
| | |
|
| | | // 订单信息
|
| | | UserCloudOrder cloudOrder = userCloudOrderService.getLastOrderByUnpaid(uid, type);
|
| | | if (cloudOrder == null)
|
| | | cloudOrder = userCloudOrderService.addCloudOrder(uid, type); |
| | | |
| | | UserCloudOrder cloudOrder = userCloudOrderService.addCloudOrder(uid, type); |
| | | if (cloudOrder == null || cloudOrder.getId() == null)
|
| | | throw new UserCloudException(1, "创建订单信息失败");
|
| | |
|
| | |
| | | map.put("subject", "云发单充值");
|
| | | // 销售产品码,商家和支付宝签约的产品码
|
| | | map.put("product_code", type);
|
| | | // 该笔订单允许的最晚付款时间,逾期将关闭交易 15分钟
|
| | | map.put("timeout_express", "15m");
|
| | | // 该笔订单允许的最晚付款时间,逾期将关闭交易 30分钟
|
| | | map.put("timeout_express", "90m");
|
| | | |
| | | |
| | | // map.put("goods_id", cloudOrder.getId() +"");
|
| | | // map.put("goods_name", "云发单");
|
| | | // map.put("quantity", 1 +"");
|
| | | // map.put("price", menuEnum.getMoney() + "");
|
| | | // |
| | |
|
| | | // 支付成功后返回哪个前端页面
|
| | | String returnUrl = "http://apph5.banliapp.com";
|
| | | String returnUrl = "http://192.168.1.114:8848/flqFront/AppInside/cloudPushOrder/cloudPushOrderManage.html";
|
| | | // 支付成功后回调地址
|
| | | String notifyUrl = "http://192.168.1.253:8080/fanli/api/v2/user/cloud/payEnd?id=" +cloudOrder.getId();
|
| | | String notifyUrl = "http://192.168.1.200:8008/fanli/client/v1/cloud/callback/payEnd?id=" +cloudOrder.getId();
|
| | | // 获取支付form
|
| | | return AlipayApi.tradeWapPayRequest(map, returnUrl, notifyUrl);
|
| | | }
|
| | |
| | | hongBaoFanLi("hongbao-fanli-", "红包返利"),
|
| | |
|
| | | deviceSex("device_sex-", "设备性别版本"),
|
| | | cloudAlipayLink("cloud_alipay_ink_", "云发单支付链接"),
|
| | |
|
| | | convertLinkDocTemp("convert-link-doc-temp-", "转链文本暂存"),
|
| | | convertLinkDocResultTemp("convert-link-doc-result-temp-", "转链文本结果暂存")
|
| | |
| | | request.setBizContent(URLEncoder.encode(JSON.toJSONString(map), "UTF-8"));
|
| | |
|
| | | // 支付宝查询
|
| | | AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", AlipayWapConfig.APP_ID,
|
| | | AlipayClient alipayClient = new DefaultAlipayClient(AlipayWapConfig.GATEWAY, AlipayWapConfig.APP_ID,
|
| | | AlipayWapConfig.APP_PRIVATE_KEY, AlipayWapConfig.PARAM_TYPE, AlipayWapConfig.CHARSET,
|
| | | AlipayWapConfig.ALIPAY_PUBLIC_KEY, AlipayWapConfig.SIGNTYPE);
|
| | |
|
| | |
| | |
|
| | | import com.alipay.api.AlipayClient;
|
| | | import com.alipay.api.DefaultAlipayClient;
|
| | | |
| | |
|
| | | public class AlipayWapConfig {
|
| | | // 商户appid
|
| | | //public static String APP_ID = "2021001164655513";
|
| | | |
| | | //沙箱环境
|
| | | public static String APP_ID = "2016102100734118";
|
| | | |
| | | /**
|
| | | * 你的私钥 私钥 pkcs8格式的
|
| | | */
|
| | | public static String APP_PRIVATE_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDtWSMDXc3O7HcWcWiDzbmYyZDAEkVK2arOoPGwPLlxDXXpfPv6s2P9qRmXub6rrpbrKtIRpdbjbAJAwyDfIDBHiQzwWBqAPMk+G+1mrhU/NQEWcu0IT410j0MVODpz3X2zlb4UN7bzmkCkmLS7+/1fhKRQTql+2RXpeDuBvSdYlitVxNoXscPwm+xE7zZ84qS2agOUJHA+HGvb5mpEzA3kNPdGMm6hx0CzcEbNeI9AmbFJyXf6vZuHaQRcAe68MZObECIt/RwJfg+YnKwuDJYW+9+iMEUPbfg9ZjQB8062uPC8mddSPcxslP8//svmTXu+bz1Pl4v2FftErO1w/m5tAgMBAAECggEAXpTawwiqbv8EJcljoMJmZ2BLcn7VZhJ/Yn/4UAaiz05R4o2PzEOYYQj1zeSS+s9EDMqvk6DGlTIBY9VeUAv/sUIICe7SALA4caunWvecN+fjWxLJKjqpX/2G+fnCMVHeOaY+bMgW+9RIVk8UFqVAPsQYxnfSS14uwS7MZ9L8zuukNcYXdfZk030usztQaVkZWAddukUjA0YmquTUArZ63uEcU+LlfOpmWZ7JSiX2H7lIn6Fwilo3N3/J3eqTgTlw5N4V2Dvr962xlIzlJ+d5OuH9tRCEHcNaru2GYa/+trVGzbXwsGuCrtLxeFPQOb5HVmh77IMJbESGMe6V3U/BgQKBgQD6ZYSkrYBIdGGewQkPIFcdHa+ElpT5fCuA1ZamCeeOMKM+08r3dRfhxHWY9RuZDEULzcmHU8X44zA6uxU0qVU6Q07KIGWFUf85G4qcbrL+VV1yHGL3t8vbwRljaAZ6hTeEI/2Vfl8UgsvfV4goc7avvxRM2uYjYb5I5mEakTQIVQKBgQDyqN3b0faP5SIWxkLjXYy4Am5LX97FwtTdNm1DUCi1San/wnBQPb4K3iWp4DZgcjWWxZN8AWWkbabV9oPdwaXxxHRZSPo9AkqPGt2A+iiHxl7xCotM95Mg+OgIe5e9bN5+QBtZ9Sg0xe6bMMDlbBhLvGMIZzcOKzPLtoKkDw/FuQKBgQD367YmuycOFjVl02ld0b6PNIpJdDLyxq/oMxKjOaFMVvn7RgZrd0N7JWLuXJnDsrNWmZ3VYOven0tsiznW12ZsdqI3XVZHZ8WVTKC0fKK7UdhhGJwg+5lb71hs5V2sx+QM8Pmun94SV+L2Mxu8Ob4DSuUVp5NAKxIV6gzxGh3ztQKBgH94e8ssucQPTt/92EdN7kz/YecQfpsOZPmrzKvuoOPSxY3IG23bcUiON+TMFmSFumbwdTBQH4/H1jtRmyXTwxOE6sW4U1PXL0mLiE5nmwDwERG4Q0L0TwKkHmfOXQCx/xL9JCEWar+GNnipnLsoFH88gB168u3rffMGdgwuqU9pAoGATKuOiyHqe8mE5xezVqD3R/yaUo/yjGfV6WedsUEI9Dh1T1MJaehdOyzuxe7h5IVwlsPwy29l0wJ80L0+oO9O9CL9OsxiwNO6QK7nyqI0JfSJc0VhettXxWexVq3eSj0CnFd5ksiDwmmBgCs2r2zEmhyKt/fNmI7yn6djuyVjWT4=";
|
| | | |
| | | /**
|
| | | * 编码
|
| | | */
|
| | | public static String CHARSET = "UTF-8";
|
| | | /**
|
| | | * 支付宝公钥
|
| | | */
|
| | | public static String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzPpFDjI0B1O7S3WDNsUPK1UerFzP+6VGUDVYWDnmU4UcEVYc9/McD8w7+3D2P16achvYF7Xk9gE1TbRTbWkMvIKtwj3MKU+zdevwOTwbvV46UQ3L1DdpFNFx89fYNMf81HTr9oQROIUwSIz2yP0i/CuMW/Tqnb5EWnaz5Ws4m1+ioKKq41oTx6kzF5SxFfvkcRq95KTXgcoNauemUncbjV+Rh2G3ZDBy7sLXKaoY8a5M0jtf1f53MPJJ9LEnJE5oCRj2AHsOMJ4ECjoRTGVJvn2mREoyW8SCDfaT7dPD4bagrspwB/kB2j6P0HnddspB7BfdkuKGSz5YviOhdW3TuwIDAQAB";
|
| | | |
| | | /**
|
| | | * 支付宝网关地址
|
| | | */
|
| | | //private static String GATEWAY = "https://openapi.alipay.com/gateway.do";//正式环境
|
| | | /**
|
| | | * 商户appid
|
| | | */
|
| | | // public static String APP_ID = "2021001164655513";
|
| | |
|
| | | // 请求网关地址
|
| | | public static String GATEWAY = "https://openapi.alipaydev.com/gateway.do";
|
| | | |
| | | |
| | | //private static String GATEWAY = "https://openapi.alipay.com/gateway.do";//沙箱环境
|
| | | /**
|
| | | * 成功付款回调
|
| | | */
|
| | | public static String PAY_NOTIFY = "http://apph5.banliapp.com";//验签
|
| | | /**
|
| | | * 支付成功回调
|
| | | */
|
| | | public static String REFUND_NOTIFY = "";//姑且没用到
|
| | | /**
|
| | | * 前台通知地址
|
| | | */
|
| | | public static String RETURN_URL = "http://apph5.banliapp.com";//支付成功后返回哪个前端页面
|
| | | /**
|
| | | * 参数类型
|
| | | */
|
| | | public static String PARAM_TYPE = "json";
|
| | | /**
|
| | | * 成功标识
|
| | | */
|
| | | public static final String SUCCESS_REQUEST = "TRADE_SUCCESS";
|
| | | /**
|
| | | * 交易关闭回调(当该笔订单全部退款完毕,则交易关闭)
|
| | | */
|
| | | public static final String TRADE_CLOSED = "TRADE_CLOSED";
|
| | | /**
|
| | | * 支付宝开发平台中的支付宝账号(企业)
|
| | | */
|
| | | // public static final String SELLER_ID = "2088231353656741";
|
| | | |
| | | public static final String SELLER_ID = "2088102180556545"; //沙箱环境
|
| | | |
| | | |
| | | |
| | | //签名算法类型(根据生成私钥的算法,RSA2或RSA)
|
| | | public static final String SIGNTYPE = "RSA2";
|
| | | |
| | | /**
|
| | | * 支付宝请求客户端入口
|
| | | */
|
| | | private volatile static AlipayClient alipayClient = null;
|
| | | |
| | | |
| | | /**
|
| | | * 不可实例化
|
| | | */
|
| | | private AlipayWapConfig(){};
|
| | | |
| | | /**
|
| | | * 双重锁单例
|
| | | * @return 支付宝请求客户端实例
|
| | | */
|
| | | public static AlipayClient getInstance(){
|
| | | if (alipayClient == null){
|
| | | synchronized (AlipayWapConfig.class){
|
| | | if (alipayClient == null){
|
| | | alipayClient = new DefaultAlipayClient(GATEWAY,APP_ID,APP_PRIVATE_KEY,PARAM_TYPE,CHARSET,ALIPAY_PUBLIC_KEY,SIGNTYPE);
|
| | | }
|
| | | }
|
| | | }
|
| | | return alipayClient;
|
| | | }
|
| | | public static String APP_ID = "2016102100734118"; // 沙箱环境
|
| | |
|
| | | /**
|
| | | * 你的私钥 私钥 pkcs8格式的
|
| | | */
|
| | | public static String APP_PRIVATE_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDtWSMDXc3O7HcWcWiDzbmYyZDAEkVK2arOoPGwPLlxDXXpfPv6s2P9qRmXub6rrpbrKtIRpdbjbAJAwyDfIDBHiQzwWBqAPMk+G+1mrhU/NQEWcu0IT410j0MVODpz3X2zlb4UN7bzmkCkmLS7+/1fhKRQTql+2RXpeDuBvSdYlitVxNoXscPwm+xE7zZ84qS2agOUJHA+HGvb5mpEzA3kNPdGMm6hx0CzcEbNeI9AmbFJyXf6vZuHaQRcAe68MZObECIt/RwJfg+YnKwuDJYW+9+iMEUPbfg9ZjQB8062uPC8mddSPcxslP8//svmTXu+bz1Pl4v2FftErO1w/m5tAgMBAAECggEAXpTawwiqbv8EJcljoMJmZ2BLcn7VZhJ/Yn/4UAaiz05R4o2PzEOYYQj1zeSS+s9EDMqvk6DGlTIBY9VeUAv/sUIICe7SALA4caunWvecN+fjWxLJKjqpX/2G+fnCMVHeOaY+bMgW+9RIVk8UFqVAPsQYxnfSS14uwS7MZ9L8zuukNcYXdfZk030usztQaVkZWAddukUjA0YmquTUArZ63uEcU+LlfOpmWZ7JSiX2H7lIn6Fwilo3N3/J3eqTgTlw5N4V2Dvr962xlIzlJ+d5OuH9tRCEHcNaru2GYa/+trVGzbXwsGuCrtLxeFPQOb5HVmh77IMJbESGMe6V3U/BgQKBgQD6ZYSkrYBIdGGewQkPIFcdHa+ElpT5fCuA1ZamCeeOMKM+08r3dRfhxHWY9RuZDEULzcmHU8X44zA6uxU0qVU6Q07KIGWFUf85G4qcbrL+VV1yHGL3t8vbwRljaAZ6hTeEI/2Vfl8UgsvfV4goc7avvxRM2uYjYb5I5mEakTQIVQKBgQDyqN3b0faP5SIWxkLjXYy4Am5LX97FwtTdNm1DUCi1San/wnBQPb4K3iWp4DZgcjWWxZN8AWWkbabV9oPdwaXxxHRZSPo9AkqPGt2A+iiHxl7xCotM95Mg+OgIe5e9bN5+QBtZ9Sg0xe6bMMDlbBhLvGMIZzcOKzPLtoKkDw/FuQKBgQD367YmuycOFjVl02ld0b6PNIpJdDLyxq/oMxKjOaFMVvn7RgZrd0N7JWLuXJnDsrNWmZ3VYOven0tsiznW12ZsdqI3XVZHZ8WVTKC0fKK7UdhhGJwg+5lb71hs5V2sx+QM8Pmun94SV+L2Mxu8Ob4DSuUVp5NAKxIV6gzxGh3ztQKBgH94e8ssucQPTt/92EdN7kz/YecQfpsOZPmrzKvuoOPSxY3IG23bcUiON+TMFmSFumbwdTBQH4/H1jtRmyXTwxOE6sW4U1PXL0mLiE5nmwDwERG4Q0L0TwKkHmfOXQCx/xL9JCEWar+GNnipnLsoFH88gB168u3rffMGdgwuqU9pAoGATKuOiyHqe8mE5xezVqD3R/yaUo/yjGfV6WedsUEI9Dh1T1MJaehdOyzuxe7h5IVwlsPwy29l0wJ80L0+oO9O9CL9OsxiwNO6QK7nyqI0JfSJc0VhettXxWexVq3eSj0CnFd5ksiDwmmBgCs2r2zEmhyKt/fNmI7yn6djuyVjWT4=";
|
| | |
|
| | | /**
|
| | | * 编码
|
| | | */
|
| | | public static String CHARSET = "UTF-8";
|
| | | /**
|
| | | * 支付宝公钥
|
| | | */
|
| | | public static String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzPpFDjI0B1O7S3WDNsUPK1UerFzP+6VGUDVYWDnmU4UcEVYc9/McD8w7+3D2P16achvYF7Xk9gE1TbRTbWkMvIKtwj3MKU+zdevwOTwbvV46UQ3L1DdpFNFx89fYNMf81HTr9oQROIUwSIz2yP0i/CuMW/Tqnb5EWnaz5Ws4m1+ioKKq41oTx6kzF5SxFfvkcRq95KTXgcoNauemUncbjV+Rh2G3ZDBy7sLXKaoY8a5M0jtf1f53MPJJ9LEnJE5oCRj2AHsOMJ4ECjoRTGVJvn2mREoyW8SCDfaT7dPD4bagrspwB/kB2j6P0HnddspB7BfdkuKGSz5YviOhdW3TuwIDAQAB";
|
| | |
|
| | | /**
|
| | | * 支付宝网关地址
|
| | | */
|
| | | // public static String GATEWAY = "https://openapi.alipay.com/gateway.do";// 正式环境
|
| | |
|
| | | public static String GATEWAY = "https://openapi.alipaydev.com/gateway.do"; // 沙箱环境
|
| | |
|
| | | /**
|
| | | * 成功付款回调
|
| | | */
|
| | | public static String PAY_NOTIFY = "http://apph5.banliapp.com";// 验签
|
| | | /**
|
| | | * 支付成功回调
|
| | | */
|
| | | public static String REFUND_NOTIFY = "";// 姑且没用到
|
| | | /**
|
| | | * 前台通知地址
|
| | | */
|
| | | public static String RETURN_URL = "http://apph5.banliapp.com";// 支付成功后返回哪个前端页面
|
| | | /**
|
| | | * 参数类型
|
| | | */
|
| | | public static String PARAM_TYPE = "json";
|
| | | /**
|
| | | * 成功标识
|
| | | */
|
| | | public static final String SUCCESS_REQUEST = "TRADE_SUCCESS";
|
| | | /**
|
| | | * 交易关闭回调(当该笔订单全部退款完毕,则交易关闭)
|
| | | */
|
| | | public static final String TRADE_CLOSED = "TRADE_CLOSED";
|
| | | /**
|
| | | * 支付宝开发平台中的支付宝账号(企业)
|
| | | */
|
| | | public static final String SELLER_ID = "2088231353656741";
|
| | | /**
|
| | | * 签名算法类型(根据生成私钥的算法,RSA2或RSA)
|
| | | */
|
| | | public static final String SIGNTYPE = "RSA2";
|
| | | /**
|
| | | * 支付宝请求客户端入口
|
| | | */
|
| | | private volatile static AlipayClient alipayClient = null;
|
| | |
|
| | | /**
|
| | | * 不可实例化
|
| | | */
|
| | | private AlipayWapConfig() {
|
| | | };
|
| | |
|
| | | /**
|
| | | * 双重锁单例
|
| | | * |
| | | * @return 支付宝请求客户端实例
|
| | | */
|
| | | public static AlipayClient getInstance() {
|
| | | if (alipayClient == null) {
|
| | | synchronized (AlipayWapConfig.class) {
|
| | | if (alipayClient == null) {
|
| | | alipayClient = new DefaultAlipayClient(GATEWAY, APP_ID, APP_PRIVATE_KEY, PARAM_TYPE, CHARSET,
|
| | | ALIPAY_PUBLIC_KEY, SIGNTYPE);
|
| | | }
|
| | | }
|
| | | }
|
| | | return alipayClient;
|
| | | }
|
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.vo.user.cloud;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | public class CloudOrderMenuVO {
|
| | | private String type;
|
| | | private String desc;
|
| | | private BigDecimal money;
|
| | |
|
| | | public String getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | public void setType(String type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | public String getDesc() {
|
| | | return desc;
|
| | | }
|
| | |
|
| | | public void setDesc(String desc) {
|
| | | this.desc = desc;
|
| | | }
|
| | |
|
| | | public BigDecimal getMoney() {
|
| | | return money;
|
| | | }
|
| | |
|
| | | public void setMoney(BigDecimal money) {
|
| | | this.money = money;
|
| | | }
|
| | |
|
| | | }
|