2024-05-10 17:11:49 +08:00
|
|
|
package com.ai.da.controller;
|
|
|
|
|
|
|
|
|
|
import com.ai.da.common.response.Response;
|
2024-05-15 15:38:11 +08:00
|
|
|
import com.ai.da.service.AlipayHKService;
|
2024-05-10 17:11:49 +08:00
|
|
|
import io.swagger.annotations.Api;
|
2024-05-15 15:38:11 +08:00
|
|
|
import io.swagger.annotations.ApiOperation;
|
2024-05-10 17:11:49 +08:00
|
|
|
import lombok.extern.slf4j.Slf4j;
|
2024-05-15 15:38:11 +08:00
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.Map;
|
2024-05-10 17:11:49 +08:00
|
|
|
|
|
|
|
|
@CrossOrigin
|
|
|
|
|
@RestController
|
2024-05-15 15:38:11 +08:00
|
|
|
@RequestMapping("/api/alipay-hk")
|
2024-05-10 17:11:49 +08:00
|
|
|
@Api(tags = "网站支付 香港支付宝")
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class AlipayHKController {
|
|
|
|
|
|
2024-05-15 15:38:11 +08:00
|
|
|
@Resource
|
|
|
|
|
private AlipayHKService alipayHKService;
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "创建订单")
|
|
|
|
|
@PostMapping(value = "/createOrder")
|
|
|
|
|
public Response<String> createOrder(@RequestParam Integer amount, @RequestParam String wallet) {
|
|
|
|
|
String order = alipayHKService.createOrder(amount, wallet);
|
|
|
|
|
return Response.success(order);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation("支付通知")
|
|
|
|
|
@PostMapping("/trade/notify")
|
|
|
|
|
public String callback(@RequestParam Map<String, String> params){
|
|
|
|
|
return alipayHKService.callback(params);
|
2024-05-10 17:11:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-05-15 15:38:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-10 17:11:49 +08:00
|
|
|
}
|