/**
  * 微信支付 价格为0时 支付跳转页面<br>
  *
  * @author 侯杨 <br>
  *     2015年1月15日
  * @return string
  * @exception/throws [异常类型] [异常说明]
  * @see OrderManagerAction#topayForSuccess_order()
  * @since vmaque2.0
  */
 public String topayForSuccess_order() {
   request.setAttribute("redpackageId", request.getParameter("redPackageId"));
   request.setAttribute("cId", request.getParameter("cId"));
   request.setAttribute("sId", request.getParameter("sId"));
   request.setAttribute("ordercode", conSumerOrderData.getOrderCode());
   return "payForSuccess_order";
 }
  /**
   * 生成订单,跳转到支付宝支付页面<br>
   *
   * @author 冯鑫<br>
   *     2014-9-12
   * @throws IOException
   * @update 侯杨
   * @see OrderManagerAction#toPayOrder
   * @since vmaque1.5
   */
  public String toPayOrder() throws IOException {
    String price = request.getParameter("price");
    String paytype = request.getParameter("paytype"); // 支付方式
    // 商品总价赋值
    conSumerUserData.setPayType(Integer.parseInt(paytype));
    commodityConfigData.setConfigPrice(Double.parseDouble(price));
    conSumerOrderData =
        orderManagerFacade.createOrder(
            commodityConfigData, conSumerUserData, pageDomainName, goodsNum);
    GoodsInfoData goodsInfoData = new GoodsInfoData();
    goodsInfoData.setId(commodityConfigData.getGoodsInfoData().getId());
    goodsInfoData = goodsInfoFacade.getGoodsInfoData(goodsInfoData);
    String alipayForm;

    conSumerOrderData.setPrice(Double.parseDouble(price));
    if (price.equals("0")) {
      request.setAttribute("ordercode", conSumerOrderData.getOrderCode());
      if (conSumerUserData.getRedPackageId() != null
          && !"".equals(conSumerUserData.getRedPackageId())) {
        request.setAttribute("redpackageId", conSumerUserData.getRedPackageId());
        request.setAttribute("cId", conSumerUserData.getcId());
        request.setAttribute("sId", conSumerUserData.getsId());
      }
      return "payForSuccess_order";
    }
    // 如果为1 则是pc支付
    if ("1".equals(pcFlag)) {
      alipayForm = this.getAlipayForm(conSumerOrderData, goodsInfoData); // 支付的表单getAlipayForm_Phone
    } else {
      alipayForm = this.getAlipayForm_Phone(conSumerOrderData, goodsInfoData);
    }
    request.setAttribute("alipayForm", alipayForm);
    return "toPayJsp";
  }
 /**
  * 支付宝提交 微信接口<br>
  *
  * @author 侯杨<br>
  *     2014-9-21
  * @update
  * @param
  * @return
  * @exception/throws
  * @see OrderManagerAction#getAlipayForm
  * @since vmaque1.5
  */
 private String getAlipayForm_PhoneWeixin(
     ConSumerOrderData conSumerOrderData, GoodsInfoData goodsInfoData) {
   HashMap<String, String> hm = new HashMap<String, String>();
   hm.put("body", goodsInfoData.getGoodsDes()); // 填写在跳到支付宝页面上显示的付款内容信息  
   hm.put("subject", goodsInfoData.getGoodsName()); // 填写在跳到支付宝页面上显示的付款标题信息  
   hm.put("out_trade_no", conSumerOrderData.getOrderCode()); // 外部交易号,最好具有唯一性,在获取支付宝发来的付款信息时使用. 
   hm.put("agent", AlipayConfig.partner); // partnerId(合作伙伴ID)
   hm.put("payment_type", "1"); // 支付类型 1=商品购买,2=服务购买,... 
   hm.put("price", String.valueOf(conSumerOrderData.getPrice())); // 订单金额信息   
   hm.put("quantity", "1"); // 订单商品数量,一般都是写1,它是按照整个订单包来计算 
   return AlipayService.create_direct_token_by_userWeixin(hm); // securityCode(安全码)
 }
 /**
  * 创建支付宝提交Form PC端<br>
  *
  * @author 冯鑫<br>
  *     2014-9-12
  * @update
  * @param ConSumerOrderData conSumerOrderData
  * @return String
  * @see OrderManagerAction#getAlipayForm
  * @since vmaque1.5
  */
 private String getAlipayForm(ConSumerOrderData conSumerOrderData, GoodsInfoData goodsInfoData) {
   HashMap<String, String> hm = new HashMap<String, String>();
   if (goodsInfoData.getGoodsDes() != null && !"".equals(goodsInfoData.getGoodsDes())) {
     hm.put("body", goodsInfoData.getGoodsDes().trim()); // 填写在跳到支付宝页面上显示的付款内容信息
   }
   hm.put("subject", goodsInfoData.getGoodsName()); // 填写在跳到支付宝页面上显示的付款标题信息  
   hm.put("out_trade_no", conSumerOrderData.getOrderCode()); // 外部交易号,最好具有唯一性,在获取支付宝发来的付款信息时使用. 
   hm.put("agent", AlipayConfig.partner); // partnerId(合作伙伴ID)
   hm.put("payment_type", "1"); // 支付类型 1=商品购买,2=服务购买,... 
   hm.put("price", String.valueOf(conSumerOrderData.getPrice())); // 订单金额信息    
   /*hm.put("price","0.01");//订单金额信息  */
   hm.put("quantity", "1"); // 订单商品数量,一般都是写1,它是按照整个订单包来计算 
   hm.put(
       "extra_common_param",
       conSumerUserData.getRedPackageId()
           + "_"
           + conSumerUserData.getcId()
           + "_"
           + conSumerUserData.getsId()); // 红包使用自定义参数
   return AlipayService.create_direct_pay_by_user(hm); // securityCode(安全码)
 }