<?php

namespace App\Services\Payments;

use App\Models\Payment;
use App\Models\PaymentGateway;
use App\Models\SubscriptionPlan;
use App\Models\User;
use Illuminate\Http\Request;

class FlutterwavePaymentService
{
    public function initializePayment(User $user, SubscriptionPlan $plan, PaymentGateway $gateway, Payment $payment): array
    {
        // Add Flutterwave payment link initialization here using the official Flutterwave documentation.
        // Keep the subscription pending until Flutterwave verification confirms a successful payment.
        return [
            'success' => false,
            'message' => 'Flutterwave payment initialization is prepared but not connected yet.',
        ];
    }

    public function verifyPayment(PaymentGateway $gateway, string $reference): array
    {
        // Add Flutterwave transaction verification here using the official Flutterwave documentation.
        return [
            'success' => false,
            'message' => 'Flutterwave payment verification is prepared but not connected yet.',
        ];
    }

    public function handleWebhook(PaymentGateway $gateway, Request $request): array
    {
        // Validate Flutterwave webhook hashes here before trusting any webhook payload.
        return [
            'success' => false,
            'message' => 'Flutterwave webhook handling is prepared but not connected yet.',
        ];
    }
}
