public abstract class BaseWxPayResult extends Object
微信支付结果共用属性类. Created by Binary Wang on 2016-10-24.
| 限定符和类型 | 字段和说明 |
|---|---|
protected String |
returnCode
返回状态码.
|
protected String |
returnMsg
返回信息.
|
| 构造器和说明 |
|---|
BaseWxPayResult() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
checkResult(WxPayService wxPayService,
String signType,
boolean checkSuccess)
校验返回结果签名.
|
static String |
fenToYuan(Integer fen)
将单位分转换成单位圆.
|
static <T extends BaseWxPayResult> |
fromXML(String xmlString,
Class<T> clz)
从xml字符串创建bean对象.
|
protected org.slf4j.Logger |
getLogger()
Gets logger.
|
protected String |
getXmlValue(String... path)
获取xml中元素的值.
|
protected Integer |
getXmlValueAsInt(String... path)
获取xml中元素的值,作为int值返回.
|
protected abstract void |
loadXml(Document d)
从XML文档中加载属性,供子类覆盖加载额外的属性
|
protected Document |
openXML(String content) |
protected static Integer |
readXmlInteger(Document d,
String tagName) |
protected static Integer |
readXmlInteger(Node d,
String tagName) |
protected static Long |
readXmlLong(Document d,
String tagName) |
static String |
readXmlString(Document d,
String tagName) |
protected static String |
readXmlString(Node d,
String tagName) |
Map<String,String> |
toMap()
将bean通过保存的xml字符串转换成map.
|
String |
toString() |
public static String fenToYuan(Integer fen)
fen - 将要被转换为元的分的数值public static <T extends BaseWxPayResult> T fromXML(String xmlString, Class<T> clz)
T - the type parameterxmlString - the xml stringclz - the clzprotected abstract void loadXml(Document d)
d - Documentprotected org.slf4j.Logger getLogger()
protected String getXmlValue(String... path)
path - the pathprotected Integer getXmlValueAsInt(String... path)
path - the pathpublic void checkResult(WxPayService wxPayService, String signType, boolean checkSuccess) throws WxPayException
wxPayService - the wx pay servicesignType - 签名类型checkSuccess - 是否同时检查结果是否成功WxPayException - the wx pay exceptionCopyright © 2024. All rights reserved.