WeChatService.java 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. package com.cyksj.service.wechat;
  2. import com.cyksj.model.dto.*;
  3. import com.cyksj.model.response.WxGzhQrCodeTicketRep;
  4. import java.math.BigDecimal;
  5. import java.util.Date;
  6. import java.util.Map;
  7. public interface WeChatService {
  8. String createUrl(String state, String redirectUrl);
  9. String createUrl(String state, String redirectUrl, String appId, String scope);
  10. AuthToken getAuthToken(String code) throws Exception;
  11. AuthToken getAuthToken(String code, String appId) throws Exception;
  12. String getJsTicket() throws Exception;
  13. String getJsTicket(String appId) throws Exception;
  14. GzhOAuth2UserInfo getUserInfo(String accessToken, String openid) throws Exception;
  15. /**
  16. * 通过公众号的access_token 获取用户基本信息
  17. */
  18. GzhUnionidUserinfo getUserInfo2(String accessToken, String openid) throws Exception;
  19. String getAccessToken() throws Exception;
  20. String getAccessToken(String appId) throws Exception;
  21. /**
  22. * 统一订单
  23. *
  24. * @param appid 微信应用唯一id
  25. * @param openid 微信的用户标识
  26. * @param totalFee 订单总金额 单位为分
  27. * @param outTradeNo 订单批次号 一次支付对应一条订单批次号 可以包含多条购物记录(订单)
  28. * @param notifyUrl 通知地址
  29. * /@param attach 传入订单id 在查询API和支付通知中原样返回 用于处理订单
  30. * @return h5调用微信js-sdk必要的参数
  31. */
  32. H5JsPayParams getJsPayParams(String appid, String shopId,String openid, Integer totalFee, String outTradeNo, String notifyUrl, String attach, String body, String tradeType, Date ExpiryTime) throws Exception;
  33. /* 微信签名算法 */
  34. boolean checkSignWithMd5(Map<String, String> map) throws Exception;
  35. boolean checkSignWithMd5(Map<String, String> map, String shopKey) throws Exception;
  36. H5PayParams getH5PayParams(String appid, Integer totalFee, String outTradeNo, String notifyUrl, String attach, String ip, String body) throws Exception;
  37. /**
  38. * 发送模板消息 单对象
  39. *
  40. * @param accessToken WechatCache.getAccessToken()
  41. * @param json 消息json
  42. */
  43. void sendTemplateMessage(String accessToken, String json) throws Exception;
  44. /**
  45. * @param appId 应用id
  46. * @param transactionId 微信支付订单号
  47. * @param outRefundNo 商户退款单号
  48. * @param totalFee 订单金额 单位为分,只能为整数
  49. * @param refundMoney 退款金额
  50. */
  51. void refundWxOrder(String appId, String shopId, String transactionId, String outRefundNo, BigDecimal totalFee, BigDecimal refundMoney, String notifyUrl) throws Exception;
  52. /**
  53. * 获取公众号带参数的临时二维码
  54. * @return
  55. */
  56. WxGzhQrCodeTicketRep getWxGzhQrCode(Long sharedId, Integer dsType, Long popularizeId) throws Exception;
  57. /**
  58. * 获取公众号带参数的永久二维码
  59. */
  60. String getNotExpiredWxGzhQrCode(String sceneKey) throws Exception;
  61. }