$app_id, 'devkey' => $dev_key, 'sid' => $sid, 'scode' => $scode, 'orderid' => $order_id, 'fee' => $fee, 'wishing' => $wishing, 'act_name' => $act_name, 'remark' => $remark, 'send_type' => $send_type, 'version' => 1, ); $data['sign'] = SignParameter($data, $sign_key); /// 生成签名 $result = new ResultObject(SendPost('https://api.tscce.cn/api/newpay/sendredpack', $data)); if (0 == $result->error) { if (!empty($return_url)) { $attach = GetAttachParameters(array('sid', 'scode', 'app_id', 'dev_key', 'market_key', 'order_id', 'fee', 'wishing', 'act_name', 'remark', 'silence', 'return_url', 'error_url', 'sign_key', 'attach')); if (!strstr($return_url, "?")) $return_url .= '?'; else $return_url .= '&'; foreach ($attach as $k => $v) { $return_url .= "{$k}={$v}&"; } $return_url .= "code=0"; header("Location: {$return_url}"); exit; } else { $html = ""; } } else { if (!empty($error_url)) { $attach = GetAttachParameters(array('sid', 'scode', 'app_id', 'dev_key', 'market_key', 'order_id', 'fee', 'wishing', 'act_name', 'remark', 'silence', 'return_url', 'error_url', 'sign_key', 'attach')); if (!strstr($error_url, "?")) $error_url .= '?'; else $error_url .= '&'; foreach ($attach as $k => $v) { $error_url .= "{$k}={$v}&"; } $error_url .= "code={$result->error_code}&msg={$result->msg}"; header("Location: {$error_url}"); exit; } else { $html = ""; } } /* $html = <<