wqy
2020-03-24 10:33:51
3297
  /**
     * 支付宝支付回调
     * @param $data
     * @return bool
     * @throws Exception
     */
    public static function alipayNotify($params){
        $aop = new \AopCertClient();

        foreach ($params as $key=>$val){
            $params[$key] = htmlspecialchars_decode($val);
        }

        $alipayCertPath = config('alipay.alipayCertPath');
        $aop->alipayrsaPublicKey = $aop->getPublicKey($alipayCertPath);
        $flag = $aop->rsaCheckV1($params, NUll, "RSA2");

        if($flag){
            if($params['trade_status'] == 'TRADE_SUCCESS'){
                $orderNo = $params['out_trade_no'];//订单编号
                $orderType = $params['passback_params'];

                $data['data']['status'] = 1;
                $data['data']['money'] = $params['total_amount'];
                $data['data']['payed_msg'] = $params['trade_status'];
                $data['data']['trade_no'] = $params['trade_no'];

              

                return true;
            }
        }
        return false;

    }