Example usage for org.apache.commons.lang StringUtils abbreviate

List of usage examples for org.apache.commons.lang StringUtils abbreviate

Introduction

In this page you can find the example usage for org.apache.commons.lang StringUtils abbreviate.

Prototype

public static String abbreviate(String str, int maxWidth) 

Source Link

Document

Abbreviates a String using ellipses.

Usage

From source file:net.groupbuy.plugin.alipayPartner.AlipayPartnerPlugin.java

@Override
public Map<String, Object> getParameterMap(String sn, String description, HttpServletRequest request) {
    Setting setting = SettingUtils.get();
    PluginConfig pluginConfig = getPluginConfig();
    Payment payment = getPayment(sn);//  w  w w  .j  a va 2  s  . co m
    Map<String, Object> parameterMap = new HashMap<String, Object>();
    parameterMap.put("service", "create_partner_trade_by_buyer");
    parameterMap.put("partner", pluginConfig.getAttribute("partner"));
    parameterMap.put("_input_charset", "utf-8");
    parameterMap.put("sign_type", "MD5");
    parameterMap.put("return_url", getNotifyUrl(sn, NotifyMethod.sync));
    parameterMap.put("notify_url", getNotifyUrl(sn, NotifyMethod.async));
    parameterMap.put("out_trade_no", sn);
    parameterMap.put("subject",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 60));
    parameterMap.put("body",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 600));
    parameterMap.put("payment_type", "1");
    parameterMap.put("logistics_type", "EXPRESS");
    parameterMap.put("logistics_fee", "0");
    parameterMap.put("logistics_payment", "SELLER_PAY");
    parameterMap.put("price", payment.getAmount().setScale(2).toString());
    parameterMap.put("quantity", "1");
    parameterMap.put("seller_id", pluginConfig.getAttribute("partner"));
    parameterMap.put("total_fee", payment.getAmount().setScale(2).toString());
    parameterMap.put("show_url", setting.getSiteUrl());
    parameterMap.put("paymethod", "directPay");
    parameterMap.put("exter_invoke_ip", request.getLocalAddr());
    parameterMap.put("extra_common_param", "groupbuy");
    parameterMap.put("sign", generateSign(parameterMap));
    return parameterMap;
}

From source file:net.shopxx.plugin.alipayDualPayment.AlipayDualPaymentPlugin.java

@Override
public Map<String, Object> getParameterMap(String sn, String description, HttpServletRequest request) {
    Setting setting = SystemUtils.getSetting();
    PluginConfig pluginConfig = getPluginConfig();
    PaymentLog paymentLog = getPaymentLog(sn);
    Map<String, Object> parameterMap = new HashMap<String, Object>();
    parameterMap.put("service", "trade_create_by_buyer");
    parameterMap.put("partner", pluginConfig.getAttribute("partner"));
    parameterMap.put("_input_charset", "utf-8");
    parameterMap.put("sign_type", "MD5");
    parameterMap.put("return_url", getNotifyUrl(PaymentPlugin.NotifyMethod.sync));
    parameterMap.put("notify_url", getNotifyUrl(PaymentPlugin.NotifyMethod.async));
    parameterMap.put("out_trade_no", sn);
    parameterMap.put("subject",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 60));
    parameterMap.put("body",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 600));
    parameterMap.put("payment_type", "1");
    parameterMap.put("logistics_type", "EXPRESS");
    parameterMap.put("logistics_fee", "0");
    parameterMap.put("logistics_payment", "SELLER_PAY");
    parameterMap.put("price", paymentLog.getAmount().setScale(2).toString());
    parameterMap.put("quantity", "1");
    parameterMap.put("seller_id", pluginConfig.getAttribute("partner"));
    parameterMap.put("total_fee", paymentLog.getAmount().setScale(2).toString());
    parameterMap.put("show_url", setting.getSiteUrl());
    parameterMap.put("paymethod", "directPay");
    parameterMap.put("extend_param", "isv^1860648a1");
    parameterMap.put("exter_invoke_ip", request.getLocalAddr());
    parameterMap.put("extra_common_param", "shopxx");
    parameterMap.put("sign", generateSign(parameterMap));
    return parameterMap;
}

From source file:com.dp2345.plugin.alipayPartner.AlipayPartnerPlugin.java

