$this->load->model('payment/pp_pro_iframe');
$this->load->language('payment/pp_pro_iframe');
$paypal_order = $this->model_payment_pp_pro_iframe->getOrder($this->request->get['order_id']);
if ($paypal_order) {
$this->data['text_payment_info'] = $this->language->get('text_payment_info');
$this->data['text_capture_status'] = $this->language->get('text_capture_status');
$this->data['text_amount_auth'] = $this->language->get('text_amount_auth');
$this->data['button_void'] = $this->language->get('button_void');
$this->data['button_capture'] = $this->language->get('button_capture');
$this->data['button_reauthorise'] = $this->language->get('button_reauthorise');
$this->data['text_reauthorise'] = $this->language->get('text_reauthorise');
$this->data['text_reauthorised'] = $this->language->get('text_reauthorised');
$this->data['text_amount_captured'] = $this->language->get('text_amount_captured');
$this->data['text_amount_refunded'] = $this->language->get('text_amount_refunded');
$this->data['text_capture_amount'] = $this->language->get('text_capture_amount');
$this->data['text_complete_capture'] = $this->language->get('text_complete_capture');
$this->data['text_transactions'] = $this->language->get('text_transactions');
$this->data['text_complete'] = $this->language->get('text_complete');
$this->data['text_confirm_void'] = $this->language->get('text_confirm_void');
$this->data['error_capture_amt'] = $this->language->get('error_capture_amt');
$this->data['text_view'] = $this->language->get('text_view');
$this->data['text_refund'] = $this->language->get('text_refund');
$this->data['text_resend'] = $this->language->get('text_resend');
$this->data['column_trans_id'] = $this->language->get('column_trans_id');
$this->data['column_amount'] = $this->language->get('column_amount');
$this->data['column_type'] = $this->language->get('column_type');
$this->data['column_status'] = $this->language->get('column_status');
$this->data['column_pend_reason'] = $this->language->get('column_pend_reason');
$this->data['column_created'] = $this->language->get('column_created');
$this->data['column_action'] = $this->language->get('column_action');
$this->data['paypal_order'] = $paypal_order;
$this->data['token'] = $this->session->data['token'];
$this->data['order_id'] = $this->request->get['order_id'];
$this->data['order_id'] = $this->request->get['order_id'];
$captured = number_format($this->model_payment_pp_pro_iframe->totalCaptured($this->data['paypal_order']['paypal_iframe_order_id']), 2);
$refunded = number_format($this->model_payment_pp_pro_iframe->totalRefundedOrder($this->data['paypal_order']['paypal_iframe_order_id']), 2);
$this->data['paypal_order']['captured'] = $captured;
$this->data['paypal_order']['refunded'] = $refunded;
$this->data['paypal_order']['remaining'] = number_format($this->data['paypal_order']['total'] - $captured, 2);
$this->data['transactions'] = array();
$this->data['view_link'] = $this->url->link('payment/pp_pro_iframe/viewTransaction', 'token=' . $this->session->data['token'], 'SSL');
$this->data['refund_link'] = $this->url->link('payment/pp_pro_iframe/refund', 'token=' . $this->session->data['token'], 'SSL');
$this->data['resend_link'] = $this->url->link('payment/pp_pro_iframe/resend', 'token=' . $this->session->data['token'], 'SSL');
if ($paypal_order) {
$captured = number_format($this->model_payment_pp_pro_iframe->totalCaptured($paypal_order['paypal_iframe_order_id']), 2);
$refunded = number_format($this->model_payment_pp_pro_iframe->totalRefundedOrder($paypal_order['paypal_iframe_order_id']), 2);
$this->data['paypal_order'] = $paypal_order;
$this->data['paypal_order']['captured'] = $captured;
$this->data['paypal_order']['refunded'] = $refunded;
$this->data['paypal_order']['remaining'] = number_format($paypal_order['total'] - $captured, 2);
foreach ($paypal_order['transactions'] as $transaction) {
$this->data['transactions'][] = array(
'paypal_iframe_order_transaction_id' => $transaction['paypal_iframe_order_transaction_id'],
'transaction_id' => $transaction['transaction_id'],
'amount' => $transaction['amount'],
'created' => $transaction['created'],
'payment_type' => $transaction['payment_type'],
'payment_status' => $transaction['payment_status'],
'pending_reason' => $transaction['pending_reason'],
'view' => $this->url->link('payment/pp_pro_iframe/viewTransaction', 'token=' . $this->session->data['token'] . "&transaction_id=" . $transaction['transaction_id'] . '&order_id=' . $this->request->get['order_id'], 'SSL'),
'refund' => $this->url->link('payment/pp_pro_iframe/refund', 'token=' . $this->session->data['token'] . "&transaction_id=" . $transaction['transaction_id'] . "&order_id=" . $this->request->get['order_id'], 'SSL'),
'resend' => $this->url->link('payment/pp_pro_iframe/resend', 'token=' . $this->session->data['token'] . "&paypal_iframe_order_transaction_id=" . $transaction['paypal_iframe_order_transaction_id'], 'SSL'),
);
}
}
$this->data['reauthorise_link'] = $this->url->link('payment/pp_pro_iframe/reauthorise', 'token=' . $this->session->data['token'], 'SSL');
$this->template = 'payment/pp_pro_iframe_order.tpl';
$this->response->setOutput($this->render());
}