Skip to content

Commit 0efb59f

Browse files
committed
fix: add has_fields() method to CC gateway for component mode visibility
The has_fields property was set to false which prevented payment_fields() from being called in component mode. Added has_fields() method that returns true when in component mode or when tokenization is enabled. This fixes the issue where cardholder name input and card input container were not rendered in classic checkout when title was hidden/disabled.
1 parent bcfa80f commit 0efb59f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Gateways/PaymentMethods/WCGatewayMoneiCC.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,15 @@ protected function create_zero_eur_payload() {
315315
return $payload;
316316
}
317317

318+
/**
319+
* Check if gateway has fields.
320+
* @return bool
321+
*/
322+
public function has_fields() {
323+
// Always show fields for component mode or when tokenization is enabled
324+
return ! $this->redirect_flow || $this->tokenization;
325+
}
326+
318327
/**
319328
* Payments fields, shown on checkout or payment method page (add payment method).
320329
*/

0 commit comments

Comments
 (0)