<?php
/**
 * Handles the BNPL Gateway settings outside the gateway class itself.
 */

namespace Flo_Checkout\Gateways\BNPL;

use Flo_Checkout\Gateways\Helpers\Abstract_Gateway_Settings;
use Flo_Checkout\Gateways\Northmill_BNPL;

/**
 * Class BNPL_Settings
 */
class BNPL_Settings extends Abstract_Gateway_Settings {

	/**
	 * Get the gateway ID.
	 *
	 * @return string The gateway ID.
	 */
	public static function get_gateway_id(): string {
		return Northmill_BNPL::get_id();
	}

	/**
	 * Get the settings fields for BNPL payment method.
	 *
	 * @return array An array of form fields settings for BNPL payment method.
	 */
	public static function get_settings_fields(): array {
		$form_fields = array();

		$form_fields['enabled']     = array(
			'title'       => __( 'Enable/Disable', 'flo-checkout-plugin' ),
			'label'       => __( 'Enable Northmill Pay later', 'flo-checkout-plugin' ),
			'type'        => 'checkbox',
			'description' => '',
			'default'     => 'no',
		);
		$form_fields['title']       = array(
			'title'       => __( 'Title', 'flo-checkout-plugin' ),
			'type'        => 'text',
			'description' => __( 'Title for payment type displayed in checkout.', 'flo-checkout-plugin' ),
			'default'     => __( 'Northmill Pay later', 'flo-checkout-plugin' ),
		);
		$form_fields['description'] = array(
			'title'       => __( 'Description', 'flo-checkout-plugin' ),
			'type'        => 'text',
			'description' => __( '(optional) Description for payment type displayed in checkout.', 'flo-checkout-plugin' ),
			'default'     => __( 'Pay securely with invoice or installment payments through Northmill.', 'flo-checkout-plugin' ),
		);
		$form_fields['api_url']     = array(
			'title' => __( 'API URL', 'flo-checkout-plugin' ),
			'type'  => 'text',
		);
		$form_fields['api_user']    = array(
			'title' => __( 'API Username', 'flo-checkout-plugin' ),
			'type'  => 'text',
		);
		$form_fields['api_pass']    = array(
			'title' => __( 'API Password', 'flo-checkout-plugin' ),
			'type'  => 'text',
		);
		$form_fields['log_enabled'] = array(
			'title'       => __( 'Debug Log', 'flo-checkout-plugin' ),
			'label'       => __( 'Enable Logging', 'flo-checkout-plugin' ),
			'description' => parent::maybe_get_log_file_link(),
			'type'        => 'checkbox',
			'default'     => 'no',
		);

		return $form_fields;
	}
}
