WxTest.java 842 B

1234567891011121314151617181920212223
  1. package com.izouma.nineth;
  2. import com.github.binarywang.wxpay.bean.request.WxPayRefundRequest;
  3. import com.github.binarywang.wxpay.exception.WxPayException;
  4. import com.github.binarywang.wxpay.service.WxPayService;
  5. import com.izouma.nineth.utils.SnowflakeIdWorker;
  6. import org.junit.Test;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. public class WxTest extends ApplicationTests {
  9. @Autowired
  10. private WxPayService wxPayService;
  11. @Test
  12. public void refund() throws WxPayException {
  13. WxPayRefundRequest request = new WxPayRefundRequest();
  14. request.setTransactionId("4200001324202112096373883962");
  15. request.setTotalFee(100);
  16. request.setRefundFee(100);
  17. request.setOutRefundNo(String.valueOf(new SnowflakeIdWorker(0, 0).nextId()));
  18. wxPayService.refund(request);
  19. }
  20. }