<?php
/**
 * Merchant info model.
 *
 * @package flo-checkout
 */

namespace Flo_Checkout\Gateways\Shift4_APM\Responses\Models\Payment;

use JsonSerializable;

defined( 'ABSPATH' ) || exit;

/**
 * Class Merchant_Info_Model
 */
class Merchant_Info_Model implements JsonSerializable {

	/**
	 * Gateway mid.
	 *
	 * @var string
	 */
	public string $gw_mid;

	/**
	 * Sub merchant id.
	 *
	 * @var string
	 */
	public string $sub_merchant_id;

	/**
	 * Constructor.
	 *
	 * @param array $merchant_info_data The merchant info data.
	 */
	public function __construct( array $merchant_info_data ) {
		$this->gw_mid          = $merchant_info_data['gw_mid'];
		$this->sub_merchant_id = $merchant_info_data['sub_merchant_id'];
	}

	/**
	 * {@inheritDoc}
	 */
	public function jsonSerialize(): array {
		return array(
			'gw_mid'          => $this->gw_mid,
			'sub_merchant_id' => $this->sub_merchant_id,
		);
	}
}