@Override
public Map<String, Object> getParameterMap(String sn, String description, HttpServletRequest request) {
    Setting setting = SettingUtils.get();
    PluginConfig pluginConfig = getPluginConfig();
    Payment payment = getPayment(sn);/*  w  w w  .j  a v  a2s  . com*/
    Map<String, Object> parameterMap = new HashMap<String, Object>();
    parameterMap.put("service", "create_partner_trade_by_buyer");
    parameterMap.put("partner", pluginConfig.getAttribute("partner"));
    parameterMap.put("_input_charset", "utf-8");
    parameterMap.put("sign_type", "MD5");
    parameterMap.put("return_url", getNotifyUrl(sn, NotifyMethod.sync));
    parameterMap.put("notify_url", getNotifyUrl(sn, NotifyMethod.async));
    parameterMap.put("out_trade_no", sn);
    parameterMap.put("subject",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 60));
    parameterMap.put("body",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 600));
    parameterMap.put("payment_type", "1");
    parameterMap.put("logistics_type", "EXPRESS");
    parameterMap.put("logistics_fee", "0");
    parameterMap.put("logistics_payment", "SELLER_PAY");
    parameterMap.put("price", payment.getAmount().setScale(2).toString());
    parameterMap.put("quantity", "1");
    parameterMap.put("seller_id", pluginConfig.getAttribute("partner"));
    parameterMap.put("total_fee", payment.getAmount().setScale(2).toString());
    parameterMap.put("show_url", setting.getSiteUrl());
    parameterMap.put("paymethod", "directPay");
    parameterMap.put("exter_invoke_ip", request.getLocalAddr());
    parameterMap.put("extra_common_param", "dp2345");
    parameterMap.put("sign", generateSign(parameterMap));
    return parameterMap;
}

From source file:net.shopxx.plugin.alipayDirectPayment.AlipayDirectPaymentPlugin.java

@Override
public Map<String, Object> getParameterMap(String sn, String description, HttpServletRequest request) {
    Setting setting = SystemUtils.getSetting();
    PluginConfig pluginConfig = getPluginConfig();
    PaymentLog paymentLog = getPaymentLog(sn);
    Map<String, Object> parameterMap = new HashMap<String, Object>();
    parameterMap.put("service", "create_direct_pay_by_user");
    parameterMap.put("partner", pluginConfig.getAttribute("partner"));
    parameterMap.put("_input_charset", "utf-8");
    parameterMap.put("sign_type", "MD5");
    parameterMap.put("return_url", getNotifyUrl(PaymentPlugin.NotifyMethod.sync));
    parameterMap.put("notify_url", getNotifyUrl(PaymentPlugin.NotifyMethod.async));
    parameterMap.put("out_trade_no", sn);
    parameterMap.put("subject",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 60));
    parameterMap.put("body",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 600));
    parameterMap.put("payment_type", "1");
    parameterMap.put("seller_id", pluginConfig.getAttribute("partner"));
    parameterMap.put("total_fee", paymentLog.getAmount().setScale(2).toString());
    parameterMap.put("show_url", setting.getSiteUrl());
    parameterMap.put("paymethod", "directPay");
    parameterMap.put("extend_param", "isv^1860648a1");
    parameterMap.put("exter_invoke_ip", request.getLocalAddr());
    parameterMap.put("extra_common_param", "shopxx");
    parameterMap.put("sign", generateSign(parameterMap));
    return parameterMap;
}

From source file:net.shopxx.plugin.alipayEscowPayment.AlipayEscowPaymentPlugin.java

