OpenCart 🇺🇦

Схема

public mixed orderAction ( )

Аргументы

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

Описание

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

Исходный код

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

$order_id = $this->request->get['order_id'];

$paypal_order = $this->model_payment_pp_payflow_iframe->getOrder($order_id);

if ($paypal_order) {
	$this->data['entry_capture_status'] = $this->language->get('entry_capture_status');
	$this->data['entry_captured_amount'] = $this->language->get('entry_captured_amount');
	$this->data['entry_capture'] = $this->language->get('entry_capture');
	$this->data['entry_void'] = $this->language->get('entry_void');
	$this->data['entry_transactions'] = $this->language->get('entry_transactions');
	$this->data['entry_complete_capture'] = $this->language->get('entry_complete_capture');

	$this->data['text_payment_info'] = $this->language->get('text_payment_info');
	$this->data['text_complete'] = $this->language->get('text_complete');
	$this->data['text_incomplete'] = $this->language->get('text_incomplete');
	$this->data['text_confirm_void'] = $this->language->get('text_confirm_void');

	$this->data['column_transaction_id'] = $this->language->get('column_transaction_id');
	$this->data['column_transaction_type'] = $this->language->get('column_transaction_type');
	$this->data['column_amount'] = $this->language->get('column_amount');
	$this->data['column_time'] = $this->language->get('column_time');
	$this->data['column_actions'] = $this->language->get('column_actions');

	$this->data['button_capture'] = $this->language->get('button_capture');
	$this->data['button_void'] = $this->language->get('button_void');

	$this->data['complete'] = $paypal_order['complete'];
	$this->data['order_id'] = $this->request->get['order_id'];
	$this->data['token'] = $this->request->get['token'];

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

	$transactions = $this->model_payment_pp_payflow_iframe->getTransactions($order_id);

	foreach ($transactions as $transaction) {
		$actions = array();

		switch ($transaction['transaction_type']) {
			case 'V':
				$transaction_type = $this->language->get('text_void');
				break;
			case 'S':
				$transaction_type = $this->language->get('text_sale');

				$actions[] = array(
					'title' => $this->language->get('text_refund'),
					'href' => $this->url->link('payment/pp_payflow_iframe/refund', 'transaction_reference=' . $transaction['transaction_reference'] . '&token=' . $this->session->data['token']),
				);

				break;
			case 'D':
				$transaction_type = $this->language->get('text_capture');

				$actions[] = array(
					'title' => $this->language->get('text_refund'),
					'href' => $this->url->link('payment/pp_payflow_iframe/refund', 'transaction_reference=' . $transaction['transaction_reference'] . '&token=' . $this->session->data['token']),
				);

				break;
			case 'A':
				$transaction_type = $this->language->get('text_authorise');
				break;

			case 'C':
				$transaction_type = $this->language->get('text_refund');#
				break;

			default:
				$transaction_type = '';
				break;
		}

		$this->data['transactions'][] = array(
			'transaction_reference' => $transaction['transaction_reference'],
			'transaction_type' => $transaction_type,
			'time' => $transaction['time'],
			'amount' => $transaction['amount'],
			'actions' => $actions,
		);
	}

	$this->template = 'payment/pp_payflow_iframe_order.tpl';
	$this->response->setOutput($this->render());
}