♻️ Extend payment method definition response

This commit is contained in:
Philipp Stracker 2025-02-13 19:38:08 +01:00
parent c854c8dceb
commit 093e6ff1b2
No known key found for this signature in database

View file

@ -92,17 +92,21 @@ class PaymentMethodsDefinition {
private function define_common_fields( string $gateway_id, string $title, string $description, string $icon ) : array {
$gateway = $this->wc_gateways[ $gateway_id ] ?? null;
$gateway_title = $gateway ? $gateway->get_title() : $title;
$gateway_description = $gateway ? $gateway->get_description() : $description;
return array(
'id' => $gateway_id,
'title' => $title,
'description' => $description,
'enabled' => wc_string_to_bool( $gateway ? $gateway->enabled : '' ),
'title' => str_replace( '&', '&', $gateway_title ),
'description' => $gateway_description,
'icon' => $icon,
'itemTitle' => $title,
'itemDescription' => $description,
'fields' => array(
'checkoutPageTitle' => array(
'type' => 'text',
'default' => $gateway ? $gateway->get_title() : '',
'default' => $gateway_title,
'label' => __( 'Checkout page title', 'woocommerce-paypal-payments' ),
),
'checkoutPageDescription' => array(