Code Duplication    Length = 36-36 lines in 2 locations

class/class-edu-sveawebpay-config.php 2 locations

@@ 135-170 (lines=36) @@
132
	}
133
}
134
135
class EduSveaWebPayProductionConfig extends EduSveaWebPayBaseConfig {
136
137
	/**
138
	 * Constants for the endpoint url found in the class ConfigurationService.php
139
	 * getEndPoint() should return an url corresponding to $type.
140
	 *
141
	 * @param string $type one of Svea\WebPay\Config\ConfigurationProvider::HOSTED_TYPE, ::INVOICE_TYPE, ::PAYMENTPLAN_TYPE, ::HOSTED_ADMIN_TYPE, ::ADMIN_TYPE
142
	 *
143
	 * @throws Exception
144
	 * @return string
145
	 */
146
147
	public function getEndPoint( $type ) {
148
		switch ( strtoupper( $type ) ) {
149
			case 'HOSTED':
150
				return Svea\WebPay\Config\ConfigurationService::SWP_PROD_URL;
151
				break;
152
			case 'INVOICE':
153
			case 'PAYMENTPLAN':
154
				return Svea\WebPay\Config\ConfigurationService::SWP_PROD_WS_URL;
155
				break;
156
			case 'HOSTED_ADMIN':
157
				return Svea\WebPay\Config\ConfigurationService::SWP_PROD_HOSTED_ADMIN_URL;
158
				break;
159
			case 'ADMIN':
160
				return Svea\WebPay\Config\ConfigurationService::SWP_PROD_ADMIN_URL;
161
				break;
162
			case 'CHECKOUT':
163
				return Svea\WebPay\Config\ConfigurationService::CHECKOUT_PROD_BASE_URL;
164
				break;
165
			default:
166
				throw new Exception( 'Invalid type. Accepted values: INVOICE, PAYMENTPLAN, HOSTED, HOSTED_ADMIN, CHECKOUT' );
167
				break;
168
		}
169
	}
170
}
171
172
class EduSveaWebPayTestConfig extends EduSveaWebPayBaseConfig {
173
@@ 172-207 (lines=36) @@
169
	}
170
}
171
172
class EduSveaWebPayTestConfig extends EduSveaWebPayBaseConfig {
173
174
	/**
175
	 * Constants for the endpoint url found in the class ConfigurationService.php
176
	 * getEndPoint() should return an url corresponding to $type.
177
	 *
178
	 * @param string $type one of Svea\WebPay\Config\ConfigurationProvider::HOSTED_TYPE, ::INVOICE_TYPE, ::PAYMENTPLAN_TYPE, ::HOSTED_ADMIN_TYPE, ::ADMIN_TYPE
179
	 *
180
	 * @throws Exception
181
	 * @return string
182
	 */
183
	public function getEndPoint( $type ) {
184
		switch ( strtoupper( $type ) ) {
185
			case 'HOSTED':
186
				return Svea\WebPay\Config\ConfigurationService::SWP_TEST_URL;
187
				break;
188
			case 'INVOICE':
189
			case 'PAYMENTPLAN':
190
				return Svea\WebPay\Config\ConfigurationService::SWP_TEST_WS_URL;
191
				break;
192
			case 'HOSTED_ADMIN':
193
				return Svea\WebPay\Config\ConfigurationService::SWP_TEST_HOSTED_ADMIN_URL;
194
				break;
195
			case 'ADMIN':
196
				return Svea\WebPay\Config\ConfigurationService::SWP_TEST_ADMIN_URL;
197
				break;
198
			case 'CHECKOUT':
199
				return Svea\WebPay\Config\ConfigurationService::CHECKOUT_TEST_BASE_URL;
200
				break;
201
			default:
202
				throw new Exception( 'Invalid type. Accepted values: INVOICE, PAYMENTPLAN, HOSTED, HOSTED_ADMIN, CHECKOUT' );
203
				break;
204
		}
205
	}
206
207
}