<?php
/**
 * Interface for payment gateway implementations.
 *
 * @package Donatico\Interfaces
 */

declare(strict_types=1);

namespace Donatico\Interfaces;

use Donatico\Models\Donation;

/**
 * Payment gateway contract. Implement to add support for additional gateways
 * beyond Stripe in future versions.
 */
interface PaymentGatewayInterface {

	/**
	 * Create a checkout/payment session for the given donation.
	 *
	 * @param Donation $donation The donation to process.
	 * @return string URL to redirect the donor to.
	 */
	public function createSession( Donation $donation ): string;

	/**
	 * Handle an incoming webhook payload from the gateway.
	 *
	 * @param string $payload   Raw request body.
	 * @param string $signature Gateway signature header value.
	 * @return void
	 */
	public function handleWebhook( string $payload, string $signature ): void;
}
