public class AppServiceExtension
extends java.lang.Object
它封装了 AppService,并提供了一个增强的 APP 下单方法 prepayWithRequestPayment。
Modifier and Type | Class and Description |
---|---|
static class |
AppServiceExtension.Builder |
Modifier and Type | Method and Description |
---|---|
void |
closeOrder(CloseOrderRequest request)
关闭订单
|
PrepayWithRequestPaymentResponse |
prepayWithRequestPayment(PrepayRequest request)
APP 支付下单,并返回 APP 调起支付数据。推荐使用!
|
Transaction |
queryOrderById(QueryOrderByIdRequest request)
微信支付订单号查询订单
|
Transaction |
queryOrderByOutTradeNo(QueryOrderByOutTradeNoRequest request)
商户订单号查询订单
|
public PrepayWithRequestPaymentResponse prepayWithRequestPayment(PrepayRequest request)
请求成功后,该方法返回预支付交易会话标识 prepay_id 和客户端 APP 调起支付所需参数。 它相比 AppService.prepay 更简单易用,因为无需开发者自行计算调起支付签名。
request
- 请求参数com.wechat.pay.java.core.exception.HttpException
- 发送HTTP请求失败。例如构建请求参数失败、发送请求失败、I/O错误等。包含请求信息。com.wechat.pay.java.core.exception.ValidationException
- 发送HTTP请求成功,验证微信支付返回签名失败。com.wechat.pay.java.core.exception.ServiceException
- 发送HTTP请求成功,服务返回异常。例如返回状态码小于200或大于等于300。com.wechat.pay.java.core.exception.MalformedMessageException
- 服务返回成功,content-type不为application/json、解析返回体失败。public Transaction queryOrderById(QueryOrderByIdRequest request)
request
- 请求参数com.wechat.pay.java.core.exception.HttpException
- 发送HTTP请求失败。例如构建请求参数失败、发送请求失败、I/O错误等。包含请求信息。com.wechat.pay.java.core.exception.ValidationException
- 发送HTTP请求成功,验证微信支付返回签名失败。com.wechat.pay.java.core.exception.ServiceException
- 发送HTTP请求成功,服务返回异常。例如返回状态码小于200或大于等于300。com.wechat.pay.java.core.exception.MalformedMessageException
- 服务返回成功,content-type不为application/json、解析返回体失败。public Transaction queryOrderByOutTradeNo(QueryOrderByOutTradeNoRequest request)
request
- 请求参数com.wechat.pay.java.core.exception.HttpException
- 发送HTTP请求失败。例如构建请求参数失败、发送请求失败、I/O错误等。包含请求信息。com.wechat.pay.java.core.exception.ValidationException
- 发送HTTP请求成功,验证微信支付返回签名失败。com.wechat.pay.java.core.exception.ServiceException
- 发送HTTP请求成功,服务返回异常。例如返回状态码小于200或大于等于300。com.wechat.pay.java.core.exception.MalformedMessageException
- 服务返回成功,content-type不为application/json、解析返回体失败。public void closeOrder(CloseOrderRequest request)
request
- 请求参数com.wechat.pay.java.core.exception.HttpException
- 发送HTTP请求失败。例如构建请求参数失败、发送请求失败、I/O错误等。包含请求信息。com.wechat.pay.java.core.exception.ValidationException
- 发送HTTP请求成功,验证微信支付返回签名失败。com.wechat.pay.java.core.exception.ServiceException
- 发送HTTP请求成功,服务返回异常。例如返回状态码小于200或大于等于300。com.wechat.pay.java.core.exception.MalformedMessageException
- 服务返回成功,content-type不为application/json、解析返回体失败。