支付宝 API 里的触发示例是这样的:

https://www.merchant.com/receive_notify.htm?notify_type=trade_status_sync&notify_id=91722adff935e8cfa58b3aabf4dead6ibe&notify_time=2017-02-16 21:46:15&sign_type=RSA2&sign=WcO+t3D8Kg71dTlKwN7r9PzUOXeaBJwp8/FOuSxcuSkXsoVYxBpsAidprySCjHCjmaglNcjoKJQLJ28/Asl93joTW39FX6i07lXhnbPknezAlwmvPdnQuI01HZsZF9V1i6ggZjBiAd5lG8bZtTxZOJ87ub2i9GuJ3Nr/NUc9VeY=&app_id=2088102146225135&trade_no=2013112011001004330000121536&out_trade_no=6823789339978248&out_biz_no=85478536823789339978248&buyer_logon_id=159****5620&seller_id=2088102146225135&trans_currency=USD&seller_email=aa@mail.sa.com&total_amount=120.88&buyer_id=2088202954065786&settle_currency=USD&settle_amount=88.88&pay_currency=CNY&pay_amount=580.04&settle_trans_rate=1&trans_pay_rate=6.5261&trade_status=TRADE_SUCCESS&invoice_amount=88.88&receipt_amount=88.88&point_amount=88.88&refund_fee=10.23&buyer_pay_amount=88.88&subject=Iphone6 16G&body=Iphone6 16G&gmt_create=2014-11-27 15:45:57&gmt_payment=2014-11-27 15:45:57&gmt_refund=2014-11-27 14:15:57&gmt_close=2014-11-27 17:45:57&fund_bill_list="[{\"amount\":\"10000.00\",\"fundChannel\":\"ALIPAYACCOUNT\"}]"&voucher_detail_list="[{\"id\":\"20170307000730026487005X1M6V\",\"name\":\"全仓5折优惠券\"}]"&discount_goods_detail="[{\"goodsId\":\"STANDARD1026181538\",\"goodsName\":\"雪碧\",\"discountAmount\":\"10.00\"}]"&refund_preset_paytool_list=[{"amount":"1.00","assert_type_code":"HEMA"}]&charge_amount=8.88&charge_flags=bluesea_1&settlement_id=2018101610032004620239146945&advance_amount=11.11&current_seller_received_amount=88.88&seller_received_total_amount=88.88&total_from_seller_fee=88.88&ff_current_period=1&notify_action_type=payByAccountAction/closeTradeAction/reverseAction/finishFPAction/confirmDisburseAction/financingReceiptAction&discount_amount=88.88&mdiscount_amount=88.88&unfreeze_amount=18.18&auth_trade_pay_mode=CREDIT_PREAUTH_PAY&passback_params=merchantBizType%3d3C%26merchantBizNo%3d2016010101111&hb_fq_pay_info={"USER_INSTALL_NUM":"3"}&receipt_currency_type=DC

然后不由自主的就把路由设置为 get 请求类型的,通过 收不到异步通知 - 支付宝文档 排查才知道,回调必须用 post 接受数据。所以 API 里的示例是用来迷惑谁的?

以下为常见的支付宝 API 收不到异步通知的常见问题:

1、异步通知发送地址错误

2、notify_url 参数位置设置错误

3、异步地址设置错误

4、异步地址必须外网可访问

5、异步地址必须能 post 接收数据

6、接口默认不触发相关的交易状态数据通知