即時嘗試構建自定義支付模塊。我有80%完成了它。但即時通訊有幾個問題。opencart支付擴展回調不起作用
在回調中,如果付款成功或失敗,用戶返回網站。它顯示我爲
您找不到的頁面無法找到!您找到的頁面不能找到 。
當我嘗試直接訪問回調頁時,它給了我一個空白頁。
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
@shadyyx我打開了error_display,但沒有錯誤。我沒有看到錯誤日誌中的任何錯誤。目前爲止沒有語法錯誤。但我仍然得到空白頁面,直接訪問時沒有錯誤.. – LiveEn
你確定你允許報告所有類型的錯誤(包括通知,警告,棄用等)嗎? – shadyyx