@@ -36,9 +36,9 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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; |
@@ -37,7 +37,7 @@ discard block |
||
| 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 |
||
| 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() { |
@@ -204,9 +204,9 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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() ); |
@@ -5,8 +5,6 @@ |
||
| 5 | 5 | |
| 6 | 6 | use Svea\WebPay\WebPay; |
| 7 | 7 | use Svea\WebPay\WebPayItem; |
| 8 | -use Svea\WebPay\Config\ConfigurationService; |
|
| 9 | -use Svea\WebPay\Response\SveaResponse; |
|
| 10 | 8 | |
| 11 | 9 | if ( ! class_exists( 'EDU_SveaWebPay' ) ): |
| 12 | 10 | |
@@ -8,7 +8,7 @@ discard block |
||
| 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 |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | foreach ( $countries as $country ) { |
| 168 | 168 | if ( $invoiceCountry == $country['CountryName'] ) { |
| 169 | 169 | $selectedCountry = $country['CountryCode']; |
| 170 | - if ( ! empty( $country['CultureName'] ) ) { |
|
| 170 | + if ( !empty( $country['CultureName'] ) ) { |
|
| 171 | 171 | $selectedLocale = $country['CultureName']; |
| 172 | 172 | } |
| 173 | 173 | break; |
@@ -194,19 +194,19 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | $customer = WebPayItem::companyCustomer(); |
| 196 | 196 | |
| 197 | - if ( ! empty( $bookingInfo->Customer->InvoiceName ) ) { |
|
| 197 | + if ( !empty( $bookingInfo->Customer->InvoiceName ) ) { |
|
| 198 | 198 | $customer->setCompanyName( $bookingInfo->Customer->InvoiceName ); |
| 199 | 199 | } else { |
| 200 | 200 | $customer->setCompanyName( $bookingInfo->Customer->CustomerName ); |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | - if ( ! empty( $bookingInfo->Customer->InvoiceAddress1 ) ) { |
|
| 203 | + if ( !empty( $bookingInfo->Customer->InvoiceAddress1 ) ) { |
|
| 204 | 204 | $customer->setStreetAddress( $bookingInfo->Customer->InvoiceAddress1 ); |
| 205 | 205 | } else { |
| 206 | 206 | $customer->setStreetAddress( $bookingInfo->Customer->Address1 ); |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - if ( ! empty( $bookingInfo->Customer->InvoiceZip ) ) { |
|
| 209 | + if ( !empty( $bookingInfo->Customer->InvoiceZip ) ) { |
|
| 210 | 210 | $customer->setZipCode( $bookingInfo->Customer->InvoiceZip ); |
| 211 | 211 | } else { |
| 212 | 212 | $customer->setZipCode( $bookingInfo->Customer->Zip ); |
@@ -214,17 +214,17 @@ discard block |
||
| 214 | 214 | |
| 215 | 215 | $zipPreset = WebPayItem::presetValue() |
| 216 | 216 | ->setTypeName( \Svea\WebPay\Checkout\Model\PresetValue::POSTAL_CODE ) |
| 217 | - ->setValue( ! empty( $bookingInfo->Customer->InvoiceZip ) ? $bookingInfo->Customer->InvoiceZip : $bookingInfo->Customer->Zip ) |
|
| 217 | + ->setValue( !empty( $bookingInfo->Customer->InvoiceZip ) ? $bookingInfo->Customer->InvoiceZip : $bookingInfo->Customer->Zip ) |
|
| 218 | 218 | ->setIsReadonly( false ); |
| 219 | 219 | $wpOrder->addPresetValue( $zipPreset ); |
| 220 | 220 | |
| 221 | - if ( ! empty( $bookingInfo->Customer->InvoiceCity ) ) { |
|
| 221 | + if ( !empty( $bookingInfo->Customer->InvoiceCity ) ) { |
|
| 222 | 222 | $customer->setLocality( $bookingInfo->Customer->InvoiceCity ); |
| 223 | 223 | } else { |
| 224 | 224 | $customer->setLocality( $bookingInfo->Customer->City ); |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | - if ( ! empty( $bookingInfo->Customer->Phone ) ) { |
|
| 227 | + if ( !empty( $bookingInfo->Customer->Phone ) ) { |
|
| 228 | 228 | $customer->setPhoneNumber( $bookingInfo->Customer->Phone ); |
| 229 | 229 | $phonePreset = WebPayItem::presetValue() |
| 230 | 230 | ->setTypeName( \Svea\WebPay\Checkout\Model\PresetValue::PHONE_NUMBER ) |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | $wpOrder->addPresetValue( $phonePreset ); |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | - if ( ! empty( $bookingInfo->Customer->InvoiceEmail ) ) { |
|
| 236 | + if ( !empty( $bookingInfo->Customer->InvoiceEmail ) ) { |
|
| 237 | 237 | $customer->setEmail( $bookingInfo->Customer->InvoiceEmail ); |
| 238 | 238 | } else { |
| 239 | 239 | $customer->setEmail( $bookingInfo->Customer->Email ); |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | |
| 242 | 242 | $emailPreset = WebPayItem::presetValue() |
| 243 | 243 | ->setTypeName( \Svea\WebPay\Checkout\Model\PresetValue::EMAIL_ADDRESS ) |
| 244 | - ->setValue( ! empty( $bookingInfo->Customer->InvoiceEmail ) ? $bookingInfo->Customer->InvoiceEmail : $bookingInfo->Customer->Email ) |
|
| 244 | + ->setValue( !empty( $bookingInfo->Customer->InvoiceEmail ) ? $bookingInfo->Customer->InvoiceEmail : $bookingInfo->Customer->Email ) |
|
| 245 | 245 | ->setIsReadonly( false ); |
| 246 | 246 | $wpOrder->addPresetValue( $emailPreset ); |
| 247 | 247 | |
@@ -13,11 +13,11 @@ discard block |
||
| 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 |
||
| 35 | 35 | /** |
| 36 | 36 | * @param $bookingInfo EduAdmin_BookingInfo|null $bookingInfo |
| 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 |
||
| 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 |
||
| 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 | |
@@ -108,15 +108,15 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | $ebi = new EduAdminBookingInfo( $eventBooking, $_customer, $_contact ); |
| 110 | 110 | |
| 111 | - if ( 'no' !== $this->get_option( 'testrun', 'no' ) ) { |
|
| 111 | + if ( 'no' !== $this->get_option( 'testrun', 'no' ) ) {
|
|
| 112 | 112 | $wpConfig = new EduSveaWebPayTestConfig( $this ); |
| 113 | - } else { |
|
| 113 | + } else {
|
|
| 114 | 114 | $wpConfig = new EduSveaWebPayProductionConfig( $this ); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | $sveaOrderId = get_transient( 'eduadmin-sveaorderid-' . $ebi->EventBooking->EventCustomerLnkID ); |
| 118 | 118 | |
| 119 | - if ( $sveaOrderId > 0 ) { |
|
| 119 | + if ( $sveaOrderId > 0 ) {
|
|
| 120 | 120 | $wpOrder = WebPay::checkout( $wpConfig ); |
| 121 | 121 | |
| 122 | 122 | $wpOrder->setCheckoutOrderId( intval( $sveaOrderId ) ); |
@@ -124,9 +124,9 @@ discard block |
||
| 124 | 124 | $order = $wpOrder->getOrder(); |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | - if ( 'Cancelled' !== $order['Status'] ) { |
|
| 127 | + if ( 'Cancelled' !== $order['Status'] ) {
|
|
| 128 | 128 | EDU()->api->SetValidPayment( EDU()->get_token(), $ebi->EventBooking->EventCustomerLnkID ); |
| 129 | - } else { |
|
| 129 | + } else {
|
|
| 130 | 130 | EDU()->api->SetInvalidPayment( EDU()->get_token(), $ebi->EventBooking->EventCustomerLnkID ); |
| 131 | 131 | } |
| 132 | 132 | |
@@ -144,11 +144,11 @@ discard block |
||
| 144 | 144 | /** |
| 145 | 145 | * @param $bookingInfo EduAdmin_BookingInfo|null $bookingInfo |
| 146 | 146 | */ |
| 147 | - public function process_booking( $bookingInfo = null ) { |
|
| 148 | - if ( 'no' === $this->get_option( 'enabled', 'no' ) ) { |
|
| 147 | + public function process_booking( $bookingInfo = null ) {
|
|
| 148 | + if ( 'no' === $this->get_option( 'enabled', 'no' ) ) {
|
|
| 149 | 149 | return; |
| 150 | 150 | } |
| 151 | - if ( isset( $_POST['act'] ) && 'bookCourse' === $_POST['act'] ) { |
|
| 151 | + if ( isset( $_POST['act'] ) && 'bookCourse' === $_POST['act'] ) {
|
|
| 152 | 152 | $bookingInfo->NoRedirect = true; |
| 153 | 153 | |
| 154 | 154 | $countries = EDUAPI()->OData->Countries->Search(); |
@@ -160,14 +160,14 @@ discard block |
||
| 160 | 160 | $selectedLocale = 'sv-SE'; |
| 161 | 161 | |
| 162 | 162 | $invoiceCountry = $bookingInfo->Customer->InvoiceCountry; |
| 163 | - if ( empty( $invoiceCountry ) ) { |
|
| 163 | + if ( empty( $invoiceCountry ) ) {
|
|
| 164 | 164 | $invoiceCountry = $bookingInfo->Customer->Country; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - foreach ( $countries as $country ) { |
|
| 168 | - if ( $invoiceCountry == $country['CountryName'] ) { |
|
| 167 | + foreach ( $countries as $country ) {
|
|
| 168 | + if ( $invoiceCountry == $country['CountryName'] ) {
|
|
| 169 | 169 | $selectedCountry = $country['CountryCode']; |
| 170 | - if ( ! empty( $country['CultureName'] ) ) { |
|
| 170 | + if ( ! empty( $country['CultureName'] ) ) {
|
|
| 171 | 171 | $selectedLocale = $country['CultureName']; |
| 172 | 172 | } |
| 173 | 173 | break; |
@@ -176,9 +176,9 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | $currency = EDU()->get_option( 'eduadmin-currency', 'SEK' ); |
| 178 | 178 | |
| 179 | - if ( 'no' !== $this->get_option( 'testrun', 'no' ) ) { |
|
| 179 | + if ( 'no' !== $this->get_option( 'testrun', 'no' ) ) {
|
|
| 180 | 180 | $wpConfig = new EduSveaWebPayTestConfig( $this ); |
| 181 | - } else { |
|
| 181 | + } else {
|
|
| 182 | 182 | $wpConfig = new EduSveaWebPayProductionConfig( $this ); |
| 183 | 183 | } |
| 184 | 184 | #$wpOrder = WebPay::createOrder( $wpConfig ); |
@@ -194,21 +194,21 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | $customer = WebPayItem::companyCustomer(); |
| 196 | 196 | |
| 197 | - if ( ! empty( $bookingInfo->Customer->InvoiceName ) ) { |
|
| 197 | + if ( ! empty( $bookingInfo->Customer->InvoiceName ) ) {
|
|
| 198 | 198 | $customer->setCompanyName( $bookingInfo->Customer->InvoiceName ); |
| 199 | - } else { |
|
| 199 | + } else {
|
|
| 200 | 200 | $customer->setCompanyName( $bookingInfo->Customer->CustomerName ); |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | - if ( ! empty( $bookingInfo->Customer->InvoiceAddress1 ) ) { |
|
| 203 | + if ( ! empty( $bookingInfo->Customer->InvoiceAddress1 ) ) {
|
|
| 204 | 204 | $customer->setStreetAddress( $bookingInfo->Customer->InvoiceAddress1 ); |
| 205 | - } else { |
|
| 205 | + } else {
|
|
| 206 | 206 | $customer->setStreetAddress( $bookingInfo->Customer->Address1 ); |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - if ( ! empty( $bookingInfo->Customer->InvoiceZip ) ) { |
|
| 209 | + if ( ! empty( $bookingInfo->Customer->InvoiceZip ) ) {
|
|
| 210 | 210 | $customer->setZipCode( $bookingInfo->Customer->InvoiceZip ); |
| 211 | - } else { |
|
| 211 | + } else {
|
|
| 212 | 212 | $customer->setZipCode( $bookingInfo->Customer->Zip ); |
| 213 | 213 | } |
| 214 | 214 | |
@@ -218,13 +218,13 @@ discard block |
||
| 218 | 218 | ->setIsReadonly( false ); |
| 219 | 219 | $wpOrder->addPresetValue( $zipPreset ); |
| 220 | 220 | |
| 221 | - if ( ! empty( $bookingInfo->Customer->InvoiceCity ) ) { |
|
| 221 | + if ( ! empty( $bookingInfo->Customer->InvoiceCity ) ) {
|
|
| 222 | 222 | $customer->setLocality( $bookingInfo->Customer->InvoiceCity ); |
| 223 | - } else { |
|
| 223 | + } else {
|
|
| 224 | 224 | $customer->setLocality( $bookingInfo->Customer->City ); |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | - if ( ! empty( $bookingInfo->Customer->Phone ) ) { |
|
| 227 | + if ( ! empty( $bookingInfo->Customer->Phone ) ) {
|
|
| 228 | 228 | $customer->setPhoneNumber( $bookingInfo->Customer->Phone ); |
| 229 | 229 | $phonePreset = WebPayItem::presetValue() |
| 230 | 230 | ->setTypeName( \Svea\WebPay\Checkout\Model\PresetValue::PHONE_NUMBER ) |
@@ -233,9 +233,9 @@ discard block |
||
| 233 | 233 | $wpOrder->addPresetValue( $phonePreset ); |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | - if ( ! empty( $bookingInfo->Customer->InvoiceEmail ) ) { |
|
| 236 | + if ( ! empty( $bookingInfo->Customer->InvoiceEmail ) ) {
|
|
| 237 | 237 | $customer->setEmail( $bookingInfo->Customer->InvoiceEmail ); |
| 238 | - } else { |
|
| 238 | + } else {
|
|
| 239 | 239 | $customer->setEmail( $bookingInfo->Customer->Email ); |
| 240 | 240 | } |
| 241 | 241 | |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | |
| 278 | 278 | set_transient( 'eduadmin-sveaorderid-' . $bookingInfo->EventBooking->EventCustomerLnkID, $wpForm['OrderId'], HOUR_IN_SECONDS ); |
| 279 | 279 | |
| 280 | - if ( array_key_exists( 'Gui', $wpForm ) ) { |
|
| 280 | + if ( array_key_exists( 'Gui', $wpForm ) ) {
|
|
| 281 | 281 | echo $wpForm['Gui']['Snippet']; |
| 282 | 282 | } |
| 283 | 283 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | * |
| 107 | 107 | * @return string |
| 108 | 108 | */ |
| 109 | - public function getCheckoutMerchantId($country = NULL) { |
|
| 109 | + public function getCheckoutMerchantId( $country = NULL ) { |
|
| 110 | 110 | $merchantId = $this->plugin->get_option( 'merchant_key', '' ); |
| 111 | 111 | |
| 112 | 112 | return $merchantId; |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | * |
| 118 | 118 | * @return string |
| 119 | 119 | */ |
| 120 | - public function getCheckoutSecret($country = NULL) { |
|
| 120 | + public function getCheckoutSecret( $country = NULL ) { |
|
| 121 | 121 | $secret = $this->plugin->get_option( 'merchant_secret', '' ); |
| 122 | 122 | |
| 123 | 123 | return $secret; |
@@ -1,6 +1,6 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 106 | 107 | * |
| 107 | 108 | * @return string |
| 108 | 109 | */ |
| 109 | - public function getCheckoutMerchantId($country = NULL) { |
|
| 110 | + public function getCheckoutMerchantId($country = NULL) {
|
|
| 110 | 111 | $merchantId = $this->plugin->get_option( 'merchant_key', '' ); |
| 111 | 112 | |
| 112 | 113 | return $merchantId; |
@@ -117,22 +118,22 @@ discard block |
||
| 117 | 118 | * |
| 118 | 119 | * @return string |
| 119 | 120 | */ |
| 120 | - public function getCheckoutSecret($country = NULL) { |
|
| 121 | + public function getCheckoutSecret($country = NULL) {
|
|
| 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 |
||
| 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 |
||
| 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 |
||
| 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; |