<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class VerifyRazorpayPaymentRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return $this->user() !== null;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, mixed>
     */
    public function rules(): array
    {
        return [
            'razorpay_order_id' => ['required', 'string', 'max:120', 'starts_with:order_'],
            'razorpay_payment_id' => ['required', 'string', 'max:120', 'starts_with:pay_'],
            'razorpay_signature' => ['required', 'string', 'size:64'],
        ];
    }
}
