支付宝回调分同步回调(GET)和异步回调(POST)
同步回调和异步回调的参数都是在拼接到url后面的参数
https://www.abc.com/api/payment/alipay/notice?gmt_create=2021-01-14 16:36:45&charset=UTF-8&gmt_payment=2021-01-14 16:36:53¬ify_time=2021-01-14 16:36:53&subject=通道开通费&sign=$$$&buyer_id=111111&invoice_amount=0.01&version=1.0¬ify_id=111111111&fund_bill_list=[{"amount":"0.01","fundChannel":"PCREDIT"}]¬ify_type=trade_status_sync&out_trade_no=1111111&total_amount=0.01&trade_status=TRADE_SUCCESS&trade_no=2021011422001455761413903947&auth_app_id=2111111111&receipt_amount=0.01&point_amount=0.00&buyer_pay_amount=0.01&app_id=111111111111&sign_type=RSA2&seller_id=11111111
Java接收参数的代码:
@RequestMapping("/notify")
public @ResponseBody String notify(HttpServletRequest request) {
// 一定要验签,防止黑客篡改参数
Map<String, String[]> parameterMap = request.getParameterMap();
StringBuilder notifyBuild = new StringBuilder("/****************************** alipay notify ******************************/\n")