本文整理匯總了PHP中WxPayUnifiedOrder::SetFee_type方法的典型用法代碼示例。如果您正苦於以下問題:PHP WxPayUnifiedOrder::SetFee_type方法的具體用法?PHP WxPayUnifiedOrder::SetFee_type怎麽用?PHP WxPayUnifiedOrder::SetFee_type使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WxPayUnifiedOrder
的用法示例。
在下文中一共展示了WxPayUnifiedOrder::SetFee_type方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_pay_url
function get_pay_url($charge_type, $pay_amount, $payment_config, $subject, $order_id, $model_id = null, $obj_id = null, $service = null, $sign_type = 'MD5', $show_url = 'index.php?do=user&view=finance&op=details')
{
global $_K, $uid, $username;
$charge_type == 'order_charge' and $t = "訂單充值" or $t = "餘額充值";
$body = $t . "(from:" . $username . ")";
$notify = new NativePay();
$WxPayCfg = new WxPayCfg();
$Out_trade_no = $WxPayCfg->_mchid . date("YmdHis");
$attach = "charge-{$charge_type}-{$uid}-{$obj_id}-{$order_id}-{$model_id}-" . time();
$input = new WxPayUnifiedOrder();
$input->SetBody($body);
$input->SetDetail($body);
$input->SetAttach($attach);
$input->SetOut_trade_no($Out_trade_no);
$input->SetFee_type("CNY");
$input->SetTotal_fee($pay_amount * 100);
$input->SetTime_start(date("YmdHis"));
$input->SetTime_expire(date("YmdHis", time() + 600));
$input->SetNotify_url(BASE_WXPAY_URL . "notify.php");
$input->SetTrade_type("NATIVE");
$input->SetProduct_id($obj_id);
$result = $notify->GetPayUrl($input);
$url2 = $result["code_url"];
keke_order_class::create_order_charge('online_charge', 'wxpay', null, $obj_id, $uid, $username, $pay_amount, 'wait', '用戶充值', $Out_trade_no, null, $attach);
$baseUrl = urlencode($url2);
$data = array();
$data['url'] = BASE_WXPAY_URL . "qrcode.php?data=" . $baseUrl;
$data['out_trade_no'] = $Out_trade_no;
return $data;
}