<?php
/**
 * Payment gateway contract.
 *
 * @package Lucrativeit_Subscription_Recurring_Billing
 */

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

/**
 * All payment gateways must implement this interface.
 */
interface LUCRSURE_Gateway_Interface {

	/**
	 * Unique gateway id (slug).
	 *
	 * @return string
	 */
	public function get_id();

	/**
	 * Human readable title.
	 *
	 * @return string
	 */
	public function get_title();

	/**
	 * Whether this gateway supports automatic recurring charges
	 * (true) or is invoice-based and requires manual payment (false).
	 *
	 * @return bool
	 */
	public function supports_automatic_recurring();

	/**
	 * Whether the gateway is enabled in settings.
	 *
	 * @return bool
	 */
	public function is_enabled();

	/**
	 * Create a payable charge/invoice for the given invoice record.
	 *
	 * @param array $invoice Invoice row.
	 * @return array { success:bool, payment_url:string, gateway_payment_id:string, message:string }
	 */
	public function create_payment( array $invoice );
}
