OpenCart 🇺🇦

Схема

public mixed callback ( )

Аргументы

Аргумент Возможный тип Описание
У метода нет аргументов

Описание

Метод пока еще не документирован.

Исходный код

//Transaction_Approved
$details =& $this->request->post;

// Ensure our hashes are in the same case
$calc_hash = strtolower($this->calculateResponseHash() );
$posted_hash = strtolower($details['x_MD5_Hash']);

$data =& $this->data;
$data['x_response_reason_text'] = $details['x_response_reason_text'];
$data['x_response_code'] = $details['x_response_code'];
$data['exact_ctr'] = $details['exact_ctr'];
$data['exact_issname'] = $details['exact_issname'];
$data['exact_issconf'] = $details['exact_issconf'];
$data['hash_match'] = ($calc_hash == $posted_hash);
$data['order_id'] = $details['x_invoice_num'];

$data['button_confirm'] = $this->language->get('button_continue');
$data['confirm'] = $this->url->https('checkout/success');

if ($data['hash_match'] ) {
	$order_id = $data['order_id'];
	$this->load->model('checkout/order');
	$order_info = $this->model_checkout_order->getOrder($order_id);

	if ($order_info) {
		if ($data['x_response_code'] == '1') {
			$this->model_checkout_order->confirm($order_id, $this->config->get('authorizenet_sim_order_status_id'));
		} else {
			$this->model_checkout_order->confirm($order_id, $this->config->get('config_order_status_id') );
		}
	}
}

$this->document->breadcrumbs = array(); 

$this->document->breadcrumbs[] = array(
	'href'      => $this->url->http('common/home'),
	'text'      => $this->language->get('text_home'),
	'separator' => false
);


$this->document->breadcrumbs[] = array(
	'href'      => $this->url->http('checkout/cart'),
	'text'      => $this->language->get('text_basket'),
	'separator' => $this->language->get('text_separator')
);

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/authorizenet_sim_callback.tpl')) {
	$this->template = $this->config->get('config_template') . '/template/payment/authorizenet_sim_callback.tpl';
} else {
	$this->template = 'default/template/payment/authorizenet_sim_callback.tpl';
}	

$this->render();