<?php

namespace Booktics\Payment\Contracts;

use Booktics\Models\Order_Model;

/**
 * Interface for a payment method.
 *
 * A payment method is an object that encapsulates all of the data and
 * behavior associated with a particular payment method. It must
 * implement the methods defined by this interface.
 *
 * @package Booktics\Core\Payment\Contracts
 */
interface Payment_Method_Interface {

    /**
     * Get the unique identifier for this payment method
     *
     * @return string
     */
    public function get_id(): string;

    /**
     * Get the display name of the payment method
     *
     * @return string
     */
    public function get_name(): string;

    /**
     * Process the payment
     *
     * @return \WP_Error|array Result of payment processing
     */
    public function process_payment( $order );

    /**
     * Validate payment data before processing
     *
     * @return \WP_Error|bool
     */
    public function validate_payment_data();

    /**
     * Get payment status
     *
     * @param $order
     *
     * @return string
     */
    public function get_payment_status( $order ): string;

    /**
     * Process a refund through Stripe.
     *
     * @param Order_Model $order The order to process refund for
     */
    public function process_refund( $order );
}