@Override
public Map<String, Object> getParameterMap(String sn, String description, HttpServletRequest request) {
    Setting setting = SystemUtils.getSetting();
    PluginConfig pluginConfig = getPluginConfig();
    PaymentLog paymentLog = getPaymentLog(sn);
    Map<String, Object> parameterMap = new HashMap<String, Object>();
    parameterMap.put("service", "create_partner_trade_by_buyer");
    parameterMap.put("partner", pluginConfig.getAttribute("partner"));
    parameterMap.put("_input_charset", "utf-8");
    parameterMap.put("sign_type", "MD5");
    parameterMap.put("return_url", getNotifyUrl(PaymentPlugin.NotifyMethod.sync));
    parameterMap.put("notify_url", getNotifyUrl(PaymentPlugin.NotifyMethod.async));
    parameterMap.put("out_trade_no", sn);
    parameterMap.put("subject",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 60));
    parameterMap.put("body",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 600));
    parameterMap.put("payment_type", "1");
    parameterMap.put("logistics_type", "EXPRESS");
    parameterMap.put("logistics_fee", "0");
    parameterMap.put("logistics_payment", "SELLER_PAY");
    parameterMap.put("price", paymentLog.getAmount().setScale(2).toString());
    parameterMap.put("quantity", "1");
    parameterMap.put("seller_id", pluginConfig.getAttribute("partner"));
    parameterMap.put("total_fee", paymentLog.getAmount().setScale(2).toString());
    parameterMap.put("show_url", setting.getSiteUrl());
    parameterMap.put("paymethod", "directPay");
    parameterMap.put("extend_param", "isv^1860648a1");
    parameterMap.put("exter_invoke_ip", request.getLocalAddr());
    parameterMap.put("extra_common_param", "shopxx");
    parameterMap.put("sign", generateSign(parameterMap));
    return parameterMap;
}

From source file:net.osxx.plugin.tenpayDirect.TenpayDirectPlugin.java

@Override
public Map<String, Object> getParameterMap(String sn, String description, HttpServletRequest request) {
    PluginConfig pluginConfig = getPluginConfig();
    Payment payment = getPayment(sn);/*from   w  w  w  .  ja  v  a  2 s  . c o m*/
    Map<String, Object> parameterMap = new HashMap<String, Object>();
    parameterMap.put("trade_mode", "1");
    parameterMap.put("partner", pluginConfig.getAttribute("partner"));
    parameterMap.put("input_charset", "utf-8");
    parameterMap.put("sign_type", "MD5");
    parameterMap.put("return_url", getNotifyUrl(sn, NotifyMethod.sync));
    parameterMap.put("notify_url", getNotifyUrl(sn, NotifyMethod.async));
    parameterMap.put("out_trade_no", sn);
    parameterMap.put("subject",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 30));
    parameterMap.put("body",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 30));
    parameterMap.put("bank_type", "DEFAULT");
    parameterMap.put("seller_id", pluginConfig.getAttribute("partner"));
    parameterMap.put("total_fee", payment.getAmount().multiply(new BigDecimal(100)).setScale(0).toString());
    parameterMap.put("fee_type", "1");
    parameterMap.put("spbill_create_ip", request.getLocalAddr());
    parameterMap.put("attach", "osxx");
    parameterMap.put("sign", generateSign(parameterMap));
    return parameterMap;
}

From source file:net.shopxx.plugin.tenpayEscowPayment.TenpayEscowPaymentPlugin.java

@Override
public Map<String, Object> getParameterMap(String sn, String description, HttpServletRequest request) {
    PluginConfig pluginConfig = getPluginConfig();
    PaymentLog paymentLog = getPaymentLog(sn);
    Map<String, Object> parameterMap = new HashMap<String, Object>();
    parameterMap.put("trade_mode", "2");
    parameterMap.put("partner", pluginConfig.getAttribute("partner"));
    parameterMap.put("input_charset", "utf-8");
    parameterMap.put("sign_type", "MD5");
    parameterMap.put("return_url", getNotifyUrl(PaymentPlugin.NotifyMethod.sync));
    parameterMap.put("notify_url", getNotifyUrl(PaymentPlugin.NotifyMethod.async));
    parameterMap.put("out_trade_no", sn);
    parameterMap.put("subject",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 30));
    parameterMap.put("body",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 30));
    parameterMap.put("trans_type", "1");
    parameterMap.put("seller_id", pluginConfig.getAttribute("partner"));
    parameterMap.put("total_fee", paymentLog.getAmount().multiply(new BigDecimal(100)).setScale(0).toString());
    parameterMap.put("fee_type", "1");
    parameterMap.put("spbill_create_ip", request.getLocalAddr());
    parameterMap.put("attach", "shopxx");
    parameterMap.put("sign", generateSign(parameterMap));
    return parameterMap;
}

From source file:net.osxx.plugin.tenpayPartner.TenpayPartnerPlugin.java

