<?php
/**
 * Stripe Gateway Widget - Content Controls
 *
 * @package GGM_Commerce
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

// $this is the GGM_Commerce_Widget_Stripe_Gateway instance.

$this->start_controls_section(
	'section_info',
	array(
		'label' => __( 'Stripe Payment', 'ggm-commerce' ),
		'tab'   => \Elementor\Controls_Manager::TAB_CONTENT,
	)
);

$this->add_control(
	'info_notice',
	array(
		'type'            => \Elementor\Controls_Manager::RAW_HTML,
		'raw'             => sprintf(
			'<div style="padding: 15px; background: #f0f8ff; border-left: 4px solid #2271b1; margin: -10px -10px 10px;">
				<strong>%s</strong><br>
				%s
			</div>',
			esc_html__( 'Stripe Payment Gateway', 'ggm-commerce' ),
			esc_html__( 'This widget displays Stripe payment options. Place it on your checkout page. Configure Stripe settings in GGM Commerce → Settings → Payment.', 'ggm-commerce' )
		),
		'content_classes' => 'elementor-panel-alert',
	)
);

$this->add_control(
	'show_title',
	array(
		'label'        => __( 'Show Title', 'ggm-commerce' ),
		'type'         => \Elementor\Controls_Manager::SWITCHER,
		'label_on'     => __( 'Yes', 'ggm-commerce' ),
		'label_off'    => __( 'No', 'ggm-commerce' ),
		'return_value' => 'yes',
		'default'      => 'yes',
	)
);

$this->add_control(
	'title_text',
	array(
		'label'     => __( 'Title', 'ggm-commerce' ),
		'type'      => \Elementor\Controls_Manager::TEXT,
		'default'   => __( 'Pay with Card', 'ggm-commerce' ),
		'condition' => array(
			'show_title' => 'yes',
		),
	)
);

$this->add_control(
	'show_icons',
	array(
		'label'        => __( 'Show Payment Icons', 'ggm-commerce' ),
		'type'         => \Elementor\Controls_Manager::SWITCHER,
		'label_on'     => __( 'Yes', 'ggm-commerce' ),
		'label_off'    => __( 'No', 'ggm-commerce' ),
		'return_value' => 'yes',
		'default'      => 'yes',
		'description'  => __( 'Display Visa, Mastercard, Amex icons.', 'ggm-commerce' ),
	)
);

$this->end_controls_section();
