Code Duplication    Length = 36-36 lines in 2 locations

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

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