Skip to content

Commit

Permalink
Bug fix not-set IDIN brand ID breaking checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
daanrijpkemacb committed Nov 25, 2023
1 parent 6df953d commit 7501991
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bluem-idin.php
Original file line number Diff line number Diff line change
Expand Up @@ -844,11 +844,12 @@ function bluem_idin_shortcode_callback() {
$bluem_config = bluem_woocommerce_get_config();

// fallback until this is corrected in bluem-php
$bluem_config->brandID = $bluem_config->IDINBrandID;
$bluem_config->brandID = $bluem_config->IDINBrandID ?? $bluem_config->brandID ?? '';

try {
$bluem = new Bluem( $bluem_config );
} catch ( Exception $e ) {
return;
// @todo: deal with incorrectly configured Bluem here
}

Expand Down Expand Up @@ -1402,15 +1403,20 @@ function bluem_idin_validation_needed() {

$bluem_config = bluem_woocommerce_get_config();

$bluem_config->brandID = $bluem_config->IDINBrandID;
$bluem_config->brandID = $bluem_config->IDINBrandID ?? $bluem_config->brandID ?? '';

if(empty($bluem_config->brandID)) {
return false;
}

try {
$bluem = new Bluem( $bluem_config );
} catch ( Exception $e ) {
// @todo: deal with non-configured bluem, or assert that is has been configured on a higher level
// @todo: deal with non-configured bluem brandID, or assert that is has been configured on a higher level
return false;
}

// Check if IP filtering is enabled
// Check if IP filtering is enabled
if ( $idin_enable_ip_country_filtering ) {
// override international IP's - don't validate idin when not NL
if ( ! $bluem->VerifyIPIsNetherlands() ) {
Expand Down

0 comments on commit 7501991

Please sign in to comment.