[4 => 'PLM102741', 5 => 'PLM102741', 6 => 'PLM102741'], 100 => [4 => 'PLM102681', 5 => 'PLM102681', 6 => 'PLM102681'], 200 => [4 => 'PLM102742', 5 => 'PLM102742', 6 => 'PLM102742'], 300 => [4 => 'PLM104318', 5 => 'PLM104318', 6 => 'PLM104318'], 500 => [4 => 'PLM104319', 5 => 'PLM104319', 6 => 'PLM104319'], ]; public static function sign($params,$keys): string { $str = ''; foreach ($keys as $key) { if($key == 'AppKey') { $str .= config::AppKey; } elseif ($key == 'AppSecret') { $str .= config::AppSecret; } else { $val = $params[$key] ?? ''; $str .= $val; } } return strtoupper(md5($str)); } public static function gen_params($params,$keys) { $params['Sign'] =config::sign($params,$keys); $params['AppKey'] = config::AppKey; return $params; } //for 测试产品编码 // public static function sku_code($card_type, $amount) // { // return config::TestProduct; // } public static function sku_code($card_type, $amount) { if (array_key_exists($amount, self::$stStoreProducts)) { if (array_key_exists($card_type, self::$stStoreProducts[$amount])) { return self::$stStoreProducts[$amount][$card_type]; } } return false; } public static function time_stamp () : int { return intval(microtime(true) * 1000); } }