Package com.foxinmy.weixin4j.payment
Class WeixinPayProxy
- java.lang.Object
-
- com.foxinmy.weixin4j.payment.WeixinPayProxy
-
@Deprecated public class WeixinPayProxy extends Object
Deprecated.迁移到子模块weixin4j-pay微信支付接口实现- Since:
- JDK 1.6
- Author:
- jinyu(foxinmy@gmail.com)
- See Also:
- 商户平台支付API
-
-
Constructor Summary
Constructors Constructor Description WeixinPayProxy()
Deprecated.微信支付接口实现(使用weixin4j.properties配置的account商户信息)WeixinPayProxy(WeixinPayAccount weixinPayAccount)
Deprecated.微信支付接口实现
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description RefundResult
applyRefund(IdQuery idQuery, String outRefundNo, double totalFee)
Deprecated.申请退款RefundResult
applyRefund(IdQuery idQuery, String outRefundNo, double totalFee, double refundFee, CurrencyType refundFeeType, String opUserId, String refundDesc, RefundAccountType refundAccountType)
Deprecated.申请退款OpenIdResult
authCode2openId(String authCode)
Deprecated.授权码查询OPENIDMerchantResult
closeOrder(String outTradeNo)
Deprecated.关闭订单String
createAddressRequestJSON(String url, String oauthToken)
Deprecated.生成编辑地址请求MchPayRequest
createAppPayRequest(String body, String outTradeNo, double totalFee, String notifyUrl, String createIp, String attach, SceneInfoStore store)
Deprecated.创建APP支付请求对象MchPayRequest
createJSPayRequest(String openId, String body, String outTradeNo, double totalFee, String notifyUrl, String createIp, String attach)
Deprecated.创建JSAPI支付请求对象MchPayRequest
createMicroPayRequest(String authCode, String body, String outTradeNo, double totalFee, String createIp, String attach, SceneInfoStore store)
Deprecated.提交被扫支付String
createNativePayRequest(String productId)
Deprecated.创建Native支付(扫码支付)链接【模式一】MchPayRequest
createNativePayRequest(String productId, String body, String outTradeNo, double totalFee, String notifyUrl, String createIp, String attach)
Deprecated.创建Native支付(扫码支付)链接【模式二】NativePayResponse
createNativePayResponse(String productId, String body, String outTradeNo, double totalFee, String notifyUrl, String createIp, String attach)
Deprecated.创建Native支付(扫码支付)回调对象【模式一】MchPayRequest
createPayRequest(MchPayPackage payPackage)
Deprecated.创建支付请求对象PrePay
createPrePay(MchPayPackage payPackage)
Deprecated.统一下单接口 除被扫支付场景以外,商户系统先调用该接口在微信支付服务后台生成预支付交易单,返回正确的预支付交易回话标识后再按扫码、JSAPI 、APP等不同场景生成交易串调起支付。MchPayRequest
createWapPayRequest(String body, String outTradeNo, double totalFee, String notifyUrl, String createIp, String attach, SceneInfoApp app)
Deprecated.创建WAP支付请求对象CustomsOrderResult
declareCustomsOrder(CustomsOrder customsOrder)
Deprecated.订单附加信息提交void
downloadBill(Date billDate, BillType billType, OutputStream outputStream, TarType tarType)
Deprecated.下载对账单
1.微信侧未成功下单的交易不会出现在对账单中。支付成功后撤销的交易会出现在对账 单中,跟原支付单订单号一致,bill_type 为 REVOKED;
2.微信在次日 9 点启动生成前一天的对账单,建议商户 9 点半后再获取;
3.对账单中涉及金额的字段单位为“元”。String
getPayShorturl(String url)
Deprecated.native支付URL转短链接:用于扫码原生支付模式一中的二维码链接转成短链接(weixin://wxpay/s/XXXXXX),减小二维码数据量 ,提升扫描速度和精确度。WeixinPayAccount
getWeixinPayAccount()
Deprecated.获取微信商户账号信息WeixinSignature
getWeixinSignature()
Deprecated.获取微信签名类CorpPaymentRecord
queryCorpPayment(String outTradeNo)
Deprecated.企业付款查询 用于商户的企业付款操作进行结果查询,返回付款操作详细结果CouponDetail
queryCouponDetail(String openId, String couponId, String stockId)
Deprecated.查询代金券详细CouponStock
queryCouponStock(String couponStockId)
Deprecated.查询代金券批次CustomsOrderRecord
queryCustomsOrder(IdQuery idQuery, CustomsCity customsCity)
Deprecated.订单附加信息查询double
queryExchageRate(CurrencyType currencyType, Date date)
Deprecated.查询汇率Order
queryOrder(IdQuery idQuery)
Deprecated.订单查询RedpacketRecord
queryRedpack(String outTradeNo)
Deprecated.查询红包记录RefundRecord
queryRefund(IdQuery idQuery)
Deprecated.退款查询SettlementRecord
querySettlement(boolean status, Pageable pageable, Date start, Date end)
Deprecated.查询结算资金XmlResult
reportInterface(String interfaceUrl, int executeTime, String outTradeNo, String ip, Date time, XmlResult returnXml)
Deprecated.接口上报MerchantResult
reverseOrder(IdQuery idQuery)
Deprecated.冲正订单(需要证书) 当支付返回失败,或收银系统超时需要取消交易,可以调用该接口 接口逻辑:支 付失败的关单,支付成功的撤销支付 7天以内的单可撤销,其他正常支付的单 如需实现相同功能请调用退款接口 调用扣款接口后请勿立即调用撤销,需要等待5秒以上。先调用查单接口,如果没有确切的返回,再调用撤销CorpPaymentResult
sendCorpPayment(CorpPayment payment)
Deprecated.企业付款CouponResult
sendCoupon(String couponStockId, String partnerTradeNo, String openId, String opUserId)
Deprecated.发放代金券(需要证书)RedpacketSendResult
sendRedpack(Redpacket redpacket)
Deprecated.发放红包 企业向微信用户个人发现金红包List<Future<RedpacketSendResult>>
sendRedpacks(Redpacket... redpackets)
Deprecated.批量发放红包 企业向微信用户个人发现金红包
-
-
-
Field Detail
-
VERSION
public static final String VERSION
Deprecated.
-
-
Constructor Detail
-
WeixinPayProxy
public WeixinPayProxy()
Deprecated.微信支付接口实现(使用weixin4j.properties配置的account商户信息)
-
WeixinPayProxy
public WeixinPayProxy(WeixinPayAccount weixinPayAccount)
Deprecated.微信支付接口实现- Parameters:
weixinPayAccount
- 微信商户信息
-
-
Method Detail
-
getWeixinPayAccount
public WeixinPayAccount getWeixinPayAccount()
Deprecated.获取微信商户账号信息- Returns:
-
getWeixinSignature
public WeixinSignature getWeixinSignature()
Deprecated.获取微信签名类- Returns:
-
createPrePay
public PrePay createPrePay(MchPayPackage payPackage) throws WeixinException
Deprecated.统一下单接口 除被扫支付场景以外,商户系统先调用该接口在微信支付服务后台生成预支付交易单,返回正确的预支付交易回话标识后再按扫码、JSAPI 、APP等不同场景生成交易串调起支付。- Parameters:
payPackage
- 包含订单信息的对象- Returns:
- 预支付对象
- Throws:
WeixinException
- See Also:
PayApi
,MchPayPackage
,PrePay
, 统一下单接口
-
createPayRequest
public MchPayRequest createPayRequest(MchPayPackage payPackage) throws WeixinException
Deprecated.创建支付请求对象- Parameters:
payPackage
- 支付详情- Returns:
- 支付请求对象
- Throws:
WeixinException
- See Also:
PayApi
,JS支付
,扫码支付
,刷卡支付
,APP支付
,WAP支付
,MchPayRequest.toRequestString()
-
createJSPayRequest
public MchPayRequest createJSPayRequest(String openId, String body, String outTradeNo, double totalFee, String notifyUrl, String createIp, String attach) throws WeixinException
Deprecated.创建JSAPI支付请求对象- Parameters:
openId
- 用户IDbody
- 订单描述outTradeNo
- 订单号totalFee
- 订单总额(元)notifyUrl
- 支付通知地址createIp
- ip地址attach
- 附加数据 非必填- Returns:
- JSAPI支付对象
- Throws:
WeixinException
- See Also:
PayApi
,JSAPIPayRequest
,MchPayRequest.toRequestString()
-
createAddressRequestJSON
public String createAddressRequestJSON(String url, String oauthToken)
Deprecated.生成编辑地址请求
err_msg edit_address:ok获取编辑收货地址成功 edit_address:fail获取编辑收货地址失败 userName 收货人姓名 telNumber 收货人电话 addressPostalCode 邮编 proviceFirstStageName 国标收货地址第一级地址 addressCitySecondStageName 国标收货地址第二级地址 addressCountiesThirdStageName 国标收货地址第三级地址 addressDetailInfo 详细收货地址信息 nationalCode 收货地址国家码
-
createNativePayRequest
public String createNativePayRequest(String productId)
Deprecated.创建Native支付(扫码支付)链接【模式一】
-
createNativePayResponse
public NativePayResponse createNativePayResponse(String productId, String body, String outTradeNo, double totalFee, String notifyUrl, String createIp, String attach) throws WeixinException
Deprecated.创建Native支付(扫码支付)回调对象【模式一】- Parameters:
productId
- 商品IDbody
- 商品描述outTradeNo
- 商户内部唯一订单号totalFee
- 商品总额 单位元notifyUrl
- 支付回调URLcreateIp
- 订单生成的机器 IPattach
- 附加数据 非必填- Returns:
- Native回调对象
- Throws:
WeixinException
- See Also:
PayApi
,NativePayResponse
, 扫码支付 , 模式一
-
createNativePayRequest
public MchPayRequest createNativePayRequest(String productId, String body, String outTradeNo, double totalFee, String notifyUrl, String createIp, String attach) throws WeixinException
Deprecated.创建Native支付(扫码支付)链接【模式二】- Parameters:
productId
- 商品IDbody
- 商品描述outTradeNo
- 商户内部唯一订单号totalFee
- 商品总额 单位元notifyUrl
- 支付回调URLcreateIp
- 订单生成的机器 IPattach
- 附加数据 非必填- Returns:
- Native支付对象
- Throws:
WeixinException
- See Also:
PayApi
,NATIVEPayRequest
,MchPayRequest.toRequestString()
, 扫码支付 , 模式二
-
createAppPayRequest
public MchPayRequest createAppPayRequest(String body, String outTradeNo, double totalFee, String notifyUrl, String createIp, String attach, SceneInfoStore store) throws WeixinException
Deprecated.创建APP支付请求对象- Parameters:
body
- 商品描述outTradeNo
- 商户内部唯一订单号totalFee
- 商品总额 单位元notifyUrl
- 支付回调URLcreateIp
- 订单生成的机器 IPattach
- 附加数据 非必填store
- 门店信息 非必填- Returns:
- APP支付对象
- Throws:
WeixinException
- See Also:
PayApi
,SceneInfoStore
,APPPayRequest
,MchPayRequest.toRequestString()
, APP支付
-
createWapPayRequest
public MchPayRequest createWapPayRequest(String body, String outTradeNo, double totalFee, String notifyUrl, String createIp, String attach, SceneInfoApp app) throws WeixinException
Deprecated.创建WAP支付请求对象- Parameters:
body
- 商品描述outTradeNo
- 商户内部唯一订单号totalFee
- 商品总额 单位元notifyUrl
- 支付回调URLcreateIp
- 订单生成的机器 IPattach
- 附加数据 非必填app
- 应用信息- Returns:
- WAP支付对象
- Throws:
WeixinException
- See Also:
PayApi
,SceneInfoApp
,WAPPayRequest
,MchPayRequest.toRequestString()
, WAP支付
-
createMicroPayRequest
public MchPayRequest createMicroPayRequest(String authCode, String body, String outTradeNo, double totalFee, String createIp, String attach, SceneInfoStore store) throws WeixinException
Deprecated.提交被扫支付- Parameters:
authCode
- 扫码支付授权码 ,设备读取用户微信中的条码或者二维码信息body
- 商品描述outTradeNo
- 商户内部唯一订单号totalFee
- 商品总额 单位元createIp
- 订单生成的机器 IPattach
- 附加数据 非必填store
- 门店信息 非必填- Returns:
- 支付的订单信息
- Throws:
WeixinException
- See Also:
PayApi
,Order
,SceneInfoStore
,MICROPayRequest
,MchPayRequest.toRequestString()
, 提交被扫支付API
-
queryOrder
public Order queryOrder(IdQuery idQuery) throws WeixinException
Deprecated.订单查询当商户后台、网络、服务器等出现异常,商户系统最终未接收到支付通知; 调用支付接口后,返回系统错误或未知交易状态情况; 调用被扫支付API,返回USERPAYING的状态; 调用关单或撤销接口API之前,需确认支付状态;
- Parameters:
idQuery
- 商户系统内部的订单号, transaction_id、out_trade_no 二 选一,如果同时存在优先级: transaction_id> out_trade_no- Returns:
- 订单详情
- Throws:
WeixinException
- Since:
- V3
- See Also:
Order
,PayApi
, 订单查询API
-
applyRefund
public RefundResult applyRefund(IdQuery idQuery, String outRefundNo, double totalFee, double refundFee, CurrencyType refundFeeType, String opUserId, String refundDesc, RefundAccountType refundAccountType) throws WeixinException
Deprecated.申请退款
-
applyRefund
public RefundResult applyRefund(IdQuery idQuery, String outRefundNo, double totalFee) throws WeixinException
Deprecated.申请退款- Throws:
WeixinException
- See Also:
PayApi.applyRefund(IdQuery, String, double)
-
queryRefund
public RefundRecord queryRefund(IdQuery idQuery) throws WeixinException
Deprecated.退款查询提交退款申请后,通过调用该接口查询退款状态。退款有一定延时,用零钱支付的退款20分钟内到账,银行卡支付的退款3个工作日后重新查询退款状态。
- Parameters:
idQuery
- 单号 refund_id、out_refund_no、 out_trade_no 、 transaction_id 四个参数必填一个,优先级为: refund_id>out_refund_no>transaction_id>out_trade_no- Returns:
- 退款记录
- Throws:
WeixinException
- Since:
- V3
- See Also:
PayApi
,RefundRecord
, 退款查询API
-
downloadBill
public void downloadBill(Date billDate, BillType billType, OutputStream outputStream, TarType tarType) throws WeixinException
Deprecated.下载对账单
1.微信侧未成功下单的交易不会出现在对账单中。支付成功后撤销的交易会出现在对账 单中,跟原支付单订单号一致,bill_type 为 REVOKED;
2.微信在次日 9 点启动生成前一天的对账单,建议商户 9 点半后再获取;
3.对账单中涉及金额的字段单位为“元”。- Parameters:
billDate
- 下载对账单的日期billType
- 下载对账单的类型 ALL,返回当日所有订单信息, 默认值 SUCCESS,返回当日成功支付的订单 REFUND,返回当日退款订单tarType
- 非必传参数,固定值:GZIP,返回格式为.gzip的压缩包账单。不传则默认为数据流形式。- Throws:
WeixinException
- Since:
- V2 & V3
- See Also:
PayApi
, 下载对账单API
-
reverseOrder
public MerchantResult reverseOrder(IdQuery idQuery) throws WeixinException
Deprecated.冲正订单(需要证书) 当支付返回失败,或收银系统超时需要取消交易,可以调用该接口 接口逻辑:支 付失败的关单,支付成功的撤销支付 7天以内的单可撤销,其他正常支付的单 如需实现相同功能请调用退款接口 调用扣款接口后请勿立即调用撤销,需要等待5秒以上。先调用查单接口,如果没有确切的返回,再调用撤销- Parameters:
idQuery
- 商户系统内部的订单号, transaction_id 、 out_trade_no 二选一,如果同时存在优先级: transaction_id> out_trade_no- Returns:
- 撤销结果
- Throws:
WeixinException
- Since:
- V3
- See Also:
PayApi
-
closeOrder
public MerchantResult closeOrder(String outTradeNo) throws WeixinException
Deprecated.关闭订单商户订单支付失败需要生成新单号重新发起支付,要对原订单号调用关单,避免重复支付;系统下单后,用户支付超时,系统退出不再受理,避免用户继续 ,请调用关单接口,如果关单失败,返回已完 成支付请按正常支付处理。如果出现银行掉单,调用关单成功后,微信后台会主动发起退款。
- Parameters:
outTradeNo
- 商户系统内部的订单号- Returns:
- 执行结果
- Throws:
WeixinException
- Since:
- V3
- See Also:
PayApi
, 关闭订单API
-
getPayShorturl
public String getPayShorturl(String url) throws WeixinException
Deprecated.native支付URL转短链接:用于扫码原生支付模式一中的二维码链接转成短链接(weixin://wxpay/s/XXXXXX),减小二维码数据量 ,提升扫描速度和精确度。- Parameters:
url
- 具有native标识的支付URL- Returns:
- 转换后的短链接
- Throws:
WeixinException
- Since:
- V3
- See Also:
PayApi
, 转换短链接API
-
reportInterface
public XmlResult reportInterface(String interfaceUrl, int executeTime, String outTradeNo, String ip, Date time, XmlResult returnXml) throws WeixinException
Deprecated.接口上报- Parameters:
interfaceUrl
- 上报对应的接口的完整 URL, 类似: https://api.mch.weixin.q q.com/pay/unifiedorderexecuteTime
- 接口耗时情况,单位为毫秒outTradeNo
- 商户系统内部的订单号,商 户可以在上报时提供相关商户订单号方便微信支付更好 的提高服务质量。ip
- 发起接口调用时的机器 IPtime
- 商户调用该接口时商户自己 系统的时间returnXml
- 调用接口返回的基本数据- Returns:
- 处理结果
- Throws:
WeixinException
- See Also:
PayApi
, 接口测试上报API
-
sendCoupon
public CouponResult sendCoupon(String couponStockId, String partnerTradeNo, String openId, String opUserId) throws WeixinException
Deprecated.发放代金券(需要证书)- Parameters:
couponStockId
- 代金券批次idpartnerTradeNo
- 商户发放凭据号(格式:商户id+日期+流水号),商户侧需保持唯一性openId
- 用户的openidopUserId
- 操作员帐号, 默认为商户号 可在商户平台配置操作员对应的api权限 可为空- Returns:
- 发放结果
- Throws:
WeixinException
- See Also:
CouponApi
,CouponResult
, 发放代金券接口
-
queryCouponStock
public CouponStock queryCouponStock(String couponStockId) throws WeixinException
Deprecated.查询代金券批次- Parameters:
couponStockId
- 代金券批次ID- Returns:
- 代金券批次信息
- Throws:
WeixinException
- See Also:
CouponApi
,CouponStock
, 查询代金券批次信息接口
-
queryCouponDetail
public CouponDetail queryCouponDetail(String openId, String couponId, String stockId) throws WeixinException
Deprecated.查询代金券详细- Parameters:
openId
- 用户IDcouponId
- 代金券IDstockId
- 代金劵对应的批次号- Returns:
- 代金券详细信息
- Throws:
WeixinException
- See Also:
CouponApi
,CouponDetail
, 查询代金券详细信息接口
-
sendRedpack
public RedpacketSendResult sendRedpack(Redpacket redpacket) throws WeixinException
Deprecated.发放红包 企业向微信用户个人发现金红包- Parameters:
redpacket
- 红包信息- Returns:
- 发放结果
- Throws:
WeixinException
- See Also:
CashApi
,Redpacket
,RedpacketSendResult
, 发放现金红包接口, 发放裂变红包接口
-
sendRedpacks
public List<Future<RedpacketSendResult>> sendRedpacks(Redpacket... redpackets)
Deprecated.批量发放红包 企业向微信用户个人发现金红包- Parameters:
redpacket
- 多个红包信息- Returns:
- 发放结果
- Throws:
WeixinException
- See Also:
CashApi
,sendRedpacks(Redpacket...)
-
queryRedpack
public RedpacketRecord queryRedpack(String outTradeNo) throws WeixinException
Deprecated.查询红包记录- Parameters:
outTradeNo
- 商户发放红包的商户订单号- Returns:
- 红包记录
- Throws:
WeixinException
- See Also:
CashApi
,RedpacketRecord
, 查询现金红包接口, 查询裂变红包接口
-
sendCorpPayment
public CorpPaymentResult sendCorpPayment(CorpPayment payment) throws WeixinException
Deprecated.企业付款- Throws:
WeixinException
- See Also:
CashApi.sendCorpPayment(CorpPayment)
-
queryCorpPayment
public CorpPaymentRecord queryCorpPayment(String outTradeNo) throws WeixinException
Deprecated.企业付款查询 用于商户的企业付款操作进行结果查询,返回付款操作详细结果- Parameters:
outTradeNo
- 商户调用企业付款API时使用的商户订单号- Returns:
- 付款记录
- Throws:
WeixinException
- See Also:
CashApi
,CorpPaymentRecord
, 企业付款查询接口
-
authCode2openId
public OpenIdResult authCode2openId(String authCode) throws WeixinException
Deprecated.授权码查询OPENID- Parameters:
authCode
- 扫码支付授权码,设备读取用户微信中的条码或者二维码信息- Returns:
- 查询结果
- Throws:
WeixinException
- See Also:
CashApi
,OpenIdResult
, 授权码查询OPENID
-
querySettlement
public SettlementRecord querySettlement(boolean status, Pageable pageable, Date start, Date end) throws WeixinException
Deprecated.查询结算资金- Parameters:
status
- 是否结算pageable
- 分页数据start
- 开始日期 查询未结算记录时,该字段可不传end
- 结束日期 查询未结算记录时,该字段可不传- Returns:
- 结算金额记录
- Throws:
WeixinException
- See Also:
CashApi
,SettlementRecord
, 查询结算资金接口
-
queryExchageRate
public double queryExchageRate(CurrencyType currencyType, Date date) throws WeixinException
Deprecated.查询汇率- Parameters:
currencyType
- 外币币种date
- 日期 不填则默认当天- Returns:
- 汇率对象
- Throws:
WeixinException
- See Also:
CashApi
, 查询汇率接口
-
declareCustomsOrder
public CustomsOrderResult declareCustomsOrder(CustomsOrder customsOrder) throws WeixinException
Deprecated.订单附加信息提交- Parameters:
customsOrder
- 附加订单信息- Returns:
- 报关结果
- Throws:
WeixinException
- See Also:
CustomsApi
,CustomsOrder
,CustomsOrderResult
, 附加订单信息提交接口
-
queryCustomsOrder
public CustomsOrderRecord queryCustomsOrder(IdQuery idQuery, CustomsCity customsCity) throws WeixinException
Deprecated.订单附加信息查询- Parameters:
idQuery
- out_trade_no,transaction_id,sub_order_no,sub_order_id四选一customsCity
- 海关- Returns:
- 报关记录
- Throws:
WeixinException
- See Also:
CustomsOrderRecord
,CustomsApi
, 附加订单信息查询接口
-
-