OpenCart 🇺🇦

Схема

public mixed refund ( )

Аргументы

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

Описание

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

Исходный код

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

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

$this->data['heading_title'] = $this->language->get('heading_title');
$this->data['btn_cancel'] = $this->language->get('btn_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['btn_refund'] = $this->language->get('btn_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('text_pp_express'),
	'href'      => $this->url->link('payment/pp_express', 'token=' . $this->session->data['token'], 'SSL'),
	'separator' => ' :: '
);

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

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

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

$this->load->model('payment/pp_express');
$pp_transaction = $this->model_payment_pp_express->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_express->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_express_refund.tpl';
$this->children = array(
	'common/header',
	'common/footer'
);
$this->response->setOutput($this->render());