# vikbooking/trunk/admin/helpers/src/model/payment.php

VikBooking Hotel Booking Engine &amp; PMS, version trunk. 56 lines.

- Page: https://pluginprobe.com/plugins/vikbooking/trunk/code/admin/helpers/src/model/payment.php
- Raw: https://pluginprobe.com/plugins/vikbooking/trunk/raw/admin/helpers/src/model/payment.php
- Modified: 2026-04-20T22:09:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/vikbooking/trunk/code/admin/helpers/src/model/payment.php#L10-L20`.

```php
<?php
/** 
 * @package     VikBooking
 * @subpackage  core
 * @author      E4J s.r.l.
 * @copyright   Copyright (C) 2026 E4J s.r.l. All Rights Reserved.
 * @license     http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @link        https://vikwp.com
 */

// No direct access
defined('ABSPATH') or die('No script kiddies please!');

/**
 * VikBooking payment model.
 *
 * @since   1.18.8 (J) - 1.8.8 (WP)
 */
class VBOModelPayment extends VBOMvcModel
{
    /**
     * The database table name.
     * 
     * @var string
     */
    protected $tableName = '#__vikbooking_gpayments';

    /**
     * @inheritDoc
     */
    public function getItem($pk)
    {
        $item = parent::getItem($pk);

        if ($item) {
            // auto-decode parameters in array format
            $item->params = !empty($item->params) ? (array) json_decode($item->params, true) : [];
        }

        return $item;
    }

    /**
     * @inheritDoc
     */
    protected function preflight(array &$data)
    {
        if (!empty($data['params']) && is_scalar($data['params'])) {
            // make sure to encode the parameters
            $data['params'] = json_encode($data['params']);
        }

        return parent::preflight($data);
    }
}

```
