OpenCart 🇺🇦

Схема

public mixed refund ( )

Аргументы

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

Описание

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

Исходный код

$this->load->language('payment/pp_pro_iframe');
$this->load->model('payment/pp_pro_iframe');

$this->document->setTitle($this->language->get('text_refund'));

$this->data['heading_title'] = $this->language->get('heading_title');
$this->data['button_cancel'] = $this->language->get('button_cancel');
$this->data['entry_transaction_id'] = $this->language->get('entry_transaction_id');
$this->data['entry_full_refund'] = $this->language->get('entry_full_refund');
$this->data['entry_amount'] = $this->language->get('entry_amount');
$this->data['entry_message'] = $this->language->get('entry_message');
$this->data['button_refund'] = $this->language->get('button_refund');
$this->data['text_refund'] = $this->language->get('text_refund');

$this->data['breadcrumbs'] = array();

$this->data['breadcrumbs'][] = array(
	'text'      => $this->language->get('text_home'),
	'href'      => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'),
	'separator' => false
);

$this->data['breadcrumbs'][] = array(
	'text'      => $this->language->get('heading_title'),
	'href'      => $this->url->link('payment/pp_pro_iframe', 'token=' . $this->session->data['token'], 'SSL'),
	'separator' => ' :: '
);

$this->data['breadcrumbs'][] = array(
	'text'      => $this->language->get('text_refund'),
	'href'      => $this->url->link('payment/pp_pro_iframe/refund', 'token=' . $this->session->data['token'], 'SSL'),
	'separator' => ' :: '
);

//button actions
$this->data['action'] = $this->url->link('payment/pp_pro_iframe/doRefund', 'token=' . $this->session->data['token'], 'SSL');

if (isset($this->request->get['order_id'])) {
	$this->data['cancel'] = $this->url->link('sale/order/info', 'token=' . $this->session->data['token'] . '&order_id=' . $this->request->get['order_id'] , 'SSL');
} else {
	$this->data['cancel'] = '';
}

$this->data['transaction_id'] = $this->request->get['transaction_id'];

$pp_transaction = $this->model_payment_pp_pro_iframe->getTransaction($this->request->get['transaction_id']);

$this->data['amount_original'] = $pp_transaction['AMT'];
$this->data['currency_code'] = $pp_transaction['CURRENCYCODE'];

$refunded = number_format($this->model_payment_pp_pro_iframe->totalRefundedTransaction($this->request->get['transaction_id']), 2);

if($refunded != 0.00) {
	$this->data['refund_available'] = number_format($this->data['amount_original'] + $refunded, 2);
	$this->data['attention'] = $this->language->get('text_current_refunds').': '.$this->data['refund_available'];
} else {
	$this->data['refund_available'] = '';
	$this->data['attention'] = '';
}

$this->data['token'] = $this->session->data['token'];

if(isset($this->session->data['error'])) {
	$this->data['error'] = $this->session->data['error'];
	unset($this->session->data['error']);
} else {
	$this->data['error'] = '';
}

$this->template = 'payment/pp_pro_iframe_refund.tpl';
$this->children = array(
	'common/header',
	'common/footer'
);

$this->response->setOutput($this->render());