Skip to content

Commit

Permalink
Prevent PHP error if response is missing data. (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntzrbtr authored Oct 31, 2023
1 parent 50fe61b commit ecc3b5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Service/PaymentMethodsFilterService.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public function getAvailableGiftcards(

public function filterAdyenPaymentMethodsByType(array $paymentMethodsResponse, string $type): array
{
return array_filter($paymentMethodsResponse['paymentMethods'], function ($item) use ($type) {
return array_filter($paymentMethodsResponse['paymentMethods'] ?? [], function ($item) use ($type) {
return $item['type'] === $type;
});
}
Expand Down

0 comments on commit ecc3b5c

Please sign in to comment.