Skip to content

Commit 8d73114

Browse files
authored
Merge pull request #180 from paynl/feature/PLUG-4890
PLUG-4890 - Remove old SDK call
2 parents 637ca2e + a7b5e7b commit 8d73114

3 files changed

Lines changed: 4 additions & 25 deletions

File tree

includes/classes/PPMFWC/Gateway/Abstract.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,11 @@ public function init_form_fields()
332332
$payDefaults = array();
333333
}
334334

335-
$this->set_option_default('brand_id', (isset($payDefaults['brand']['id'])) ? $payDefaults['brand']['id'] : '', true);
336-
$this->set_option_default('min_amount', (isset($payDefaults['min_amount'])) ? floatval($payDefaults['min_amount'] / 100) : '', false);
337-
$this->set_option_default('max_amount', (isset($payDefaults['max_amount'])) ? floatval($payDefaults['max_amount'] / 100) : '', false);
335+
$this->set_option_default('brand_id', (isset($payDefaults->brand->id)) ? $payDefaults->brand->id : '', true);
336+
$this->set_option_default('min_amount', (isset($payDefaults->min_amount)) ? floatval($payDefaults->min_amount / 100) : '', false);
337+
$this->set_option_default('max_amount', (isset($payDefaults->max_amount)) ? floatval($payDefaults->max_amount / 100) : '', false);
338338

339-
$pubDesc = isset($payDefaults['brand']['public_description']) ? $payDefaults['brand']['public_description'] : sprintf(esc_html(__('Pay with %s', PPMFWC_WOOCOMMERCE_TEXTDOMAIN)), $this->getName()); // phpcs:ignore
339+
$pubDesc = (isset($payDefaults->brand->public_description)) ? $payDefaults->brand->public_description : sprintf(esc_html(__('Pay with %s', PPMFWC_WOOCOMMERCE_TEXTDOMAIN)), $this->getName()); // phpcs:ignore
340340
$this->set_option_default('description', $pubDesc, true);
341341
}
342342
} else {

includes/classes/PPMFWC/Setup.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -166,22 +166,4 @@ private static function checkRequirements()
166166
wp_die(esc_html($error), esc_html($title), array('back_link' => true));
167167
}
168168
}
169-
170-
/**
171-
* @return void|boolean
172-
*/
173-
public static function ppmfwc_testConnection()
174-
{
175-
# Only run this if the setting is not saved
176-
if (get_option('paynl_verify_peer') === false) {
177-
try {
178-
# Test the connection using a dummy IP
179-
\Paynl\Validate::isPayServerIp('10.20.30.40');
180-
add_option('paynl_verify_peer', 'yes');
181-
} catch (Exception $e) {
182-
add_option('paynl_verify_peer', 'no');
183-
return false;
184-
}
185-
}
186-
}
187169
}

woocommerce-payment-paynl.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@
4848
# Register PAY gateway in WooCommerce
4949
PPMFWC_Gateways::ppmfwc_register();
5050

51-
# Test if Pay. can be reached
52-
PPMFWC_Setup::ppmfwc_testConnection();
53-
5451
# Register checkoutFlash
5552
PPMFWC_Gateways::ppmfwc_registerCheckoutFlash();
5653

0 commit comments

Comments
 (0)