sign($input); if ($params['sign'] == $sign) { return true; } else { return false; } } private function sign($params) { ksort($params); $str = implode('', $params); $str .= config::KEY; return strtoupper(md5($str)); } public function notify($params) { $status = $params['state']; $order_sn = $params['user_order']; $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]); if (empty($order_info)) { return [false, false, false,false]; } $order_id = $order_info['order_id']; if ($status === 'success') { $data['official_sn'] = strtolower($params['voucher']) == 'null' ? '' : $params['voucher']; Model('refill_order')->edit($order_id, $data); return [$order_id, true, false, true]; } elseif ($status === 'failed') { return [$order_id, false, true, true]; } else { return [$order_id, false, false, false]; } } }