public class WechatCore extends Object implements WechatApi
cgi_bin_ticket_getticket, cgibin_add_template, cgibin_send_data, cgibin_set_industry, cgibin_token, close_order, micro_mch_add, micro_mch_qry, oauth2_access_token, oauth2_refresh_token, pay_micropay, pay_orderquery, pay_refund, pay_reverse, pay_unifiedorder, sns_auth_token, sns_userinfo| 构造器和说明 |
|---|
WechatCore() |
| 限定符和类型 | 方法和说明 |
|---|---|
static CloseOrderOutput |
closeOrder(CloseOrderInput data,
String apiKey)
微信订单关闭,商户订单支付失败需要生成新单号重新发起支付,要对原订单号调用关单,避免重复支付;系统下单后,用户支付超时,系统退出不再受理,避免用户继续,请调用关单接口.
|
static WechatPayOutput |
micropay(WechatPayInput data,
String apiKey)
微信刷卡支付,商户使用扫描枪扫用户微信支付码,消费者为被扫码对象,此方式与扫码支付扫码方式相反.
|
static OrderQueryOutput |
orderQuery(OrderQueryInput data,
String apiKey)
微信订单查询,除核心参数外(appid,mch_id等为核心参数)业务参数 transaction_id ,out_trade_no 二选一即可
需要调用查询接口的情况 当商户后台、网络、服务器等出现异常,商户系统最终未接收到支付通知; 调用支付接口后,返回系统错误或未知交易状态情况; 调用刷卡支付API,返回USERPAYING的状态; 调用关单或撤销接口API之前,需确认支付状态; |
static WechatRefundOutput |
refund(WechatRefundInput data,
String apiKey,
String p12FilePath)
微信退款,必须指定p12文件路径,否则无法完成退款动作,目前已知退款和撤销接口需要提供p12文件
使用该接口注意事项 交易时间超过一年的订单无法提交退款; 微信支付退款支持单笔交易分多次退款,多次退款需要提交原支付订单的商户订单号和设置不同的退款单号。 |
static WechatReverseOutput |
reverse(WechatReverseInput data,
String apiKey,
String p12FilePath)
微信撤销订单
使用情境 支付交易返回失败或支付系统超时,调用该接口撤销交易。 |
static UnifiedOrderOutput |
unifiedorder(UnifiedOrderInput data,
String apiKey)
微信统一下单,同时支援扫码支付统一下单 和 微信公众号统一下单
|
public static UnifiedOrderOutput unifiedorder(UnifiedOrderInput data, String apiKey)
data - 统一下单参数对象 UnifiedOrderInputapiKey - 微信API秘钥UnifiedOrderOutputpublic static WechatRefundOutput refund(WechatRefundInput data, String apiKey, String p12FilePath)
data - 退款参数对象 WechatRefundInputapiKey - 微信API秘钥p12FilePath - 微信p12文件路径WechatRefundOutputpublic static OrderQueryOutput orderQuery(OrderQueryInput data, String apiKey)
data - 查询参数对象 OrderQueryInputapiKey - API秘钥OrderQueryOutputpublic static WechatReverseOutput reverse(WechatReverseInput data, String apiKey, String p12FilePath)
支付交易返回失败或支付系统超时,调用该接口撤销交易。如果此订单用户支付失败,微信支付系统会将此订单关闭;如果用户支付成功,微信支付系统会将此订单资金退还给用户。
注意7天以内的交易单可调用撤销,其他正常支付的单如需实现相同功能请调用申请退款API。提交支付交易后调用【查询订单API】, 没有明确的支付结果再调用【撤销订单API】
data - 撤销参数对象 WechatReverseInputapiKey - API秘钥p12FilePath - p12文件路径WechatReverseOutputpublic static CloseOrderOutput closeOrder(CloseOrderInput data, String apiKey)
data - 参数对象 CloseOrderInputapiKey - 微信API秘钥CloseOrderOutputpublic static WechatPayOutput micropay(WechatPayInput data, String apiKey)
data - 支付参数对象 WechatPayInputapiKey - 微信API秘钥WechatPayOutputCopyright © 2018. All rights reserved.