sign($params); if ($params['sign'] == $sign) { return true; } else { return false; } } private function sign($params) { $key = config::APP_KEY; $content = "{$params['username']}{$params['orderNumber']}{$params['number']}{$params['money']}[{$params['status']}]{$params['endTime']}$key"; return md5($content); } public function notify($params) { $status = intval($params['status']); $order_sn = $params['orderNumber']; $order_info = Model('vr_order')->getOrderInfoForNotify(['order_sn' => $order_sn]); if (empty($order_info)) { return [false, false, false, false, '']; } $order_id = $order_info['order_id']; if ($status === 5) { $official_sn = config::extract_official_sn($params['voucher']); Model('refill_order')->edit($order_id, ['official_sn' => $official_sn]); return [$order_id, true, false, true, '']; } elseif ($status === 6) { return [$order_id, false, true, true, '']; } else { return [$order_id, false, false, false, '']; } } }