<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use App\Contracts\PaymentGatewayInterface;
use App\Services\Payments\StripeGateway;
// use App\Services\Payments\AchGateway; // Uncomment when adding ACH

/**
 * PaymentServiceProvider
 *
 * This provider binds the PaymentGatewayInterface to a specific
 * payment provider implementation. This makes the system
 * payment-provider-agnostic and easily extensible.
 *
 * By centralizing the binding, any part of the application
 * can request PaymentGatewayInterface via dependency injection,
 * and the appropriate gateway (Stripe, ACH, etc.) will be injected.
 */
class PaymentServiceProvider extends ServiceProvider
{
    /**
     * Register application services.
     *
     * Here we bind the interface to the StripeGateway class.
     * To change the payment provider (e.g., switch to ACH),
     * simply update the binding below.
     */
    public function register(): void
    {
        // Bind to Stripe by default
        $this->app->bind(PaymentGatewayInterface::class, StripeGateway::class);

        // To switch to ACH in the future:
        // $this->app->bind(PaymentGatewayInterface::class, AchGateway::class);
    }

    /**
     * Bootstrap any application services (not used here).
     */
    public function boot(): void
    {
        // Nothing needed at boot time
    }
}
