| | |
| | | LogHelper.userErrorInfo("提现:开始通过提现-" + extract.getId());
|
| | | AlipayFundTransUniTransferResponse response = null;
|
| | | try {
|
| | | response = AlipayUtil.transfer("widthdraw_" + extract.getId(), extract.getAccount(), extract.getName(), extract.getMoney(), "板栗快省提现到账", "来自板栗快省的提现");
|
| | | response = AlipayUtil.transferNoThrowException("widthdraw_" + extract.getId(), extract.getAccount(), extract.getName(), extract.getMoney(), "板栗快省提现到账", "来自板栗快省的提现");
|
| | | LogHelper.userErrorInfo("提现:支付宝通过提现成功-" + extract.getId());
|
| | | } catch (AlipayApiException e) {
|
| | | LogHelper.errorDetailInfo(e, "支付宝转账异常:" + extract.getId(), "");
|
| | | LogHelper.userErrorInfo("提现:支付宝提现异常:" + response + ",提现信息" + GsonUtil.toJson(extract));
|
| | | }catch(AlipayTransferException e){
|
| | | LogHelper.errorDetailInfo(e, "支付宝转账异常:" + extract.getId(), "");
|
| | | LogHelper.userErrorInfo("提现:支付宝提现异常:" + response + ",提现信息" + GsonUtil.toJson(extract));
|
| | | }
|
| | |
| | | import com.yeshi.fanli.util.jd.JDUtil;
|
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
|
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil;
|
| | | import com.yeshi.fanli.util.taobao.HaoDanKuApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | |
| | | throw new Exception("商品信息获取失败");
|
| | | String link = null;
|
| | | if (share) {
|
| | | TaoBaoGoodsBrief goods = TaoKeApiUtil.specialConvertCoupon(auctionId,
|
| | | new TaoKeAppInfo(TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET,
|
| | | TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT));
|
| | | if (goods == null)
|
| | | throw new Exception("商品转链失败");
|
| | |
|
| | | link = goods.getCouponLink();
|
| | | if (StringUtil.isNullOrEmpty(link)) {
|
| | | link = goods.getAuctionUrl();
|
| | | }
|
| | | //暂时调用好单库API
|
| | | link=HaoDanKuApiUtil.getInstance().convertLink(auctionId, TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT, null);
|
| | | // TaoBaoGoodsBrief goods = TaoKeApiUtil.specialConvertCoupon(auctionId,
|
| | | // new TaoKeAppInfo(TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET,
|
| | | // TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT));
|
| | | // if (goods == null)
|
| | | // throw new Exception("商品转链失败");
|
| | | //
|
| | | // link = goods.getCouponLink();
|
| | | // if (StringUtil.isNullOrEmpty(link)) {
|
| | | // link = goods.getAuctionUrl();
|
| | | // }
|
| | | if (StringUtil.isNullOrEmpty(link))
|
| | | throw new Exception("商品转链失败");
|
| | | link += "&relationId=" + relationId;
|
| | |
| | | import com.alipay.api.CertAlipayRequest;
|
| | | import com.alipay.api.DefaultAlipayClient;
|
| | | import com.alipay.api.request.AlipayFundTransUniTransferRequest;
|
| | | import com.alipay.api.request.AlipayTradeQueryRequest;
|
| | | import com.alipay.api.response.AlipayFundTransUniTransferResponse;
|
| | | import com.yeshi.fanli.exception.user.AlipayTransferException;
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public static AlipayFundTransUniTransferResponse transferNoThrowException(String outBizNo, String account, String name,
|
| | | BigDecimal money, String orderTitle, String mark) throws AlipayApiException{
|
| | | AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest();
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("out_biz_no", outBizNo);
|
| | | json.put("trans_amount", money.toString());
|
| | | json.put("product_code", "TRANS_ACCOUNT_NO_PWD");
|
| | | json.put("order_title", orderTitle);
|
| | | JSONObject payee_info = new JSONObject();
|
| | | payee_info.put("identity", account);
|
| | | payee_info.put("identity_type", "ALIPAY_LOGON_ID");
|
| | | payee_info.put("name", name);
|
| | | json.put("payee_info", payee_info);
|
| | | json.put("remark", mark);
|
| | | json.put("biz_scene", "DIRECT_TRANSFER");
|
| | |
|
| | | request.setBizContent(json.toString());
|
| | | AlipayFundTransUniTransferResponse response = null;
|
| | | response = alipayClient.certificateExecute(request);
|
| | | return response;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | System.out.println(result);
|
| | | }
|
| | |
|
| | | public void convertLink(Long auctionId, String pid, String activityId) {
|
| | | public String convertLink(Long auctionId, String pid, String activityId) {
|
| | | List<ParamsKeyValue> params = new ArrayList<HaoDanKuApiUtil.ParamsKeyValue>();
|
| | | params.add(new ParamsKeyValue("itemid", auctionId + ""));
|
| | | params.add(new ParamsKeyValue("pid", pid));
|
| | | if (activityId != null)
|
| | | params.add(new ParamsKeyValue("activityid", activityId));
|
| | | String result = basePostRequest("http://v2.api.haodanku.com/ratesurl", params);
|
| | | System.out.println(result);
|
| | | JSONObject resultData = JSONObject.fromObject(result);
|
| | | String link = "";
|
| | | if (resultData.optInt("code") == 1) {
|
| | | resultData = resultData.optJSONObject("data");
|
| | | link = resultData.optString("coupon_click_url");
|
| | | if (StringUtil.isNullOrEmpty(link)) {
|
| | | link = resultData.optString("item_url");
|
| | | }
|
| | | }
|
| | |
|
| | | return link;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | if (minId == null)
|
| | | minId = 1;
|
| | | List<ParamsKeyValue> params = new ArrayList<HaoDanKuApiUtil.ParamsKeyValue>();
|
| | | params.add(new ParamsKeyValue("nav", 3+ ""));
|
| | | params.add(new ParamsKeyValue("nav", 3 + ""));
|
| | | params.add(new ParamsKeyValue("back", pageSize + ""));
|
| | | params.add(new ParamsKeyValue("min_id", minId + ""));
|
| | | params.add(new ParamsKeyValue("sort", 0 + ""));
|