sign($params); if ($params['sign'] == $sign) { return true; } else { return false; } } private function sign($params) { $signature = [config::KEY, $params['timestamp'], config::ACCOUNT]; sort($signature, SORT_STRING); $signature = implode($signature); return sha1($signature); } public function notify($params) { $status = $params['status']; $order_sn = $params['consumerNo']; $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 === '001') { $data['official_sn'] = strtolower($params['voucherNo']) == 'null' ? '' : $params['voucherNo']; Model('refill_order')->edit($order_id, $data); return [$order_id, true, false, true]; } elseif (in_array($status,config::NotifyErrCodes, true)) { return [$order_id, false, true, true]; } else { return [$order_id, false, false, false]; } } }