Completed
Push — master ( 62795f...c560ea )
by
unknown
17s queued 11s
created
eduadmin-wordpress-sveawebpay.php 2 patches
Braces   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
  */
37 37
 
38 38
 add_action( 'admin_init', 'checkForEduAdminPlugin' );
39
-function checkForEduAdminPlugin() {
40
-	if ( is_admin() && current_user_can( 'activate_plugins' ) && ! is_plugin_active( 'eduadmin/eduadmin.php' ) ) {
41
-		add_action( 'admin_notices', function() {
39
+function checkForEduAdminPlugin() {
40
+	if ( is_admin() && current_user_can( 'activate_plugins' ) && ! is_plugin_active( 'eduadmin/eduadmin.php' ) ) {
41
+		add_action( 'admin_notices', function() {
42 42
 			?>
43 43
 			<div class="error">
44 44
 			<p><?php _e( 'This plugin requires the EduAdmin-WordPress-plugin to be installed and activated.', 'eduadmin-sveawebpay' ); ?></p>
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 		} );
47 47
 		deactivate_plugins( plugin_basename( __FILE__ ) );
48 48
 
49
-		if ( isset( $_GET['activate'] ) ) {
49
+		if ( isset( $_GET['activate'] ) ) {
50 50
 			unset( $_GET['activate'] );
51 51
 		}
52 52
 	}
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
 
55 55
 if ( ! class_exists( 'EDU_SveaWebPay_Loader' ) ):
56 56
 
57
-	final class EDU_SveaWebPay_Loader {
58
-		public function __construct() {
57
+	final class EDU_SveaWebPay_Loader {
58
+		public function __construct() {
59 59
 			add_action( 'plugins_loaded', array( $this, 'init' ) );
60 60
 		}
61 61
 
62
-		public function init() {
63
-			if ( class_exists( 'EDU_Integration' ) ) {
62
+		public function init() {
63
+			if ( class_exists( 'EDU_Integration' ) ) {
64 64
 				require_once( __DIR__ . '/vendor/autoload.php' ); // Load dependencies
65 65
 				require_once( __DIR__ . '/class/class-edu-sveawebpay.php' );
66 66
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 			}
69 69
 		}
70 70
 
71
-		public function add_integration( $integrations ) {
71
+		public function add_integration( $integrations ) {
72 72
 			$integrations[] = 'EDU_SveaWebPay';
73 73
 
74 74
 			return $integrations;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
 add_action( 'admin_init', 'checkForEduAdminPlugin' );
39 39
 function checkForEduAdminPlugin() {
40
-	if ( is_admin() && current_user_can( 'activate_plugins' ) && ! is_plugin_active( 'eduadmin/eduadmin.php' ) ) {
40
+	if ( is_admin() && current_user_can( 'activate_plugins' ) && !is_plugin_active( 'eduadmin/eduadmin.php' ) ) {
41 41
 		add_action( 'admin_notices', function() {
42 42
 			?>
43 43
 			<div class="error">
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	}
53 53
 }
54 54
 
55
-if ( ! class_exists( 'EDU_SveaWebPay_Loader' ) ):
55
+if ( !class_exists( 'EDU_SveaWebPay_Loader' ) ):
56 56
 
57 57
 	final class EDU_SveaWebPay_Loader {
58 58
 		public function __construct() {
Please login to merge, or discard this patch.
class/class-edu-sveawebpay.php 4 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 
6 6
 use Svea\WebPay\WebPay;
7 7
 use Svea\WebPay\WebPayItem;
8
-use Svea\WebPay\Config\ConfigurationService;
9 8
 use Svea\WebPay\Response\SveaResponse;
10 9
 
11 10
 if ( ! class_exists( 'EDU_SveaWebPay' ) ):
Please login to merge, or discard this patch.
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -204,9 +204,9 @@  discard block
 block discarded – undo
204 204
 				}
205 205
 
206 206
 				$zipPreset = WebPayItem::presetValue()
207
-				                       ->setTypeName( \Svea\WebPay\Checkout\Model\PresetValue::POSTAL_CODE )
208
-				                       ->setValue( ! empty( $bookingInfo->Customer->InvoiceZip ) ? $bookingInfo->Customer->InvoiceZip : $bookingInfo->Customer->Zip )
209
-				                       ->setIsReadonly( false );
207
+									   ->setTypeName( \Svea\WebPay\Checkout\Model\PresetValue::POSTAL_CODE )
208
+									   ->setValue( ! empty( $bookingInfo->Customer->InvoiceZip ) ? $bookingInfo->Customer->InvoiceZip : $bookingInfo->Customer->Zip )
209
+									   ->setIsReadonly( false );
210 210
 				$wpOrder->addPresetValue( $zipPreset );
211 211
 
212 212
 				if ( ! empty( $bookingInfo->Customer->InvoiceCity ) ) {
@@ -218,9 +218,9 @@  discard block
 block discarded – undo
218 218
 				if ( ! empty( $bookingInfo->Customer->Phone ) ) {
219 219
 					$customer->setPhoneNumber( $bookingInfo->Customer->Phone );
220 220
 					$phonePreset = WebPayItem::presetValue()
221
-					                         ->setTypeName( \Svea\WebPay\Checkout\Model\PresetValue::PHONE_NUMBER )
222
-					                         ->setValue( $bookingInfo->Customer->Phone )
223
-					                         ->setIsReadonly( false );
221
+											 ->setTypeName( \Svea\WebPay\Checkout\Model\PresetValue::PHONE_NUMBER )
222
+											 ->setValue( $bookingInfo->Customer->Phone )
223
+											 ->setIsReadonly( false );
224 224
 					$wpOrder->addPresetValue( $phonePreset );
225 225
 				}
226 226
 
@@ -231,9 +231,9 @@  discard block
 block discarded – undo
231 231
 				}
232 232
 
233 233
 				$emailPreset = WebPayItem::presetValue()
234
-				                         ->setTypeName( \Svea\WebPay\Checkout\Model\PresetValue::EMAIL_ADDRESS )
235
-				                         ->setValue( ! empty( $bookingInfo->Customer->InvoiceEmail ) ? $bookingInfo->Customer->InvoiceEmail : $bookingInfo->Customer->Email )
236
-				                         ->setIsReadonly( false );
234
+										 ->setTypeName( \Svea\WebPay\Checkout\Model\PresetValue::EMAIL_ADDRESS )
235
+										 ->setValue( ! empty( $bookingInfo->Customer->InvoiceEmail ) ? $bookingInfo->Customer->InvoiceEmail : $bookingInfo->Customer->Email )
236
+										 ->setIsReadonly( false );
237 237
 				$wpOrder->addPresetValue( $emailPreset );
238 238
 
239 239
 				$customer->setIpAddress( EDU()->get_ip_adress() );
Please login to merge, or discard this patch.
Braces   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@  discard block
 block discarded – undo
13 13
 	/**
14 14
 	 * EDU_SveaWebPay integrates EduAdmin-WordPress plugin with SveaWebPay as payment gateway
15 15
 	 */
16
-	class EDU_SveaWebPay extends EDU_Integration {
16
+	class EDU_SveaWebPay extends EDU_Integration {
17 17
 		/**
18 18
 		 * Constructor
19 19
 		 */
20
-		public function __construct() {
20
+		public function __construct() {
21 21
 			$this->id          = 'eduadmin-sveawebpay';
22 22
 			$this->displayName = __( 'Svea Webpay (Checkout)', 'eduadmin-sveawebpay' );
23 23
 			$this->description = '';
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
 		/**
36 36
 		 * @param $bookingInfo EduAdminBookingInfo
37 37
 		 */
38
-		public function intercept_booking( $bookingInfo = null ) {
39
-			if ( 'no' === $this->get_option( 'enabled', 'no' ) ) {
38
+		public function intercept_booking( $bookingInfo = null ) {
39
+			if ( 'no' === $this->get_option( 'enabled', 'no' ) ) {
40 40
 				return;
41 41
 			}
42
-			if ( isset( $_POST['act'] ) && 'bookCourse' === $_POST['act'] ) {
42
+			if ( isset( $_POST['act'] ) && 'bookCourse' === $_POST['act'] ) {
43 43
 				$bookingInfo->NoRedirect = true;
44 44
 			}
45 45
 		}
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 		/**
48 48
 		 * Initializes the settingsfields
49 49
 		 */
50
-		public function init_form_fields() {
50
+		public function init_form_fields() {
51 51
 			$this->setting_fields = array(
52 52
 				'enabled'         => array(
53 53
 					'title'       => __( 'Enabled', 'eduadmin-sveawebpay' ),
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
 		/**
80 80
 		 *
81 81
 		 */
82
-		public function process_svearesponse() {
82
+		public function process_svearesponse() {
83 83
 
84
-			if ( 'no' === $this->get_option( 'enabled', 'no' ) ) {
84
+			if ( 'no' === $this->get_option( 'enabled', 'no' ) ) {
85 85
 				return;
86 86
 			}
87
-			if ( ( isset( $_REQUEST['edu-thankyou'] ) && isset( $_REQUEST['svea'] ) ) || ( isset( $_REQUEST['edu-cancel'] ) && isset( $_REQUEST['svea'] ) ) ) {
87
+			if ( ( isset( $_REQUEST['edu-thankyou'] ) && isset( $_REQUEST['svea'] ) ) || ( isset( $_REQUEST['edu-cancel'] ) && isset( $_REQUEST['svea'] ) ) ) {
88 88
 
89 89
 				$eclId = ( isset( $_REQUEST['edu-thankyou'] ) ? $_REQUEST['edu-thankyou'] : $_REQUEST['edu-cancel'] );
90 90
 
@@ -113,20 +113,20 @@  discard block
 block discarded – undo
113 113
 				$selectedCountry = 'SE';
114 114
 
115 115
 				$invoiceCountry = $ebi->Customer->InvoiceCountry;
116
-				if ( empty( $invoiceCountry ) ) {
116
+				if ( empty( $invoiceCountry ) ) {
117 117
 					$invoiceCountry = $ebi->Customer->Country;
118 118
 				}
119 119
 
120
-				foreach ( $countries as $country ) {
121
-					if ( $invoiceCountry == $country->CountryName ) {
120
+				foreach ( $countries as $country ) {
121
+					if ( $invoiceCountry == $country->CountryName ) {
122 122
 						$selectedCountry = $country->CountryCode;
123 123
 						break;
124 124
 					}
125 125
 				}
126 126
 
127
-				if ( 'no' !== $this->get_option( 'testrun', 'no' ) ) {
127
+				if ( 'no' !== $this->get_option( 'testrun', 'no' ) ) {
128 128
 					$wpConfig = new EduSveaWebPayTestConfig( $this );
129
-				} else {
129
+				} else {
130 130
 					$wpConfig = new EduSveaWebPayProductionConfig( $this );
131 131
 				}
132 132
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
 				$sveaOrderId = get_transient( 'eduadmin-sveaorderid-' . $ebi->EventBooking->EventCustomerLnkID, 0 );
136 136
 
137
-				if ( $sveaOrderId > 0 ) {
137
+				if ( $sveaOrderId > 0 ) {
138 138
 					$wpOrder = WebPay::checkout( $wpConfig );
139 139
 
140 140
 					$wpOrder->setCheckoutOrderId( intval( $sveaOrderId ) );
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
 					$order = $wpOrder->getOrder();
143 143
 				}
144 144
 
145
-				if ( 'Cancelled' !== $order['Status'] ) {
145
+				if ( 'Cancelled' !== $order['Status'] ) {
146 146
 					EDU()->api->SetValidPayment( EDU()->get_token(), $ebi->EventBooking->EventCustomerLnkID );
147
-				} else {
147
+				} else {
148 148
 					EDU()->api->SetInvalidPayment( EDU()->get_token(), $ebi->EventBooking->EventCustomerLnkID );
149 149
 				}
150 150
 
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
 		/**
163 163
 		 * @param $bookingInfo EduAdminBookingInfo
164 164
 		 */
165
-		public function process_booking( $bookingInfo = null ) {
166
-			if ( 'no' === $this->get_option( 'enabled', 'no' ) ) {
165
+		public function process_booking( $bookingInfo = null ) {
166
+			if ( 'no' === $this->get_option( 'enabled', 'no' ) ) {
167 167
 				return;
168 168
 			}
169
-			if ( isset( $_POST['act'] ) && 'bookCourse' === $_POST['act'] ) {
169
+			if ( isset( $_POST['act'] ) && 'bookCourse' === $_POST['act'] ) {
170 170
 				$bookingInfo->NoRedirect = true;
171 171
 
172 172
 				$countries = EDU()->api->GetCountries( EDU()->get_token(), 'Swedish' );
@@ -175,14 +175,14 @@  discard block
 block discarded – undo
175 175
 				$selectedLocale  = 'sv-SE';
176 176
 
177 177
 				$invoiceCountry = $bookingInfo->Customer->InvoiceCountry;
178
-				if ( empty( $invoiceCountry ) ) {
178
+				if ( empty( $invoiceCountry ) ) {
179 179
 					$invoiceCountry = $bookingInfo->Customer->Country;
180 180
 				}
181 181
 
182
-				foreach ( $countries as $country ) {
183
-					if ( $invoiceCountry == $country->CountryName ) {
182
+				foreach ( $countries as $country ) {
183
+					if ( $invoiceCountry == $country->CountryName ) {
184 184
 						$selectedCountry = $country->CountryCode;
185
-						if ( ! empty( $country->CultureName ) ) {
185
+						if ( ! empty( $country->CultureName ) ) {
186 186
 							$selectedLocale = $country->CultureName;
187 187
 						}
188 188
 						break;
@@ -193,9 +193,9 @@  discard block
 block discarded – undo
193 193
 
194 194
 				$currency = get_option( 'eduadmin-currency', 'SEK' );
195 195
 
196
-				if ( 'no' !== $this->get_option( 'testrun', 'no' ) ) {
196
+				if ( 'no' !== $this->get_option( 'testrun', 'no' ) ) {
197 197
 					$wpConfig = new EduSveaWebPayTestConfig( $this );
198
-				} else {
198
+				} else {
199 199
 					$wpConfig = new EduSveaWebPayProductionConfig( $this );
200 200
 				}
201 201
 				#$wpOrder = WebPay::createOrder( $wpConfig );
@@ -211,21 +211,21 @@  discard block
 block discarded – undo
211 211
 
212 212
 				$customer = WebPayItem::companyCustomer();
213 213
 
214
-				if ( ! empty( $bookingInfo->Customer->InvoiceName ) ) {
214
+				if ( ! empty( $bookingInfo->Customer->InvoiceName ) ) {
215 215
 					$customer->setCompanyName( $bookingInfo->Customer->InvoiceName );
216
-				} else {
216
+				} else {
217 217
 					$customer->setCompanyName( $bookingInfo->Customer->CustomerName );
218 218
 				}
219 219
 
220
-				if ( ! empty( $bookingInfo->Customer->InvoiceAddress1 ) ) {
220
+				if ( ! empty( $bookingInfo->Customer->InvoiceAddress1 ) ) {
221 221
 					$customer->setStreetAddress( $bookingInfo->Customer->InvoiceAddress1 );
222
-				} else {
222
+				} else {
223 223
 					$customer->setStreetAddress( $bookingInfo->Customer->Address1 );
224 224
 				}
225 225
 
226
-				if ( ! empty( $bookingInfo->Customer->InvoiceZip ) ) {
226
+				if ( ! empty( $bookingInfo->Customer->InvoiceZip ) ) {
227 227
 					$customer->setZipCode( $bookingInfo->Customer->InvoiceZip );
228
-				} else {
228
+				} else {
229 229
 					$customer->setZipCode( $bookingInfo->Customer->Zip );
230 230
 				}
231 231
 
@@ -235,13 +235,13 @@  discard block
 block discarded – undo
235 235
 				                       ->setIsReadonly( false );
236 236
 				$wpOrder->addPresetValue( $zipPreset );
237 237
 
238
-				if ( ! empty( $bookingInfo->Customer->InvoiceCity ) ) {
238
+				if ( ! empty( $bookingInfo->Customer->InvoiceCity ) ) {
239 239
 					$customer->setLocality( $bookingInfo->Customer->InvoiceCity );
240
-				} else {
240
+				} else {
241 241
 					$customer->setLocality( $bookingInfo->Customer->City );
242 242
 				}
243 243
 
244
-				if ( ! empty( $bookingInfo->Customer->Phone ) ) {
244
+				if ( ! empty( $bookingInfo->Customer->Phone ) ) {
245 245
 					$customer->setPhoneNumber( $bookingInfo->Customer->Phone );
246 246
 					$phonePreset = WebPayItem::presetValue()
247 247
 					                         ->setTypeName( \Svea\WebPay\Checkout\Model\PresetValue::PHONE_NUMBER )
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
 					$wpOrder->addPresetValue( $phonePreset );
251 251
 				}
252 252
 
253
-				if ( ! empty( $bookingInfo->Customer->InvoiceEmail ) ) {
253
+				if ( ! empty( $bookingInfo->Customer->InvoiceEmail ) ) {
254 254
 					$customer->setEmail( $bookingInfo->Customer->InvoiceEmail );
255
-				} else {
255
+				} else {
256 256
 					$customer->setEmail( $bookingInfo->Customer->Email );
257 257
 				}
258 258
 
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 
299 299
 				set_transient( 'eduadmin-sveaorderid-' . $bookingInfo->EventBooking->EventCustomerLnkID, $wpForm['OrderId'], HOUR_IN_SECONDS );
300 300
 
301
-				if ( array_key_exists( 'Gui', $wpForm ) ) {
301
+				if ( array_key_exists( 'Gui', $wpForm ) ) {
302 302
 					echo $wpForm['Gui']['Snippet'];
303 303
 				}
304 304
 				/*if ( $wpForm->accepted ) {
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 use Svea\WebPay\Config\ConfigurationService;
9 9
 use Svea\WebPay\Response\SveaResponse;
10 10
 
11
-if ( ! class_exists( 'EDU_SveaWebPay' ) ):
11
+if ( !class_exists( 'EDU_SveaWebPay' ) ):
12 12
 
13 13
 	/**
14 14
 	 * EDU_SveaWebPay integrates EduAdmin-WordPress plugin with SveaWebPay as payment gateway
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 				foreach ( $countries as $country ) {
183 183
 					if ( $invoiceCountry == $country->CountryName ) {
184 184
 						$selectedCountry = $country->CountryCode;
185
-						if ( ! empty( $country->CultureName ) ) {
185
+						if ( !empty( $country->CultureName ) ) {
186 186
 							$selectedLocale = $country->CultureName;
187 187
 						}
188 188
 						break;
@@ -211,19 +211,19 @@  discard block
 block discarded – undo
211 211
 
212 212
 				$customer = WebPayItem::companyCustomer();
213 213
 
214
-				if ( ! empty( $bookingInfo->Customer->InvoiceName ) ) {
214
+				if ( !empty( $bookingInfo->Customer->InvoiceName ) ) {
215 215
 					$customer->setCompanyName( $bookingInfo->Customer->InvoiceName );
216 216
 				} else {
217 217
 					$customer->setCompanyName( $bookingInfo->Customer->CustomerName );
218 218
 				}
219 219
 
220
-				if ( ! empty( $bookingInfo->Customer->InvoiceAddress1 ) ) {
220
+				if ( !empty( $bookingInfo->Customer->InvoiceAddress1 ) ) {
221 221
 					$customer->setStreetAddress( $bookingInfo->Customer->InvoiceAddress1 );
222 222
 				} else {
223 223
 					$customer->setStreetAddress( $bookingInfo->Customer->Address1 );
224 224
 				}
225 225
 
226
-				if ( ! empty( $bookingInfo->Customer->InvoiceZip ) ) {
226
+				if ( !empty( $bookingInfo->Customer->InvoiceZip ) ) {
227 227
 					$customer->setZipCode( $bookingInfo->Customer->InvoiceZip );
228 228
 				} else {
229 229
 					$customer->setZipCode( $bookingInfo->Customer->Zip );
@@ -231,17 +231,17 @@  discard block
 block discarded – undo
231 231
 
232 232
 				$zipPreset = WebPayItem::presetValue()
233 233
 				                       ->setTypeName( \Svea\WebPay\Checkout\Model\PresetValue::POSTAL_CODE )
234
-				                       ->setValue( ! empty( $bookingInfo->Customer->InvoiceZip ) ? $bookingInfo->Customer->InvoiceZip : $bookingInfo->Customer->Zip )
234
+				                       ->setValue( !empty( $bookingInfo->Customer->InvoiceZip ) ? $bookingInfo->Customer->InvoiceZip : $bookingInfo->Customer->Zip )
235 235
 				                       ->setIsReadonly( false );
236 236
 				$wpOrder->addPresetValue( $zipPreset );
237 237
 
238
-				if ( ! empty( $bookingInfo->Customer->InvoiceCity ) ) {
238
+				if ( !empty( $bookingInfo->Customer->InvoiceCity ) ) {
239 239
 					$customer->setLocality( $bookingInfo->Customer->InvoiceCity );
240 240
 				} else {
241 241
 					$customer->setLocality( $bookingInfo->Customer->City );
242 242
 				}
243 243
 
244
-				if ( ! empty( $bookingInfo->Customer->Phone ) ) {
244
+				if ( !empty( $bookingInfo->Customer->Phone ) ) {
245 245
 					$customer->setPhoneNumber( $bookingInfo->Customer->Phone );
246 246
 					$phonePreset = WebPayItem::presetValue()
247 247
 					                         ->setTypeName( \Svea\WebPay\Checkout\Model\PresetValue::PHONE_NUMBER )
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 					$wpOrder->addPresetValue( $phonePreset );
251 251
 				}
252 252
 
253
-				if ( ! empty( $bookingInfo->Customer->InvoiceEmail ) ) {
253
+				if ( !empty( $bookingInfo->Customer->InvoiceEmail ) ) {
254 254
 					$customer->setEmail( $bookingInfo->Customer->InvoiceEmail );
255 255
 				} else {
256 256
 					$customer->setEmail( $bookingInfo->Customer->Email );
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 
259 259
 				$emailPreset = WebPayItem::presetValue()
260 260
 				                         ->setTypeName( \Svea\WebPay\Checkout\Model\PresetValue::EMAIL_ADDRESS )
261
-				                         ->setValue( ! empty( $bookingInfo->Customer->InvoiceEmail ) ? $bookingInfo->Customer->InvoiceEmail : $bookingInfo->Customer->Email )
261
+				                         ->setValue( !empty( $bookingInfo->Customer->InvoiceEmail ) ? $bookingInfo->Customer->InvoiceEmail : $bookingInfo->Customer->Email )
262 262
 				                         ->setIsReadonly( false );
263 263
 				$wpOrder->addPresetValue( $emailPreset );
264 264
 
Please login to merge, or discard this patch.
class/class-edu-sveawebpay-config.php 1 patch
Braces   +19 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-class EduSveaWebPayBaseConfig implements \Svea\WebPay\Config\ConfigurationProvider {
3
+class EduSveaWebPayBaseConfig implements \Svea\WebPay\Config\ConfigurationProvider {
4 4
 	/**
5 5
 	 * @var EDU_SveaWebPay
6 6
 	 */
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 	 *
12 12
 	 * @param EDU_SveaWebPay $_plugin
13 13
 	 */
14
-	public function __construct( $_plugin ) {
14
+	public function __construct( $_plugin ) {
15 15
 		$this->plugin = $_plugin;
16 16
 	}
17 17
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	 * @throws \Svea\WebPay\HostedService\Helper\InvalidTypeException  in case of unsupported $type
27 27
 	 * @throws \Svea\WebPay\HostedService\Helper\InvalidCountryException  in case of unsupported $country
28 28
 	 */
29
-	public function getUsername( $type, $country ) {
29
+	public function getUsername( $type, $country ) {
30 30
 		echo 'username';
31 31
 	}
32 32
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 * @throws \Svea\WebPay\HostedService\Helper\InvalidTypeException  in case of unsupported $type
42 42
 	 * @throws \Svea\WebPay\HostedService\Helper\InvalidCountryException  in case of unsupported $country
43 43
 	 */
44
-	public function getPassword( $type, $country ) {
44
+	public function getPassword( $type, $country ) {
45 45
 		echo 'password';
46 46
 	}
47 47
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	 * @throws \Svea\WebPay\HostedService\Helper\InvalidTypeException  in case of unsupported $type
57 57
 	 * @throws \Svea\WebPay\HostedService\Helper\InvalidCountryException  in case of unsupported $country
58 58
 	 */
59
-	public function getClientNumber( $type, $country ) {
59
+	public function getClientNumber( $type, $country ) {
60 60
 		echo 'client';
61 61
 	}
62 62
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * @param string $type    Svea\WebPay\Config\ConfigurationProvider::INVOICE_TYPE, ::PAYMENTPLAN_TYPE can be used if needed to match different configuration settings
69 69
 	 * @param string $country CountryCode eg. SE, NO, DK, FI, NL, DE
70 70
 	 */
71
-	public function getMerchantId( $type, $country ) {
71
+	public function getMerchantId( $type, $country ) {
72 72
 		$merchantId = $this->plugin->get_option( 'merchant_key', '' );
73 73
 
74 74
 		return $merchantId;
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 * @param string $type    Svea\WebPay\Config\ConfigurationProvider::INVOICE_TYPE, ::PAYMENTPLAN_TYPE can be used if needed to match different configuration settings
83 83
 	 * @param string $country CountryCode eg. SE, NO, DK, FI, NL, DE
84 84
 	 */
85
-	public function getSecret( $type, $country ) {
85
+	public function getSecret( $type, $country ) {
86 86
 		$secret = $this->plugin->get_option( 'merchant_secret', '' );
87 87
 
88 88
 		return $secret;
@@ -98,7 +98,8 @@  discard block
 block discarded – undo
98 98
 	 * @return string
99 99
 	 */
100 100
 
101
-	public function getEndPoint( $type ) { /* Defined in subclasses */
101
+	public function getEndPoint( $type ) {
102
+/* Defined in subclasses */
102 103
 	}
103 104
 
104 105
 	/**
@@ -106,7 +107,7 @@  discard block
 block discarded – undo
106 107
 	 *
107 108
 	 * @return string
108 109
 	 */
109
-	public function getCheckoutMerchantId() {
110
+	public function getCheckoutMerchantId() {
110 111
 		$merchantId = $this->plugin->get_option( 'merchant_key', '' );
111 112
 
112 113
 		return $merchantId;
@@ -117,22 +118,22 @@  discard block
 block discarded – undo
117 118
 	 *
118 119
 	 * @return string
119 120
 	 */
120
-	public function getCheckoutSecret() {
121
+	public function getCheckoutSecret() {
121 122
 		$secret = $this->plugin->get_option( 'merchant_secret', '' );
122 123
 
123 124
 		return $secret;
124 125
 	}
125 126
 
126
-	public function getIntegrationCompany() {
127
+	public function getIntegrationCompany() {
127 128
 		return 'MultiNet Interactive AB : EduAdmin WordPress-plugin';
128 129
 	}
129 130
 
130
-	public function getIntegrationPlatform() {
131
+	public function getIntegrationPlatform() {
131 132
 		return 'EduAdmin WordPress';
132 133
 	}
133 134
 }
134 135
 
135
-class EduSveaWebPayProductionConfig extends EduSveaWebPayBaseConfig {
136
+class EduSveaWebPayProductionConfig extends EduSveaWebPayBaseConfig {
136 137
 
137 138
 	/**
138 139
 	 * Constants for the endpoint url found in the class ConfigurationService.php
@@ -144,8 +145,8 @@  discard block
 block discarded – undo
144 145
 	 * @return string
145 146
 	 */
146 147
 
147
-	public function getEndPoint( $type ) {
148
-		switch ( strtoupper( $type ) ) {
148
+	public function getEndPoint( $type ) {
149
+		switch ( strtoupper( $type ) ) {
149 150
 			case 'HOSTED':
150 151
 				return Svea\WebPay\Config\ConfigurationService::SWP_PROD_URL;
151 152
 				break;
@@ -169,7 +170,7 @@  discard block
 block discarded – undo
169 170
 	}
170 171
 }
171 172
 
172
-class EduSveaWebPayTestConfig extends EduSveaWebPayBaseConfig {
173
+class EduSveaWebPayTestConfig extends EduSveaWebPayBaseConfig {
173 174
 
174 175
 	/**
175 176
 	 * Constants for the endpoint url found in the class ConfigurationService.php
@@ -180,8 +181,8 @@  discard block
 block discarded – undo
180 181
 	 * @throws Exception
181 182
 	 * @return string
182 183
 	 */
183
-	public function getEndPoint( $type ) {
184
-		switch ( strtoupper( $type ) ) {
184
+	public function getEndPoint( $type ) {
185
+		switch ( strtoupper( $type ) ) {
185 186
 			case 'HOSTED':
186 187
 				return Svea\WebPay\Config\ConfigurationService::SWP_TEST_URL;
187 188
 				break;
Please login to merge, or discard this patch.