【发布时间】:2014-03-03 16:39:17
【问题描述】:
我正在尝试构建自定义支付模块。我已经完成了 80%。但是我有一些问题。
在回调中,当用户支付成功或失败返回站点时。它显示我为
找不到您请求的页面!您请求的页面不能 找到了。
当我尝试直接访问回调页面时,它给了我一个空白页面。
index.php?route=payment/hyperion/callback
当付款成功并返回到我的页面时(这使我无法找到该页面)。我没有在“订单”页面看到订单。支付成功不更新
下面是我的回调函数
public function callback() {
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
$order_id = $order_info['order_id'];
if ($order_info) {
$this->language->load('payment/hyper');
$this->data['title'] = sprintf($this->language->get('heading_title'), $this->config->get('config_name'));
if (!isset($this->request->server['HTTPS']) || ($this->request->server['HTTPS'] != 'on')) {
$this->data['base'] = HTTP_SERVER;
} else {
$this->data['base'] = HTTPS_SERVER;
}
$this->data['language'] = $this->language->get('code');
$this->data['direction'] = $this->language->get('direction');
$this->data['heading_title'] = sprintf($this->language->get('heading_title'), $this->config->get('config_name'));
$this->data['text_response'] = $this->language->get('text_response');
$this->data['text_success'] = $this->language->get('text_success');
$this->data['text_success_wait'] = sprintf($this->language->get('text_success_wait'), $this->url->link('checkout/success'));
$this->data['text_failure'] = $this->language->get('text_failure');
$this->data['text_failure_wait'] = sprintf($this->language->get('text_failure_wait'), $this->url->link('checkout/cart'));
if (isset($_POST['flag_msg']) && $_POST['flag_msg'] == 'Status_Success') {
$this->load->model('checkout/order');
$this->model_checkout_order->confirm($order_id, $this->config->get('config_order_status_id'));
$message = '';
if (isset($_POST['flag_msg'])) {
$message .= 'Payment Status = ' . $_POST['flag_msg'] . "\n";
}
if (isset($_POST['Response'])) {
$message .= 'Response = ' . $_POST['Response'] . "\n";
}
if (isset($_POST['Result'])) {
$message .= 'Result= ' . $_POST['Result'] . "\n";
}
$this->model_checkout_order->update($order_id, $this->config->get('hyper_order_status_id'), $message, false);
$this->data['continue'] = $this->url->link('checkout/success');
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/hyper_success.tpl')) {
$this->template = $this->config->get('config_template') . '/template/payment/hyper_success.tpl';
} else {
$this->template = 'default/template/payment/hyper_success.tpl';
}
$this->children = array(
'common/column_left',
'common/column_right',
'common/content_top',
'common/content_bottom',
'common/footer',
'common/header'
);
$this->response->setOutput($this->render());
}
else if (isset($_POST['flag_msg']) && $_POST['flag_msg'] == 'Status_Fail') {
$this->load->model('checkout/order');
$this->model_checkout_order->confirm($order_id, $this->config->get('config_order_status_id'));
$message = '';
if (isset($_POST['flag_msg'])) {
$message .= 'Payment Status = ' . $_POST['flag_msg'] . "\n";
}
if (isset($_POST['message'])) {
$message .= 'Reason= ' . $_POST['message'] . "\n";
}
$this->model_checkout_order->update($order_id, 'Failed', $message, false);
$this->data['continue'] = $this->url->link('checkout/checkout');
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/hyper_failure.tpl')) {
$this->template = $this->config->get('config_template') . '/template/payment/hyper_failure.tpl';
} else {
$this->template = 'default/template/payment/hyper_failure.tpl';
}
$this->children = array(
'common/column_left',
'common/column_right',
'common/content_top',
'common/content_bottom',
'common/footer',
'common/header'
);
$this->response->setOutput($this->render());
} else {
$this->data['continue'] = $this->url->link('checkout/cart');
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/hyper_failure.tpl')) {
$this->template = $this->config->get('config_template') . '/template/payment/hyper_failure.tpl';
} else {
$this->template = 'default/template/payment/hyper_failure.tpl';
}
$this->children = array(
'common/column_left',
'common/column_right',
'common/content_top',
'common/content_bottom',
'common/footer',
'common/header'
);
$this->response->setOutput($this->render());
}
}
}
有人可以帮我解决这个问题吗?
【问题讨论】:
-
打开
display_errors或error_log然后检查那里出了什么问题呢?尽管您提供了整个回调代码,但是要一一检查以发现您在某处缺少结束括号或分号...这甚至应该在此处发布问题之前进行检查...如果您这样做了,那么您应该提到没有错误但空白页面(表示有错误但显示错误设置为false)... -
@shadyyx 我打开了error_display,但是没有错误。我在错误日志中没有看到任何错误。到目前为止没有语法错误。但我仍然得到空白页,直接访问时没有错误..
-
您确定您已允许报告所有类型的错误(包括通知、警告、已弃用等)吗?
-
您是否尝试了一些简单的调试以确保该操作真正执行?就像
echo "Yes, I am here";就在callback函数左括号之后?