<?php
namespace Svea_Webpay_For_Woocommerce\Service_Providers;

use Svea\WebPay\Config\ConfigurationProvider;
use Svea\WebPay\Config\ConfigurationService;

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

class Config_Test extends Config_Production {

	/**
	 * @inheritDoc
	 */
	public function getEndPoint( $type ) {
		if ( $type === ConfigurationProvider::HOSTED_TYPE ) {
			return ConfigurationService::SWP_TEST_URL;
		} else if ( $type === ConfigurationProvider::INVOICE_TYPE || $type === ConfigurationProvider::PAYMENTPLAN_TYPE ) {
			return ConfigurationService::SWP_TEST_WS_URL;
		} else if ( $type === ConfigurationProvider::HOSTED_ADMIN_TYPE ) {
			return ConfigurationService::SWP_TEST_HOSTED_ADMIN_URL;
		} else if ( $type === ConfigurationProvider::ADMIN_TYPE ) {
			return ConfigurationService::SWP_TEST_ADMIN_URL;
		} else if ( $type === ConfigurationProvider::PREPARED_URL ) {
			return ConfigurationService::SWP_TEST_PREPARED_URL;
		} else {
			throw new \Exception( 'Error Processing Request! The request did not match any request type. Accepted values: INVOICE, PAYMENTPLAN, HOSTED_ADMIN or HOSTED' );
		}
	}
}
