Skip to content

Commit

Permalink
Merge pull request #6 from bluem-development/fix-gravity-forms
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanRijpkema authored Dec 5, 2023
2 parents 887fddc + aeb8b4e commit e0daff1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
9 changes: 4 additions & 5 deletions bluem.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,12 @@ function is_contactform7_activated() {
* Check if Gravity Forms is activated
*/
if ( ! function_exists( 'is_gravityforms_activated' ) ) {
function is_gravityforms_activated() {
function is_gravityforms_activated(): bool
{
$active_plugins = get_option( 'active_plugins' );

if ( in_array('gravityforms', $active_plugins) ) {
return true;
}
return false;
return in_array('gravityforms', $active_plugins, true)
|| in_array('gravityforms/gravityforms.php', $active_plugins, true);
}
}

Expand Down
8 changes: 6 additions & 2 deletions gateways/Bluem_Mandates_Payment_Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,11 @@ private function _checkExistingMandate($order)
*/
public function payment_fields()
{
$BICs = $this->bluem->retrieveBICsForContext("Mandates");
if($this->bluem === null) {
return;
}

$BICs = $this->bluem->retrieveBICsForContext( "Mandates" );

$description = $this->get_description();

Expand Down Expand Up @@ -309,7 +313,7 @@ public function validate_fields()
*
* @param String $order_id
*
* @return void
* @return array
*/
public function process_payment($order_id)
{
Expand Down
6 changes: 5 additions & 1 deletion gateways/Bluem_iDEAL_Payment_Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ public function __construct()
*/
public function payment_fields()
{
$BICs = $this->bluem->retrieveBICsForContext("Payments");
if($this->bluem === null) {
return;
}

$BICs = $this->bluem->retrieveBICsForContext( "Payments" );

$description = $this->get_description();

Expand Down

0 comments on commit e0daff1

Please sign in to comment.