先来个示例
就像写controller一样向微信发送请求。帮你把签名之类的工作全给做了。
java 代码解读复制代码
/**
* 微信app支付feign
*/
@Component
@FeignClient(url = "https://api.mch.weixin.qq.com", name = "wechatAppPayFeign", configuration = WechatAppPayFeignConfig.class)
public interface WechatAppPayFeign {
/**
* 发起预支付
*
* @param params 预支付参数
* @return 预支付返回信息
*/
@PostMapping("/v3/pay/transactions/app")
WechatAppPrepayResult prepay(WechatAppPrepayParams params);
/**
* 微信支付订单号查询.根据微信的订单id
*
* @param transactionId 微信支付订单号
* @param mchId 商户id
* @return o
*/
@GetMapping("/v3/pay/transactions/id/{transaction_id}")
WechatAppQueryResult queryForWechatOrderId(@PathVariable(name = "transaction