本文整理匯總了PHP中AlipaySubmit::query_timestamp方法的典型用法代碼示例。如果您正苦於以下問題:PHP AlipaySubmit::query_timestamp方法的具體用法?PHP AlipaySubmit::query_timestamp怎麽用?PHP AlipaySubmit::query_timestamp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類AlipaySubmit
的用法示例。
在下文中一共展示了AlipaySubmit::query_timestamp方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: creditpay
private function creditpay ($order, $good, $orderPrice, $bank)
{
$alipay_config = $this->payConfig();
$payment_type = 1;
$notify_url = "http://www.51linpai.com/order/payed";
//頁麵跳轉同步通知頁麵路徑
$return_url = "http://www.51linpai.com/order/payed";
if ($this->debug) {
$return_url = "http://www.51linpai.com:8000/order/payed";
} else {
$return_url = "http://www.51linpai.com/order/payed";
}
//商戶網站訂單係統中唯一訂單號
$out_trade_no = $order->code;
//訂單名稱
$subject = $good->name . ' * ' . $order->num;
//訂單金額
$total_fee = 0.1;// $orderPrice->final_price;
//訂單描述
$body = '測試訂單描述';
//商品展示地址
$show_url = "http://www.51linpai.com/goods?gid={$good->id}";
//支付方式
$paymethod = "bankPay";
//默認網銀
$defaultbank = $bank;
//客戶端ip地址
$exter_invoke_ip = $_SERVER['REMOTE_ADDR'];
$parameter = array(
"service" => "create_direct_pay_by_user",
"partner" => trim($alipay_config['partner']),
"seller_email" => trim($alipay_config['seller_email']),
"payment_type" => $payment_type,
"notify_url" => $notify_url,
"return_url" => $return_url,
"out_trade_no" => $out_trade_no,
"subject" => $subject,
"total_fee" => $total_fee,
"body" => $body,
"show_url" => $show_url,
"paymethod" => $paymethod,
"defaultbank" => $defaultbank,
"exter_invoke_ip" => $exter_invoke_ip,
"_input_charset" => trim(strtolower($alipay_config['input_charset']))
);
$alipaySubmit = new \AlipaySubmit($alipay_config);
$parameter['anti_phishing_key'] = $alipaySubmit->query_timestamp();
$html_text = $alipaySubmit->buildRequestForm($parameter,"get", "<h2>正在跳轉到支付頁麵...</h2>");
return $html_text;
}
示例2: array
$return_url = $livsnsurl . "/livsns/api/payments/payments/return_url.php";
//需http://格式的完整路徑,不能加?id=123這類自定義參數,不能寫成http://localhost/
//賣家支付寶帳戶
$seller_email = $WIDseller_email;
//必填
//商戶訂單號
$out_trade_no = $WIDout_trade_no;
//商戶網站訂單係統中唯一訂單號,必填
//訂單名稱
$subject = $WIDsubject;
//必填
//付款金額
$total_fee = $WIDtotal_fee;
//必填
//訂單描述
$body = $WIDbody;
//商品展示地址
$show_url = $WIDshow_url;
//需以http://開頭的完整路徑,例如:http://www.xxx.com/myorder.html
//防釣魚時間戳
$anti_phishing_key = $alipaySubmit->query_timestamp();
//若要使用請調用類文件submit中的query_timestamp函數
//客戶端的IP地址
$exter_invoke_ip = $exter_invoke_ip;
//非局域網的外網IP地址,如:221.0.0.1
/************************************************************/
//構造要請求的參數數組,無需改動
$parameter = array("service" => "create_direct_pay_by_user", "partner" => trim($alipay_config['partner']), "payment_type" => $payment_type, "notify_url" => $notify_url, "return_url" => $return_url, "seller_email" => $seller_email, "out_trade_no" => $out_trade_no, "subject" => $subject, "total_fee" => $total_fee, "body" => $body, "show_url" => $show_url, "anti_phishing_key" => $anti_phishing_key, "exter_invoke_ip" => $exter_invoke_ip, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
//建立請求
$html_text = $alipaySubmit->buildRequestForm($parameter, "get", "確認");
echo $html_text;