public class WechatPayUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected static org.slf4j.Logger |
log |
| 构造器和说明 |
|---|
WechatPayUtil(String key,
org.anyline.entity.DataRow config) |
WechatPayUtil(WechatPayConfig config) |
| 限定符和类型 | 方法和说明 |
|---|---|
org.anyline.entity.DataRow |
callUpParam(String appid,
String prepayid)
JSAPI调起支付所需参数
|
String |
decrypt(String associated,
String nonce,
String ciphertext)
解密数据
|
WechatPayConfig |
getConfig() |
static WechatPayUtil |
getInstance() |
static WechatPayUtil |
getInstance(String key) |
static Hashtable<String,WechatPayUtil> |
getInstances() |
PrivateKey |
getPrivateKey(String path)
获取私钥
|
WechatRefundResult |
refund(WechatRefund refund)
退款申请
|
static WechatPayUtil |
reg(String key,
org.anyline.entity.DataRow config) |
String |
sign(byte[] message)
签名
|
WechatPrePayResult |
transactions(WechatPayConfig.TRADE_TYPE type,
WechatPrePayOrder order)
统一下单
|
WechatEnterpriseTransferResult |
transfer(WechatEnterpriseTransfer transfer)
企业付款
|
WechatPrePayResult |
unifiedorder(WechatPayConfig.TRADE_TYPE type,
WechatPrePayOrder order) |
boolean |
verifySign() |
public WechatPayUtil(WechatPayConfig config)
public WechatPayUtil(String key, org.anyline.entity.DataRow config)
public static Hashtable<String,WechatPayUtil> getInstances()
public static WechatPayUtil getInstance()
public static WechatPayUtil reg(String key, org.anyline.entity.DataRow config)
public static WechatPayUtil getInstance(String key)
public WechatPayConfig getConfig()
public WechatPrePayResult unifiedorder(WechatPayConfig.TRADE_TYPE type, WechatPrePayOrder order)
public WechatPrePayResult transactions(WechatPayConfig.TRADE_TYPE type, WechatPrePayOrder order)
type - 支付方式order - 订单public org.anyline.entity.DataRow callUpParam(String appid, String prepayid)
appid - appidprepayid - 预支付id(由统一下单接口返回)public WechatRefundResult refund(WechatRefund refund) throws Exception
refund - refundException - Exceptionpublic WechatEnterpriseTransferResult transfer(WechatEnterpriseTransfer transfer)
transfer - transferpublic String sign(byte[] message) throws Exception
message - messageException - Exceptionpublic boolean verifySign()
public PrivateKey getPrivateKey(String path) throws IOException
path - 文件地址IOException - IOExceptionpublic String decrypt(String associated, String nonce, String ciphertext) throws Exception
associated - 附加数据包nonce - 加密使用的随机串初始化向量ciphertext - Base64编码后的密文GeneralSecurityException - GeneralSecurityExceptionIOException - IOExceptionExceptionCopyright © 2022. All rights reserved.