Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/wc-easycredit/includes/ExpressCheckout.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function add_button_in_cart()
></easycredit-express-button>';
}

protected function payment_types_to_be_displayed_at_product()
protected function payment_types_to_be_displayed_at_product(): array
{
$post = get_post();

Expand All @@ -171,19 +171,19 @@ protected function payment_types_to_be_displayed_at_product()
return $this->get_enabled_payment_types('express_checkout_detail_enabled');
}

protected function payment_types_to_be_displayed_in_cart()
protected function payment_types_to_be_displayed_in_cart(): array
{
if (
trim($this->plugin->get_option('api_key')) == '' ||
WC()->cart->get_total('raw') === 0 ||
!is_cart()
) {
return false;
return [];
}
return $this->get_enabled_payment_types('express_checkout_cart_enabled');
}

protected function get_enabled_payment_types($configKey)
protected function get_enabled_payment_types($configKey): array
{
return array_filter(array_map(function ($method) use ($configKey) {
return $this->plugin->get_option($configKey) === 'yes' &&
Expand Down