|
|
@@ -0,0 +1,54 @@
|
|
|
+/*
|
|
|
+ * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
|
|
|
+ *
|
|
|
+ * https://www.gz-yami.com/
|
|
|
+ *
|
|
|
+ * 未经允许,不可做商业用途!
|
|
|
+ *
|
|
|
+ * 版权所有,侵权必究!
|
|
|
+ */
|
|
|
+
|
|
|
+package com.yami.shop.api.controller;
|
|
|
+
|
|
|
+import com.alibaba.fastjson2.JSONObject;
|
|
|
+import com.yami.shop.wx.po.JsapiPo;
|
|
|
+import com.yami.shop.wx.service.WxProviderService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+
|
|
|
+@RestController
|
|
|
+@AllArgsConstructor
|
|
|
+@Api(tags = "地址接口")
|
|
|
+@RequestMapping("/wx")
|
|
|
+public class WxPayController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private WxProviderService wxProviderService;
|
|
|
+
|
|
|
+ @PostMapping("/jsapi/pay")
|
|
|
+ @ApiOperation(value = "小程序支付", notes = "小程序支付")
|
|
|
+ public ResponseEntity<Map<String, Object>> jsapiPay(@Validated @RequestBody JsapiPo po) {
|
|
|
+ return ResponseEntity.ok(wxProviderService.subJsapi(po));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/refundOrder")
|
|
|
+ @ApiOperation(value = "小程序退款", notes = "小程序退款")
|
|
|
+ public ResponseEntity<String> refundOrder(String orderNo) {
|
|
|
+ return ResponseEntity.ok(wxProviderService.refundOrder(orderNo));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/getPayResultByOrderNo")
|
|
|
+ @ApiOperation(value = "查询微信支付订单", notes = "查询微信支付订单")
|
|
|
+ public ResponseEntity<Map<String, Object>> getPayResultByOrderNo(String orderNo) {
|
|
|
+ return ResponseEntity.ok(wxProviderService.getPayResultByOrderNo(orderNo));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|