@Override
public Map<String, Object> getParameterMap(String sn, String description, HttpServletRequest request) {
    PluginConfig pluginConfig = getPluginConfig();
    Payment payment = getPayment(sn);/*from  w  ww .j a v  a2 s .  co m*/
    Map<String, Object> parameterMap = new HashMap<String, Object>();
    parameterMap.put("trade_mode", "2");
    parameterMap.put("partner", pluginConfig.getAttribute("partner"));
    parameterMap.put("input_charset", "utf-8");
    parameterMap.put("sign_type", "MD5");
    parameterMap.put("return_url", getNotifyUrl(sn, NotifyMethod.sync));
    parameterMap.put("notify_url", getNotifyUrl(sn, NotifyMethod.async));
    parameterMap.put("out_trade_no", sn);
    parameterMap.put("subject",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 30));
    parameterMap.put("body",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 30));
    parameterMap.put("trans_type", "1");
    parameterMap.put("seller_id", pluginConfig.getAttribute("partner"));
    parameterMap.put("total_fee", payment.getAmount().multiply(new BigDecimal(100)).setScale(0).toString());
    parameterMap.put("fee_type", "1");
    parameterMap.put("spbill_create_ip", request.getLocalAddr());
    parameterMap.put("attach", "osxx");
    parameterMap.put("sign", generateSign(parameterMap));
    return parameterMap;
}

From source file:net.groupbuy.plugin.tenpayDirect.TenpayDirectPlugin.java

@Override
public Map<String, Object> getParameterMap(String sn, String description, HttpServletRequest request) {
    PluginConfig pluginConfig = getPluginConfig();
    Payment payment = getPayment(sn);/*from  w  w  w.j  ava 2 s  .c o  m*/
    Map<String, Object> parameterMap = new HashMap<String, Object>();
    parameterMap.put("trade_mode", "1");
    parameterMap.put("partner", pluginConfig.getAttribute("partner"));
    parameterMap.put("input_charset", "utf-8");
    parameterMap.put("sign_type", "MD5");
    parameterMap.put("return_url", getNotifyUrl(sn, NotifyMethod.sync));
    parameterMap.put("notify_url", getNotifyUrl(sn, NotifyMethod.async));
    parameterMap.put("out_trade_no", sn);
    parameterMap.put("subject",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 30));
    parameterMap.put("body",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 30));
    parameterMap.put("bank_type", "DEFAULT");
    parameterMap.put("seller_id", pluginConfig.getAttribute("partner"));
    parameterMap.put("total_fee", payment.getAmount().multiply(new BigDecimal(100)).setScale(0).toString());
    parameterMap.put("fee_type", "1");
    parameterMap.put("spbill_create_ip", request.getLocalAddr());
    parameterMap.put("attach", "shopxx");
    parameterMap.put("sign", generateSign(parameterMap));
    return parameterMap;
}

From source file:net.shopxx.plugin.tenpayDirectPayment.TenpayDirectPaymentPlugin.java

@Override
public Map<String, Object> getParameterMap(String sn, String description, HttpServletRequest request) {
    PluginConfig pluginConfig = getPluginConfig();
    PaymentLog paymentLog = getPaymentLog(sn);
    Map<String, Object> parameterMap = new HashMap<String, Object>();
    parameterMap.put("trade_mode", "1");
    parameterMap.put("partner", pluginConfig.getAttribute("partner"));
    parameterMap.put("input_charset", "utf-8");
    parameterMap.put("sign_type", "MD5");
    parameterMap.put("return_url", getNotifyUrl(PaymentPlugin.NotifyMethod.sync));
    parameterMap.put("notify_url", getNotifyUrl(PaymentPlugin.NotifyMethod.async));
    parameterMap.put("out_trade_no", sn);
    parameterMap.put("subject",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 30));
    parameterMap.put("body",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 30));
    parameterMap.put("bank_type", "DEFAULT");
    parameterMap.put("seller_id", pluginConfig.getAttribute("partner"));
    parameterMap.put("total_fee", paymentLog.getAmount().multiply(new BigDecimal(100)).setScale(0).toString());
    parameterMap.put("fee_type", "1");
    parameterMap.put("spbill_create_ip", request.getLocalAddr());
    parameterMap.put("attach", "shopxx");
    parameterMap.put("sign", generateSign(parameterMap));
    return parameterMap;
}