HEX
Server: nginx/1.18.0
System: Linux vps-9dcdb12e 5.15.0-176-generic #186-Ubuntu SMP Fri Mar 13 11:01:42 UTC 2026 x86_64
User: ubuntu (1000)
PHP: 8.1.2-1ubuntu2.24
Disabled: exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
Upload Files
File: /var/www/goautomatic.pl/wp-content/plugins/latepoint/lib/models/transaction_refund_model.php
<?php

class OsTransactionRefundModel extends OsModel {
	public $id,
		$token,
		$transaction_id,
		$amount,
		$updated_at,
		$created_at;

	function __construct($id = false) {
		parent::__construct();
		$this->table_name = LATEPOINT_TABLE_TRANSACTION_REFUNDS;
		$this->nice_names = ['token' => __('Confirmation Number', 'latepoint')];

		if ($id) {
			$this->load_by_id($id);
		}
	}

	public function properties_to_query(): array{
		return [
			'payment_method' => __('Payment Method', 'latepoint'),
			'payment_portion' => __('Payment Portion', 'latepoint'),
			'kind' => __('Type', 'latepoint'),
		];
	}

	public function generate_data_vars(): array {
		return [
			'id' => $this->id,
			'token' => $this->token,
			'transaction_id' => $this->transaction_id,
			'amount' => OsMoneyHelper::format_price($this->amount),
		];
	}

	protected function params_to_sanitize() {
		return ['amount' => 'money'];
	}


	protected function params_to_save($role = 'admin'): array {
		$params_to_save = array('id',
			'token',
			'transaction_id',
			'amount');
		return $params_to_save;
	}


	protected function allowed_params($role = 'admin'): array {
		$allowed_params = array('id',
			'token',
			'transaction_id',
			'amount');
		return $allowed_params;
	}


	protected function properties_to_validate() :array {
		$validations = array(
			'transaction_id' => array('presence'),
			'token' => array('presence'),
		);
		return $validations;
	}
}