This repository has been archived by the owner on Jul 22, 2022. It is now read-only.
feilong pay orderdesc unex
feilong edited this page Feb 27, 2019
·
4 revisions
worldpay 显示订单描述
在 provider-unex.properties 中
unex.orderDesc=feilong香港官方網上商店商品
示例:
示例:
GotopayRequest gotopayRequest = new DefaultGotopayRequest();
...
gotopayRequest.setTradeDescription("feilong商城");
...
注意: 这种做法 优先级 高于 第一种
波姐:我的网站有多语言需求, 中文下 要 feilong香港官方網上商店商品 ,英文环境下 要 feilong Hong Kong Official Online Store Product
好问题, 好需求
如此这般
/** The application context. */
@Resource
protected ApplicationContext applicationContext;
GotopayRequest gotopayRequest = new DefaultGotopayRequest();
...
String tradeDescription=com.feilong.spring.messagesource.MessageSourceUtil.getMessage(applicationContext, "unex.orderDesc");
gotopayRequest.setTradeDescription(tradeDescription);
...
然后 在 spring i18N 国际化配置文件中 payment_zh_CN.properties, 分别新增 ,
unex.orderDesc=feilong香港官方網上商店商品
以及 paymentType_en_GB.properties
unex.orderDesc=feilong Hong Kong Official Online Store Product
原先 provider-unex.properties
暂时不要删除, 冗余 保底
public class DefaultUnexOrderOrderDescBuilder implements UnexOrderOrderDescBuilder{
public static final UnexOrderOrderDescBuilder INSTANCE = new DefaultUnexOrderOrderDescBuilder();
@Override
public String build(GotopayRequest gotopayRequest,UnexGotopayBeanProperty unexGotopayBeanProperty){
String tradeDescription = gotopayRequest.getTradeDescription();
if (isNotNullOrEmpty(tradeDescription)){
return tradeDescription;
}
return unexGotopayBeanProperty.getOrderDesc();
}
}
gotopayRequest.getTradeDescription()
优先于 unexGotopayBeanProperty.getOrderDesc()
QQ 群 243306798
|
---|
如果您对本项目有任何建议和批评,可以使用下面的联系方式:
- iteye博客:http://feitianbenyue.iteye.com/