当前位置: 首页>>代码示例>>PHP>>正文


PHP RequestHandler::setGateURL方法代码示例

本文整理汇总了PHP中RequestHandler::setGateURL方法的典型用法代码示例。如果您正苦于以下问题:PHP RequestHandler::setGateURL方法的具体用法?PHP RequestHandler::setGateURL怎么用?PHP RequestHandler::setGateURL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RequestHandler的用法示例。


在下文中一共展示了RequestHandler::setGateURL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: invite_payurl

function invite_payurl($amount, $price, &$orderid, $bank = 'DEFAULT')
{
    include_once DISCUZ_ROOT . './source/class/class_chinese.php';
    global $_G;
    $date = dgmdate(TIMESTAMP, 'YmdHis');
    $suffix = dgmdate(TIMESTAMP, 'His') . rand(1000, 9999);
    $transaction_id = DISCUZ_PARTNER . $date . $suffix;
    $orderid = dgmdate(TIMESTAMP, 'YmdHis') . random(14);
    $chinese = new Chinese(strtoupper(CHARSET), 'GBK');
    $subject = $chinese->Convert(lang('forum/misc', 'invite_forum_payment') . '_' . intval($amount) . '_' . lang('forum/misc', 'invite_forum_payment_unit') . '_(' . $_G['clientip'] . ')');
    $reqHandler = new RequestHandler();
    $reqHandler->setGateURL("https://gw.tenpay.com/gateway/pay.htm");
    $reqHandler->init();
    $reqHandler->setKey(DISCUZ_SECURITYCODE);
    $reqHandler->setParameter("partner", DISCUZ_PARTNER);
    $reqHandler->setParameter("out_trade_no", $orderid);
    $reqHandler->setParameter("total_fee", $price * 100);
    $reqHandler->setParameter("return_url", $_G['siteurl'] . 'api/trade/notify_invite.php');
    $reqHandler->setParameter("notify_url", $_G['siteurl'] . 'api/trade/notify_invite.php');
    $reqHandler->setParameter("body", $subject);
    $reqHandler->setParameter("bank_type", $bank);
    $reqHandler->setParameter("spbill_create_ip", $_G['clientip']);
    $reqHandler->setParameter("fee_type", "1");
    $reqHandler->setParameter("subject", $subject);
    $reqHandler->setParameter("sign_type", "MD5");
    $reqHandler->setParameter("service_version", "1.0");
    $reqHandler->setParameter("input_charset", "GBK");
    $reqHandler->setParameter("sign_key_index", "1");
    $reqHandler->setParameter("attach", "tenpay");
    $reqHandler->setParameter("time_start", $date);
    $reqHandler->setParameter("trade_mode", "1");
    $reqHandler->setParameter("trans_type", "1");
    $reqHandler->setParameter("agentid", DISCUZ_AGENTID);
    $reqHandler->setParameter("agent_type", "2");
    $reqUrl = $reqHandler->getRequestURL();
    return $reqUrl;
}
开发者ID:softhui,项目名称:discuz,代码行数:37,代码来源:api_tenpay.php

示例2: invite_payurl

function invite_payurl($amount, $price, &$orderid)
{
    include_once DISCUZ_ROOT . './source/class/class_chinese.php';
    global $_G;
    $date = dgmdate(TIMESTAMP, 'Ymd');
    $suffix = dgmdate(TIMESTAMP, 'His') . rand(1000, 9999);
    $transaction_id = DISCUZ_PARTNER . $date . $suffix;
    $orderid = dgmdate(TIMESTAMP, 'YmdHis') . random(14);
    if (!DISCUZ_TENPAY_DIRECT) {
        $reqHandler = new MediPayRequestHandler();
        $reqHandler->init();
        $reqHandler->setKey(DISCUZ_TENPAY_OPENTRANS_KEY);
        $encode_type = '1';
        if (strtolower(CHARSET) == 'utf-8') {
            $encode_type = '2';
        }
        $reqHandler->setParameter("chnid", DISCUZ_TENPAY_OPENTRANS_CHNID);
        $reqHandler->setParameter("encode_type", $encode_type);
        $reqHandler->setParameter("mch_desc", lang('forum/misc', 'invite_forum_payment') . '_' . intval($amount) . '_' . lang('forum/misc', 'invite_forum_payment_unit') . '_(' . $_G['clientip'] . ')');
        $reqHandler->setParameter("mch_name", lang('forum/misc', 'invite_forum_payment') . '_' . intval($amount) . '_' . lang('forum/misc', 'invite_forum_payment_unit'));
        $reqHandler->setParameter("mch_price", $price * 100);
        $reqHandler->setParameter("mch_returl", $_G['siteurl'] . 'api/trade/notify_invite.php');
        $reqHandler->setParameter("mch_type", '2');
        $reqHandler->setParameter("mch_vno", $orderid);
        $reqHandler->setParameter("need_buyerinfo", '2');
        $reqHandler->setParameter("seller", DISCUZ_TENPAY_OPENTRANS_CHNID);
        $reqHandler->setParameter("show_url", $_G['siteurl'] . 'api/trade/notify_invite.php');
        $reqHandler->setParameter("transport_desc", '');
        $reqHandler->setParameter("transport_fee", 0);
        $reqHandler->setParameter('attach', 'tenpay');
        $reqUrl = $reqHandler->getRequestURL();
        return $reqUrl;
    }
    $reqHandler = new RequestHandler();
    $reqHandler->setGateURL("https://www.tenpay.com/cgi-bin/v1.0/pay_gate.cgi");
    $reqHandler->init();
    $reqHandler->setKey(DISCUZ_SECURITYCODE);
    $reqHandler->setParameter("bargainor_id", DISCUZ_PARTNER);
    $reqHandler->setParameter("sp_billno", $orderid);
    $reqHandler->setParameter("transaction_id", $transaction_id);
    $reqHandler->setParameter("total_fee", $price * 100);
    $reqHandler->setParameter("return_url", $_G['siteurl'] . 'api/trade/notify_invite.php');
    $chinese = new Chinese(strtoupper(CHARSET), 'GBK');
    $reqHandler->setParameter("desc", $chinese->Convert(lang('forum/misc', 'invite_forum_payment') . '_' . intval($amount) . '_' . lang('forum/misc', 'invite_forum_payment_unit') . '_(' . $_G['clientip'] . ')'));
    $reqHandler->setParameter("cmdno", "1");
    $reqHandler->setParameter("date", $date);
    $reqHandler->setParameter("fee_type", "1");
    $reqHandler->setParameter("attach", "tenpay");
    $reqHandler->setParameter("bank_type", "0");
    $reqHandler->setParameter("agentid", DISCUZ_AGENTID);
    $reqHandler->setParameter("key_index", "1");
    $reqHandler->setParameter("verify_relation_flag", "1");
    $reqHandler->setParameter("ver", "3");
    $reqHandler->setParameter("spbill_create_ip", $_G['clientip']);
    $reqUrl = $reqHandler->getRequestURL();
    return $reqUrl;
}
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:57,代码来源:api_tenpay.php


注:本文中的RequestHandler::setGateURL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。