<?php
/**
* Default values for the WooCommerce Gratify Pay Plugin Admin Form Fields
*/

$environments = include 'environments.php';
$colorthemes = include 'colorthemes.php';
$badge_url = "https://assets.gratifypay.com/img/gratify-badge-charcoal.svg";
$logo_url = plugin_dir_url(dirname(__DIR__)) . 'assets/img/gratify-tag.svg';
# Process Region-based Assets
$region_assets = include 'assets.php';

$ctg_page_asset 		= 	$region_assets['category_page'];
$product_page_asset		= 	$region_assets['product_page'];
$product_variant_asset 	= 	$region_assets['product_variant'];
$cart_page_asset 		= 	$region_assets['cart_page'];

return array(

	'start' => array(
		'title'				=> __( 'start', 'gratify-pay' ),
		'type'				=> 'hidden',
		'label'				=> __( 'Enable Gratify BNPL', 'gratify-pay' ),
		'default'			=> ''
	),
	'enabled' => array(
		'title'				=> __( 'Enable/Disable', 'gratify-pay' ),
		'type'				=> 'checkbox',
		'label'				=> __( 'Enable Gratify BNPL', 'gratify-pay' ),
		'default'			=> 'yes'
	),

	'testmode' => array(
		'title'				=> __( 'API Environment', 'gratify-pay' ),
		'type'				=> 'select',
		'options'			=> wp_list_pluck( $environments, 'name' ),
		'default'			=> 'production',
		'description'		=> __( 'Note: Sandbox and Production API credentials are not interchangeable.', 'gratify-pay' )
	),
	'prod-id' => array(
		'title'				=> __( 'Merchant ID (Production)', 'gratify-pay' ),
		'type'				=> 'text',
		'default'			=> '',
		'custom_attributes' => array(
					'data-show-if' => array(
						'testmode' => 'production'
					)
				)
		
	),
	'prod-secret-key' => array(
		'title'				=> __( 'Secret Key (Production)', 'gratify-pay' ),
		'type'				=> 'password',
		'default'			=> '',
		'custom_attributes' => array(
					'data-show-if' => array(
						'testmode' => 'production'
					)
				)
	),
	'test-id' => array(
		'title'				=> __( 'Merchant ID (Sandbox)', 'gratify-pay' ),
		'type'				=> 'text',
		'default'			=> '',
		'custom_attributes' => array(
					'data-show-if' => array(
						'testmode' => 'sandbox'
					)
				)
	),
	'test-secret-key' => array(
		'title'				=> __( 'Secret Key (Sandbox)', 'gratify-pay' ),
		'type'				=> 'password',
		'default'			=> '',
		'custom_attributes' => array(
					'data-show-if' => array(
						'testmode' => 'sandbox'
					)
				)
	),
	'first-end' => array(
		'title'				=> __( 'first-end', 'gratify-pay' ),
		'type'				=> 'hidden',
		'label'				=> __( 'Enable Gratify Pay', 'gratify-pay' ),
		'default'			=> ''
	),
	'pay-over-time-limit-min' => array(
		'title'				=> __( 'Minimum Payment Amount', 'gratify-pay' ),
		'type'				=> 'hidden',
		'description'		=> __( 'This information is supplied by Gratify Pay and cannot be edited.', 'gratify-pay' ),
		'custom_attributes'	=>	array(
									'readonly' => 'true'
								),
		'default'			=> '-1'
	),
	'pay-over-time-limit-max' => array(
		'title'				=> __( 'Maximum Payment Amount', 'gratify-pay' ),
		'type'				=> 'hidden',
		'description'		=> __( 'This information is supplied by Gratify Pay and cannot be edited.', 'gratify-pay' ),
		'custom_attributes'	=>	array(
									'readonly' => 'true'
								),
		'default'			=> '-1'
	),
	'payment-period' => array(
		'title'				=> __( 'Payment Period (Weeks)', 'gratify-pay' ),
		'type'				=> 'hidden',
		'description'		=> __( 'This information is supplied by Gratify Pay and cannot be edited.', 'gratify-pay' ),
		'custom_attributes'	=>	array(
									'readonly' => 'true'
								),
		'default'			=> '-1'
	),
	'num-payments' => array(
		'title'				=> __( 'Number of Payments', 'gratify-pay' ),
		'type'				=> 'hidden',
		'description'		=> __( 'This information is supplied by Gratify Pay and cannot be edited.', 'gratify-pay' ),
		'custom_attributes'	=>	array(
									'readonly' => 'true'
								),
		'default'			=> '-1'
	),
	'merchant-status' => array(
		'title'				=> __( 'Merchant Status', 'gratify-pay' ),
		'type'				=> 'hidden',
		'description'		=> __( 'This information is supplied by Gratify Pay and cannot be edited.', 'gratify-pay' ),
		'custom_attributes'	=>	array(
									'readonly' => 'true'
								),
		'default'			=> 'NOT CONNECTED'
	),
	'theme' => array(
		'title'				=> __( 'Theme', 'gratify-pay' ),
		'type'				=> 'hidden',
		'description'		=> __( 'The theme for the Gratify Pay placement.', 'gratify-pay' ),
		'custom_attributes'	=>	array(
									'readonly' => 'true'
								),
		'default'			=> 'Blue'
	),
	'title' => array(
		'title'				=> __( 'Title', 'gratify-pay' ),
		'type'				=> 'text',
		'description'		=> __( 'This controls the payment method title which the user sees during checkout.', 'gratify-pay' ),
		'default'			=> __( 'Gratify BNPL', 'gratify-pay' )
	),
	"colortheme" => array(
		'title'				=> __( 'Theme', 'gratify-pay' ),
		'type'				=> 'select',
		'description'		=> __( 'The color theme for the Gratify Pay placement.', 'gratify-pay' ),
		'options'			=> wp_list_pluck( $colorthemes, 'name' ),
		'default'			=> 'blue'
	),
	'presentational-customisation-title' => array(
		'title'				=> __( 'Customisation', 'gratify-pay' ),
		'type'				=> 'hidden',
		'description'		=> __( "<h4>Use the following constants to customise the Gratify Pay placement.</h4><br/>
									<table>
									<tr><th>Symbol</th><th>Description</th></tr>
									<tr><td>[AMOUNT]</td><td>The amount to be paid for an instalment.</td></tr>
									<tr><td>[GRATIFY_BADGE]</td><td><img style='display:inline-block;vertical-align:middle;' src={$logo_url} width='45' height='30' alt='Gratify Pay' /></td></tr>
									<tr><td>[NUM_PAYMENTS]</td><td>The number of payments.</td></tr>
									<tr><td>[PAYMENT_PERIOD]</td><td>Payment Period based on your settings.</td></tr>
									<tr><td>[MIN_LIMIT]</td><td>Minimum amount for BNPL with Gratify Pay.</td></tr>
									<tr><td>[MAX_LIMIT]</td><td>Maximum amount for BNPL with Gratify Pay.</td></tr>
									</table>
									", 'gratify-pay' )
	),
	'show-info-on-category-pages' => array(
		'title'				=> __( 'Payment Info on Category Pages', 'gratify-pay' ),
		'label'				=> __( 'Enable', 'gratify-pay' ),
		'type'				=> 'checkbox',
		'description'		=> __( 'Enable to display Gratify Pay elements on category pages', 'gratify-pay' ),
		'default'			=> 'yes'
	),
	'category-pages-info-text' => array(
		'type'				=> 'textarea',
		'default'			=> '<span class="shadow-lg" style="background:#f5f6f7;padding:8px;border-radius: 5px;color:#3c4257;font-size: 13px; display: inline-block; height:45px;margin-top: 10px;">or [NUM_PAYMENTS] interest-free instalments of <b><strong>[AMOUNT]</strong></b> by [GRATIFY_BADGE]</span>',
		'description'		=> __( "[AMOUNT] : Instalment amount | [NUM_PAYMENTS] : Number of instalments | [PAYMENT_PERIOD] : Payment period for each instalment | [GRATIFY_BADGE] : <img class='inline-block' src={$badge_url}  style='border:none;display: inline-block;margin-top:-2px;' width='70' />", 'gratify-pay' )
	),
	'category-pages-hook' => array(
		'type'				=> 'hidden',
		'placeholder'		=> 'Enter hook name (e.g. woocommerce_after_shop_loop_item_title)',
		'default'			=> 'woocommerce_after_shop_loop_item_title',
		'description'		=> __( 'Set the hook to be used for Payment Info on Category Pages.', 'gratify-pay' )
	),
	'category-pages-priority' => array(
		'type'				=> 'hidden',
		'placeholder'		=> 'Enter a priority number',
		'default'			=> 99,
		'description'		=> __( 'Set the hook priority to be used for Payment Info on Category Pages.', 'gratify-pay' )
	),
	'show-info-on-product-pages' => array(
		'title'				=> __( 'Payment Info on Individual Product Pages', 'gratify-pay' ),
		'label'				=> __( 'Enable', 'gratify-pay' ),
		'type'				=> 'checkbox',
		'description'		=> __( 'Enable to display Gratify Pay elements on individual product pages', 'gratify-pay' ),
		'default'			=> 'yes'
	),
	'product-pages-info-text' => array(
		'type'				=> 'textarea',
		'default'			=> '<span class="shadow-lg" style="background:#f5f6f7;padding:8px;border-radius: 5px;color:#3c4257;font-size: 13px; display: inline-block; height:45px;margin-top: 10px;">or [NUM_PAYMENTS] interest-free instalments of <b><strong>[AMOUNT]</strong></b> by [GRATIFY_BADGE]</span>',
		'description'		=> __( "[AMOUNT] : Instalment amount | [NUM_PAYMENTS] : Number of instalments | [PAYMENT_PERIOD] : Payment period for each instalment | [GRATIFY_BADGE] : <img class='inline-block' src={$badge_url} style='border:none;display:inline-block;margin-top:-2px;' width='70' />", 'gratify-pay' )
	),
	'product-pages-hook' => array(
		'type'				=> 'hidden',
		'placeholder'		=> 'Enter hook name (e.g. woocommerce_single_product_summary)',
		'default'			=> 'woocommerce_single_product_summary',
		'description'		=> __( 'Set the hook to be used for Payment Info on Individual Product Pages.', 'gratify-pay' )
	),
	'product-pages-priority' => array(
		'type'				=> 'hidden',
		'placeholder'		=> 'Enter a priority number',
		'default'			=> 15,
		'description'		=> __( 'Set the hook priority to be used for Payment Info on Individual Product Pages.', 'gratify-pay' )
	),
	'product-pages-shortcode' => array(
		'type'				=> 'hidden',
		'description'		=> __( '<h3 class="wc-settings-sub-title">Page Builders</h3> If you use a page builder plugin, the above payment info can be placed using a shortcode instead of relying on hooks. Use [gratify_pay_paragraph] within a product page, or include the product ID to display the info for a specific product on any custom page. E.g.: [gratify_pay_paragraph id="99"]', 'gratify-pay' )
	),
	'show-info-on-product-variant' => array(
		'title'				=> __( 'Payment Info Display for Product Variant', 'gratify-pay' ),
		'label'				=> __( 'Enable', 'gratify-pay' ),
		'type'				=> 'checkbox',
		'description'		=> __( 'Enable to display Gratify Pay elements upon product variant selection', 'gratify-pay' ),
		'default'			=> 'no'
	),
	'product-variant-info-text' => array(
		'type'				=> 'textarea',
		'default'			=> '<span class="shadow-lg" style="background:#f5f6f7;padding:8px;border-radius: 5px;color:#3c4257;font-size: 13px; display: inline-block; height:45px;margin-top: 10px;">or [NUM_PAYMENTS] interest-free instalments of <b><strong>[AMOUNT]</strong></b> by [GRATIFY_BADGE]</span>',
		'description'		=> __( "[AMOUNT] : Instalment amount | [NUM_PAYMENTS] : Number of instalments | [PAYMENT_PERIOD] : Payment period for each instalment | [GRATIFY_BADGE] : <img class='inline-block' src={$badge_url} style='border:none;display: inline-block;margin-top:-2px;' width='70' />", 'gratify-pay' )
	),
	'show-outside-limit-on-product-page' => array(
		'title'				=> __( 'Outside Payment Limit Info on Product Page', 'gratify-pay' ),
		'label'				=> __( 'Enable', 'gratify-pay' ),
		'type'				=> 'hidden',
		'description'		=> __( 'Enable to display Outside Payment Limits Text on the product page', 'gratify-pay' ),
		'default'			=> 'yes'
	),
	'show-info-on-cart-page' => array(
		'title'				=> __( 'Payment Info on Cart Page', 'gratify-pay' ),
		'label'				=> __( '<span style="visibility:hidden;" class="hidden"> &nbsp; </span>', 'gratify-pay' ),
		'type'				=> 'checkbox',
		'description'		=> __( 'Enable to display Gratify Pay elements on the cart page', 'gratify-pay' ),
		'default'			=> 'yes',
		"css"=> "visibility:hidden;",
		"disabled" 			=> true
	),
	'cart-page-info-text' => array(
		'type'				=> 'textarea',
		'default'			=> '<span class="shadow-lg" style="background:#f5f6f7;padding:8px;border-radius: 5px;color:#3c4257;font-size: 13px; display: inline-block; height:45px;margin-top: 10px;">or [NUM_PAYMENTS] interest-free instalments of <b><strong>[AMOUNT]</strong></b> by [GRATIFY_BADGE]</span>',
		'description'		=> __( "[AMOUNT] : Instalment amount | [NUM_PAYMENTS] : Number of instalments | [PAYMENT_PERIOD] : Payment period for each instalment | [GRATIFY_BADGE] : <img class='inline-block' src={$badge_url} style='border:none;display: inline-block;margin-top:-2px;' width='70' />", 'gratify-pay' )
	),
	'gratify_pay-checkout-experience' => array(
		'type'				=> 'hidden',
		'default'			=> 'redirect',
	),
	'second-end' => array(
		'title'				=> __( 'second-end', 'gratify-pay' ),
		'type'				=> 'hidden',
		'label'				=> __( 'Gratify Pay', 'gratify-pay' ),
		'default'			=> ''
	),
	'store-auth-username' => array(
		'title'				=> __( 'HTTP Auth Username', 'gratify-pay' ),
		'type'				=> 'text',
		'label'				=> __( 'Store HTTP Auth', 'gratify-pay' ),
		'default'			=> ''
	),
	'store-auth-password' => array(
		'title'				=> __( 'HTTP Auth Password', 'gratify-pay' ),
		'type'				=> 'password',
		'label'				=> __( 'Store HTTP Auth', 'gratify-pay' ),
		'default'			=> ''
	),
	'end' => array(
		'title'				=> __( 'end', 'gratify-pay' ),
		'type'				=> 'hidden',
		'label'				=> __( 'Enable Gratify Pay', 'gratify-pay' ),
		'default'			=> ''
	),
);


