<?php

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

/**
 * @var Payment_Method_Item $item
 * @var Payment_Method_Item_Provider $payment_provider
 * @var Payment_Method_Expandable_Group | null $inner_group
 * @var Payment_Method_Item_Card $card
 */

use Simplyin\Simplyin_W_Plugin\Payments\View_Model\Classic_Checkout\Payment_Method_Expandable_Group;
use Simplyin\Simplyin_W_Plugin\Payments\View_Model\Classic_Checkout\Payment_Method_Item_Card;
use Simplyin\Simplyin_W_Plugin\Payments\View_Model\Classic_Checkout\Payment_Method_Item;
use Simplyin\Simplyin_W_Plugin\Payments\View_Model\Classic_Checkout\Payment_Method_Item_Provider;


?>

<li class="simplyin-payment-option-item simplyin-payment-option-item-saved-card <?php if ( $inner_group ) : ?>inner-group-item<?php endif; ?>">
	<label
		class="simplyin-payment-option-label simplyin-saved-card"
		for="simplyin-payment-option-<?php echo esc_attr( $item->get_short_id() ); ?>">
		<input type="radio"
			   name="simplyin-payment-option"
			   onclick="addCurrentClass(this)"
			   data-index="0"
			   id="simplyin-payment-option-<?php echo esc_attr( $item->get_short_id() ); ?>"
			   value="<?php echo esc_attr( $item->get_id() ); ?>"
			   class="<?php echo $inner_group ? 'inside-inner-group' : ''; ?>">
		<img
			src="<?php echo esc_url( $item->get_icon() ); ?>"
			class="simplyin-payment-option-logo">
		<span
			class="simplyin-payment-option-name"><?php echo esc_html( $item->get_label() ); ?> (**<?php echo esc_html( $card->get_last_digits_of_card_number() ); ?>)
		</span>
	</label>
	<span
		class="simplyin-payment-option-desc"><?php echo esc_html( $item->get_description() ); ?></span>
</li>
