| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.codec.digest.DigestUtils; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @Controller |
| | | @Api(value = "FIUUController", tags = "FIUU支付") |
| | | @RequestMapping(value = "/api/fuPay") |
| | | public class FIUUController { |
| | |
| | | |
| | | // Java 通知接口 暂时停止使用 |
| | | @PostMapping("/callback") |
| | | public FebsResponse handlePaymentCallback(@RequestParam Map<String, String> params) { |
| | | public String handlePaymentCallback(@RequestParam Map<String, String> params, Model model) { |
| | | String secretKey = "59c709fc18978a6a83b87f05d37cecbf"; |
| | | String tranID = params.get("tranID"); |
| | | String orderId = params.get("orderid"); |
| | |
| | | log.info("callback calculatedSkey: {}", calculatedSkey); |
| | | log.info("callback payResult: {}", mallOrderInfo.getPayResult()); |
| | | if("1".equals(mallOrderInfo.getPayResult())){ |
| | | return new FebsResponse().success().data("/pages/order/pay/paySuccess?amount="+ amount +"&type=3"); |
| | | return "success"; |
| | | } |
| | | |
| | | if (!calculatedSkey.equals(skey)) { |
| | |
| | | } |
| | | if ("00".equals(status)) { |
| | | updateOrderStatus(orderId, status, amount, paydate, tranID); |
| | | return new FebsResponse().success().data("/pages/order/pay/paySuccess?amount="+ amount +"&type=3"); |
| | | return "success"; |
| | | }else{ |
| | | return new FebsResponse().fail().message("支付失败"); |
| | | return "fail"; |
| | | } |
| | | } |
| | | |