<?php
/**
 * Payment Failed Email
 * Sent to customer when payment fails
 */

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

class GGM_Commerce_Email_Payment_Failed extends GGM_Commerce_Email_Template {

    /**
     * Constructor
     */
    public function __construct() {
        $this->id             = 'payment_failed';
        $this->title          = __( 'Payment Failed', 'ggm-commerce' );
        $this->description    = __( 'Sent to customer when their payment fails.', 'ggm-commerce' );
        $this->recipient_type = 'customer';
    }

    /**
     * Get default subject
     *
     * @return string
     */
    public function get_default_subject() {
        return __( 'Payment failed for order #{order_number}', 'ggm-commerce' );
    }

    /**
     * Get default heading
     *
     * @return string
     */
    public function get_default_heading() {
        return __( 'We were unable to process your payment', 'ggm-commerce' );
    }

    /**
     * Get default content
     *
     * @return string
     */
    public function get_default_content() {
        return '
<p>Hi {customer_first_name},</p>

<p>Unfortunately, we were unable to process the payment for your order #{order_number}.</p>

<p>This could happen for several reasons:</p>
<ul style="margin: 16px 0; padding-left: 24px; color: #4b5563;">
    <li>Insufficient funds in your account</li>
    <li>Card details entered incorrectly</li>
    <li>Your card has expired</li>
    <li>Your bank declined the transaction</li>
</ul>

<h3 style="margin: 24px 0 16px 0; font-size: 18px; color: #1f2937;">Order Details</h3>

<p><strong>Order Number:</strong> #{order_number}<br>
<strong>Order Total:</strong> {order_total}</p>

{order_items_table}

<p style="margin-top: 32px;">Please try placing your order again or use a different payment method. If you continue to experience issues, please contact your bank or reach out to us for assistance.</p>

<p>If you have any questions, please contact us at {business_email}.</p>
';
    }
}
