Skip to content

Commit cd77190

Browse files
authored
Handle get_payment_method_by_id false value (#11044)
1 parent 86b1fe0 commit cd77190

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fix
3+
4+
Fix possible errors when WooPay is enabled while the store is in Coming Soon mode

includes/class-wc-payments-checkout.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,12 @@ public function get_all_payment_method_config() {
351351
*/
352352
private function get_config_for_payment_method( $payment_method_id, $account_country ) {
353353
$payment_method = $this->gateway->wc_payments_get_payment_method_by_id( $payment_method_id );
354-
$config = [
354+
355+
if ( ! $payment_method ) {
356+
return [];
357+
}
358+
359+
$config = [
355360
'isReusable' => $payment_method->is_reusable(),
356361
'isBnpl' => $payment_method->is_bnpl(),
357362
'title' => $payment_method->get_title( $account_country ),

0 commit comments

Comments
 (0)