<?php

namespace SugarCalendarBookings\Integrations\Zoom;

use SugarCalendarBookings\Integrations\OAuthRelay\AbstractOAuthCallbackHandler;

/**
 * Zoom OAuth Callback Handler.
 *
 * @since 1.4.0
 */
class ZoomOAuthCallbackHandler extends AbstractOAuthCallbackHandler {

	/**
	 * Get the provider identifier.
	 *
	 * @since 1.4.0
	 *
	 * @return string
	 */
	protected function get_provider(): string {

		return 'zoom';
	}

	/**
	 * Map error codes to user-friendly messages.
	 *
	 * @since 1.4.0
	 *
	 * @param string $error_code Error code.
	 *
	 * @return string
	 */
	protected function get_error_message( string $error_code ): string {

		// Add Zoom-specific error codes.
		if ( $error_code === 'zoom_account_not_activated' ) {
			return esc_html__( 'Your Zoom account must be activated before connecting.', 'sugar-calendar-bookings-scheduling-appointments-lite' );
		}

		return parent::get_error_message( $error_code );
	}
}
