Skip to content

Commit

Permalink
Merge pull request #8 from pronamic/7-php-warning-invalid-argument-su…
Browse files Browse the repository at this point in the history
…pplied-for-foreach-when-enriching-payment-methods

Check `Services` property before using it.
  • Loading branch information
remcotolsma authored Sep 30, 2022
2 parents 64bc74f + ccfe0c4 commit d399134
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,22 @@ private function maybe_enrich_payment_methods() {
$payment_method->set_status( 'inactive' );
}

foreach ( $buckaroo_transaction_specifications->Services as $service ) {
$payment_method_id = PaymentMethods::from_buckaroo_to_pronamic( $service->Name );
if ( null !== $buckaroo_transaction_specifications->Services ) {
foreach ( $buckaroo_transaction_specifications->Services as $service ) {
$payment_method_id = PaymentMethods::from_buckaroo_to_pronamic( $service->Name );

if ( null === $payment_method_id ) {
continue;
}
if ( null === $payment_method_id ) {
continue;
}

$payment_method = $this->get_payment_method( $payment_method_id );
$payment_method = $this->get_payment_method( $payment_method_id );

if ( null === $payment_method ) {
continue;
}
if ( null === $payment_method ) {
continue;
}

$payment_method->set_status( 'active' );
$payment_method->set_status( 'active' );
}
}

/**
Expand Down

0 comments on commit d399134

Please sign in to comment.