本文整理汇总了PHP中kernel::openapi_url方法的典型用法代码示例。如果您正苦于以下问题:PHP kernel::openapi_url方法的具体用法?PHP kernel::openapi_url怎么用?PHP kernel::openapi_url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kernel
的用法示例。
在下文中一共展示了kernel::openapi_url方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 构造方法
* @param null
* @return boolean
*/
public function __construct($app)
{
parent::__construct($app);
//$this->callback_url = $this->app->base_url(true)."/apps/".basename(dirname(__FILE__))."/".basename(__FILE__);
$this->notify_url = kernel::openapi_url('openapi.ectools_payment/parse/' . $this->app->app_id . '/ectools_payment_plugin_alipay_server', 'callback');
if (preg_match("/^(http):\\/\\/?([^\\/]+)/i", $this->notify_url, $matches)) {
$this->notify_url = str_replace('http://', '', $this->notify_url);
$this->notify_url = preg_replace("|/+|", "/", $this->notify_url);
$this->notify_url = "http://" . $this->notify_url;
} else {
$this->notify_url = str_replace('https://', '', $this->notify_url);
$this->notify_url = preg_replace("|/+|", "/", $this->notify_url);
$this->notify_url = "https://" . $this->notify_url;
}
$this->callback_url = kernel::openapi_url('openapi.ectools_payment/parse/' . $this->app->app_id . '/ectools_payment_plugin_alipay', 'callback');
if (preg_match("/^(http):\\/\\/?([^\\/]+)/i", $this->callback_url, $matches)) {
$this->callback_url = str_replace('http://', '', $this->callback_url);
$this->callback_url = preg_replace("|/+|", "/", $this->callback_url);
$this->callback_url = "http://" . $this->callback_url;
} else {
$this->callback_url = str_replace('https://', '', $this->callback_url);
$this->callback_url = preg_replace("|/+|", "/", $this->callback_url);
$this->callback_url = "https://" . $this->callback_url;
}
//$this->submit_url = 'https://www.alipay.com/cooperate/gateway.do?_input_charset=utf-8';
//ajx 按照相应要求请求接口网关改为一下地址
$this->submit_url = 'https://mapi.alipay.com/gateway.do?_input_charset=utf-8';
$this->submit_method = 'POST';
$this->submit_charset = 'utf-8';
}
示例2: __construct
public function __construct($app)
{
parent::__construct($app);
$this->notify_url = kernel::openapi_url('openapi.ectools_payment/parse/' . $this->app->app_id . '/ectools_payment_plugin_unionpay_server', 'callback');
if (preg_match("/^(http):\\/\\/?([^\\/]+)/i", $this->notify_url, $matches)) {
$this->notify_url = str_replace('http://', '', $this->notify_url);
$this->notify_url = preg_replace("|/+|", "/", $this->notify_url);
$this->notify_url = "http://" . $this->notify_url;
} else {
$this->notify_url = str_replace('https://', '', $this->notify_url);
$this->notify_url = preg_replace("|/+|", "/", $this->notify_url);
$this->notify_url = "https://" . $this->notify_url;
}
$this->callback_url = kernel::openapi_url('openapi.ectools_payment/parse/' . $this->app->app_id . '/ectools_payment_plugin_unionpay', 'callback');
if (preg_match("/^(http):\\/\\/?([^\\/]+)/i", $this->callback_url, $matches)) {
$this->callback_url = str_replace('http://', '', $this->callback_url);
$this->callback_url = preg_replace("|/+|", "/", $this->callback_url);
$this->callback_url = "http://" . $this->callback_url;
} else {
$this->callback_url = str_replace('https://', '', $this->callback_url);
$this->callback_url = preg_replace("|/+|", "/", $this->callback_url);
$this->callback_url = "https://" . $this->callback_url;
}
// 按照相应要求请求接口网关改为一下地址
//$this->submit_url = 'https://www.epay.lxdns.com/UpopWeb/api/Pay.action';
$this->submit_url = 'https://unionpaysecure.com/api/Pay.action';
$this->submit_method = 'POST';
$this->submit_charset = 'utf-8';
}
示例3: __construct
/**
* 构造方法
* @param null
* @return boolean
*/
public function __construct($app)
{
parent::__construct($app);
//$this->callback_url = $this->app->base_url(true)."/apps/".basename(dirname(__FILE__))."/".basename(__FILE__);
$this->notify_url = kernel::openapi_url('openapi.ectools_payment/parse/' . $this->app->app_id . '/ectools_payment_plugin_upacp', 'callback');
if (preg_match("/^(http):\\/\\/?([^\\/]+)/i", $this->notify_url, $matches)) {
$this->notify_url = str_replace('http://', '', $this->notify_url);
$this->notify_url = preg_replace("|/+|", "/", $this->notify_url);
$this->notify_url = "http://" . $this->notify_url;
} else {
$this->notify_url = str_replace('https://', '', $this->notify_url);
$this->notify_url = preg_replace("|/+|", "/", $this->notify_url);
$this->notify_url = "https://" . $this->notify_url;
}
$this->callback_url = kernel::openapi_url('openapi.ectools_payment/parse/' . $this->app->app_id . '/ectools_payment_plugin_upacp', 'callback');
if (preg_match("/^(http):\\/\\/?([^\\/]+)/i", $this->callback_url, $matches)) {
$this->callback_url = str_replace('http://', '', $this->callback_url);
$this->callback_url = preg_replace("|/+|", "/", $this->callback_url);
$this->callback_url = "http://" . $this->callback_url;
} else {
$this->callback_url = str_replace('https://', '', $this->callback_url);
$this->callback_url = preg_replace("|/+|", "/", $this->callback_url);
$this->callback_url = "https://" . $this->callback_url;
}
}
示例4: __construct
/**
* 构造方法
* @param object 传递应用的app
* @return null
*/
public function __construct($app)
{
parent::__construct($app);
$this->notify_url = kernel::openapi_url('openapi.ectools_payment/parse/' . $this->app->app_id . '/ectools_payment_plugin_paypal_server', 'callback');
if (preg_match("/^(http):\\/\\/?([^\\/]+)/i", $this->notify_url, $matches)) {
$this->notify_url = str_replace('http://', '', $this->notify_url);
$this->notify_url = preg_replace("|/+|", "/", $this->notify_url);
$this->notify_url = "http://" . $this->notify_url;
} else {
$this->notify_url = str_replace('https://', '', $this->notify_url);
$this->notify_url = preg_replace("|/+|", "/", $this->notify_url);
$this->notify_url = "https://" . $this->notify_url;
}
$this->callback_url = kernel::openapi_url('openapi.ectools_payment/parse/' . $this->app->app_id . '/ectools_payment_plugin_paypal', 'callback');
if (preg_match("/^(http):\\/\\/?([^\\/]+)/i", $this->callback_url, $matches)) {
$this->callback_url = str_replace('http://', '', $this->callback_url);
$this->callback_url = preg_replace("|/+|", "/", $this->callback_url);
$this->callback_url = "http://" . $this->callback_url;
} else {
$this->callback_url = str_replace('https://', '', $this->callback_url);
$this->callback_url = preg_replace("|/+|", "/", $this->callback_url);
$this->callback_url = "https://" . $this->callback_url;
}
$this->submit_url = 'https://www.paypal.com/cgi-bin/webscr';
// $this->submit_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; //test
$this->submit_method = 'POST';
$this->submit_charset = 'utf-8';
}
示例5: __construct
/**
* 构造方法
* @param null
* @return boolean
*/
public function __construct($app)
{
parent::__construct($app);
$this->notify_url = kernel::openapi_url('openapi.ectools_payment/parse/wap/wap_payment_plugin_mtenpay_server', 'callback');
if (preg_match("/^(http):\\/\\/?([^\\/]+)/i", $this->notify_url, $matches)) {
$this->notify_url = str_replace('http://', '', $this->notify_url);
$this->notify_url = preg_replace("|/+|", "/", $this->notify_url);
$this->notify_url = "http://" . $this->notify_url;
} else {
$this->notify_url = str_replace('https://', '', $this->notify_url);
$this->notify_url = preg_replace("|/+|", "/", $this->notify_url);
$this->notify_url = "https://" . $this->notify_url;
}
$this->callback_url = kernel::openapi_url('openapi.ectools_payment/parse/wap/wap_payment_plugin_mtenpay', 'callback');
if (preg_match("/^(http):\\/\\/?([^\\/]+)/i", $this->callback_url, $matches)) {
$this->callback_url = str_replace('http://', '', $this->callback_url);
$this->callback_url = preg_replace("|/+|", "/", $this->callback_url);
$this->callback_url = "http://" . $this->callback_url;
} else {
$this->callback_url = str_replace('https://', '', $this->callback_url);
$this->callback_url = preg_replace("|/+|", "/", $this->callback_url);
$this->callback_url = "https://" . $this->callback_url;
}
$this->submit_url = $this->gateway;
$this->submit_method = 'GET';
$this->submit_charset = $this->_input_charset;
}
示例6: column_editbutton
public function column_editbutton($row)
{
$callback_url = urlencode(kernel::openapi_url('openapi.b2c.callback.shoprelation', 'callback', array('shop_id' => $row['shop_id'])));
$api_url = kernel::base_url(1) . kernel::url_prefix() . '/api';
$obj_user = kernel::single('desktop_user');
$user_id = $obj_user->user_data['user_id'];
$user_name = $obj_user->user_data['name'];
$api_v = $this->app->getConf("api.local.version");
$str_operation = "";
if ($row['status'] == 'unbind') {
$str_operation = '<a href="index.php?app=b2c&ctl=admin_shoprelation&act=showEdit&p[0]=' . $row['shop_id'] . '" target="_blank">' . app::get('b2c')->_('编辑') . '</a>';
if ($str_operation) {
$str_operation .= ' <a href="javascript:void(0);" onclick="new Request({evalScripts:true,url:\'index.php?ctl=shoprelation&act=index&p[0]=apply&p[1]=' . $this->app->app_id . '&p[2]=' . $callback_url . '&p[3]=' . $api_url . '&p[4]=' . $user_id . '&p[5]=' . $user_name . '&p[6]=' . $api_v . '\'}).get();">' . app::get('b2c')->_('申请绑定') . '</a>';
} else {
$str_operation .= '<a href="javascript:void(0);" onclick="new Request({evalScripts:true,url:\'index.php?ctl=shoprelation&act=index&p[0]=apply&p[1]=' . $this->app->app_id . '&p[2]=' . $callback_url . '&p[3]=' . $api_url . '&p[4]=' . $user_id . '&p[5]=' . $user_name . '&p[6]=' . $api_v . '\'}).get();">' . app::get('b2c')->_('申请绑定') . '</a>';
}
} else {
$str_operation = '';
if ($str_operation) {
$str_operation .= ' <a href="javascript:void(0);" onclick="new Request({evalScripts:true,url:\'index.php?ctl=shoprelation&act=index&p[0]=accept&p[1]=' . $this->app->app_id . '&p[2]=' . $callback_url . '&p[3]=' . $api_url . '&p[4]=' . $user_id . '&p[5]=' . $user_name . '&p[6]=' . $api_v . '\'}).get();">' . app::get('b2c')->_('解除绑定') . '</a>';
} else {
$str_operation .= '<a href="javascript:void(0);" onclick="new Request({evalScripts:true,url:\'index.php?ctl=shoprelation&act=index&p[0]=accept&p[1]=' . $this->app->app_id . '&p[2]=' . $callback_url . '&p[3]=' . $api_url . '&p[4]=' . $user_id . '&p[5]=' . $user_name . '&p[6]=' . $api_v . '\'}).get();">' . app::get('b2c')->_('解除绑定') . '</a>';
}
}
return $str_operation;
}
示例7: __construct
/**
* 构造方法
* @param null
* @return boolean
*/
public function __construct($app)
{
parent::__construct($app);
// $this->notify_url = kernel::openapi_url('openapi.ectools_payment/parse/weixin/weixin_payment_plugin_wxpay_server', 'callback');
$this->notify_url = kernel::base_url(1) . '/index.php/openapi/weixin/wxpay';
#test
// $this->notify_url = kernel::base_url(1).'/index.php/wap/paycenter-wxpay.html';
if (preg_match("/^(http):\\/\\/?([^\\/]+)/i", $this->notify_url, $matches)) {
$this->notify_url = str_replace('http://', '', $this->notify_url);
$this->notify_url = preg_replace("|/+|", "/", $this->notify_url);
$this->notify_url = "http://" . $this->notify_url;
} else {
$this->notify_url = str_replace('https://', '', $this->notify_url);
$this->notify_url = preg_replace("|/+|", "/", $this->notify_url);
$this->notify_url = "https://" . $this->notify_url;
}
$this->callback_url = kernel::openapi_url('openapi.ectools_payment/parse/weixin/weixin_payment_plugin_wxpay', 'callback');
if (preg_match("/^(http):\\/\\/?([^\\/]+)/i", $this->callback_url, $matches)) {
$this->callback_url = str_replace('http://', '', $this->callback_url);
$this->callback_url = preg_replace("|/+|", "/", $this->callback_url);
$this->callback_url = "http://" . $this->callback_url;
} else {
$this->callback_url = str_replace('https://', '', $this->callback_url);
$this->callback_url = preg_replace("|/+|", "/", $this->callback_url);
$this->callback_url = "https://" . $this->callback_url;
}
// $this->submit_url = $this->gateway;
// $this->submit_method = 'GET';
$this->submit_charset = 'UTF-8';
$this->signtype = 'sha1';
}
示例8: serverCallback
public function serverCallback()
{
$servercallback_url = kernel::openapi_url('openapi.ectools_payment/parse/' . $this->app->app_id . '/ecstoreappabcwap_payment_plugin_ecstoreappabcwap', 'callback');
$httpclient = kernel::single('base_httpclient');
$httpclient->timeout = 30;
$result = $httpclient->post($servercallback_url, $_POST);
exit;
}
示例9: runtask
function runtask($task_id)
{
$http = new base_httpclient();
$_POST['task_id'] = $task_id;
$url = kernel::openapi_url('openapi.queue', 'worker', array('task_id' => $task_id));
logger::info('Spawn [Task-' . $task_id . '] ' . $url);
//99%概率不会有问题
$http->hostaddr = $_SERVER["SERVER_ADDR"] ? $_SERVER["SERVER_ADDR"] : '127.0.0.1';
$http->hostport = $_SERVER["SERVER_PORT"] ? $_SERVER["SERVER_PORT"] : '80';
$http->set_timeout(2);
logger::info($http->post($url, $_POST));
}
示例10: index
function index()
{
$callback_url = '';
$callback = urlencode(kernel::openapi_url('openapi.b2c.callback.shoprelation', 'callback'));
$api_url = kernel::base_url(1) . kernel::url_prefix() . '/api';
$ceti_id = base_certificate::get('certificate_id');
$node_id = base_shopnode::node_id($this->app->app_id);
$obj_user = kernel::single('desktop_user');
$user_id = $obj_user->user_data['user_id'];
$user_name = $obj_user->user_data['name'];
$api_v = $this->app->getConf("api.local.version");
$this->finder('b2c_mdl_shop', array('title' => app::get('b2c')->_('数据互联') . app::get('b2c')->_('证书:') . $ceti_id . ', ' . app::get('b2c')->_('节点:') . $node_id, 'actions' => array(array('label' => app::get('b2c')->_('新建绑定关系'), 'icon' => 'add.gif', 'href' => 'index.php?app=b2c&ctl=admin_shoprelation&act=addnew', 'target' => '_blank'), array('label' => app::get('b2c')->_('查看绑定情况'), 'icon' => 'add.gif', 'onclick' => 'new Request({evalScripts:true,url:\'index.php?ctl=shoprelation&act=index&p[0]=accept&p[1]=' . $this->app->app_id . '&p[2]=' . $callback . '&p[3]=' . $api_url . '&p[4]=' . $user_id . '&p[5]=' . $user_name . '&p[6]=' . $api_v . '\'}).get()'))));
}
示例11: wxpay
function wxpay()
{
$postData = array();
$httpclient = kernel::single('base_httpclient');
$callback_url = kernel::openapi_url('openapi.ectools_payment/parse/weixin/weixin_payment_plugin_wxpay', 'callback');
$postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
$postArray = kernel::single('site_utility_xml')->xml2array($postStr);
$postData['weixin_postdata'] = $postArray['xml'];
$nodify_data = array_merge($_GET, $postData);
$response = $httpclient->post($callback_url, $nodify_data);
echo 'success';
exit;
}
示例12: __construct
public function __construct($app)
{
$this->my_url = kernel::openapi_url('openapi.trustlogin_api/parse/' . $this->app->app_id . '/trustlogin_plugin_alipay', 'callback');
if (preg_match("/^(http):\\/\\/?([^\\/]+)/i", $this->my_url, $matches)) {
$this->my_url = str_replace('http://', '', $this->my_url);
$this->my_url = preg_replace("|/+|", "/", $this->my_url);
$this->my_url = "http://" . $this->my_url;
} else {
$this->my_url = str_replace('https://', '', $this->my_url);
$this->my_url = preg_replace("|/+|", "/", $this->my_url);
$this->my_url = "https://" . $this->my_url;
}
$this->app = $app;
$this->obj_session = kernel::single('base_session');
$this->obj_session->start();
}
示例13: __construct
/**
* 构造方法
* @param object 传递应用的app
* @return null
*/
public function __construct($app)
{
parent::__construct($app);
//$this->callback_url = $this->app->base_url(true)."/apps/".basename(dirname(__FILE__))."/".basename(__FILE__);
$this->callback_url = kernel::openapi_url('openapi.ectools_payment/parse/' . $this->app->app_id . '/ectools_payment_plugin_tenpay', 'callback');
if (preg_match("/^(http):\\/\\/?([^\\/]+)/i", $this->callback_url, $matches)) {
$this->callback_url = str_replace('http://', '', $this->callback_url);
$this->callback_url = preg_replace("|/+|", "/", $this->callback_url);
$this->callback_url = "http://" . $this->callback_url;
} else {
$this->callback_url = str_replace('https://', '', $this->callback_url);
$this->callback_url = preg_replace("|/+|", "/", $this->callback_url);
$this->callback_url = "https://" . $this->callback_url;
}
$this->submit_url = 'https://www.tenpay.com/cgi-bin/v1.0/pay_gate.cgi';
$this->submit_method = 'POST';
$this->submit_charset = 'gb2312';
}
示例14: wxpayjsapi
public function wxpayjsapi()
{
// 新微信支付回调地址
$postData = array();
$httpclient = kernel::single('base_httpclient');
$callback_url = kernel::openapi_url('openapi.ectools_payment/parse/ectools_payment_plugin_wxpayjsapi', 'callback');
$postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
logger::info('wxpayjsapi data, xml to array :' . var_export($postStr, 1));
$postArray = kernel::single('site_utility_xml')->xml2array($postStr);
$postData['weixin_postdata'] = $postArray['xml'];
$nodify_data = array_merge(input::get(), $postData);
$response = $httpclient->post($callback_url, $nodify_data);
// if($notify->checkSign() == FALSE){
// $arr = array('return_code'=>'FAIL','return_msg'=>'签名失败');
// }else{
// $arr = array('return_code'=>'SUCCESS');
// }
// $returnXml = $notify->returnXml();
// echo $returnXml;exit;
}
示例15: call
public function call($method, $params, $rpc_id = null, $gzip = false)
{
if (is_null($rpc_id)) {
$rpc_id = $this->begin_transaction($method, $params);
} else {
$rpc_id = $this->begin_transaction($method, $params, $rpc_id);
}
$obj_rpc_poll = app::get('base')->model('rpcpoll');
$headers = array('Connection' => 'Close');
if ($gzip) {
$headers['Content-Encoding'] = 'gzip';
}
$query_params = array('app_id' => 'ecos.' . $this->app->app_id, 'method' => $method, 'date' => date('Y-m-d H:i:s'), 'callback_url' => kernel::openapi_url('openapi.rpc_callback', 'async_result_handler', array('id' => $rpc_id, 'app_id' => $this->app->app_id)), 'format' => 'json', 'certi_id' => base_certificate::certi_id(), 'v' => $this->api_version($method), 'from_node_id' => base_shopnode::node_id($this->app->app_id));
// rpc_id 分id 和 calltime
$arr_rpc_key = explode('-', $rpc_id);
$rpc_id = $arr_rpc_key[0];
$rpc_calltime = $arr_rpc_key[1];
$query_params['task'] = $rpc_id;
$query_params = array_merge((array) $params, $query_params);
if (!base_shopnode::token($this->app->app_id)) {
$query_params['sign'] = base_certificate::gen_sign($query_params);
} else {
$query_params['sign'] = base_shopnode::gen_sign($query_params, $this->app->app_id);
}
$url = $this->get_url($this->network_id);
$core_http = kernel::single('base_httpclient');
$response = $core_http->set_timeout($this->timeout)->post($url, $query_params, $headers);
kernel::log('Response: ' . $response);
if ($this->callback_class && method_exists(kernel::single($this->callback_class), 'response_log')) {
$response_log_func = 'response_log';
$callback_params = $this->callback_params ? array_merge($this->callback_params, array('rpc_key' => $rpc_id . '-' . $rpc_calltime)) : array('rpc_key' => $rpc_id . '-' . $rpc_calltime);
kernel::single($this->callback_class)->{$response_log_func}($response, $callback_params);
}
if ($response === HTTP_TIME_OUT) {
$headers = $core_http->responseHeader;
kernel::log('Request timeout, process-id is ' . $headers['process-id']);
$obj_rpc_poll->update(array('process_id' => $headers['process-id']), array('id' => $rpc_id, 'calltime' => $rpc_calltime, 'type' => 'request'));
$this->status = RPC_RST_RUNNING;
return false;
} else {
$result = json_decode($response);
if ($result) {
$this->error = $response->error;
switch ($result->rsp) {
case 'running':
$this->status = RPC_RST_RUNNING;
// 存入中心给的process-id也就是msg-id
$obj_rpc_poll->update(array('process_id' => $result->msg_id), array('id' => $rpc_id, 'type' => 'request', 'calltime' => $rpc_calltime));
return true;
case 'succ':
//$obj_rpc_poll->delete(array('id'=>$rpc_id,'calltime'=>$rpc_calltime,'type'=>'request','fail_times'=>1));
$obj_rpc_poll->delete(array('id' => $rpc_id, 'calltime' => $rpc_calltime, 'type' => 'request', 'fail_times' => 1));
$this->status = RPC_RST_FINISH;
$method = $this->callback_method;
if ($method && $this->callback_class) {
kernel::single($this->callback_class)->{$method}($result->data);
}
$this->rpc_response = $response;
return $result->data;
case 'fail':
$this->error = 'Bad response';
$this->status = RPC_RST_ERROR;
$this->rpc_response = $response;
return false;
}
} else {
//error 解码失败
}
}
}