mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
♻️ Extend payment method definition response
This commit is contained in:
parent
c854c8dceb
commit
093e6ff1b2
1 changed files with 7 additions and 3 deletions
|
@ -92,17 +92,21 @@ class PaymentMethodsDefinition {
|
||||||
private function define_common_fields( string $gateway_id, string $title, string $description, string $icon ) : array {
|
private function define_common_fields( string $gateway_id, string $title, string $description, string $icon ) : array {
|
||||||
$gateway = $this->wc_gateways[ $gateway_id ] ?? null;
|
$gateway = $this->wc_gateways[ $gateway_id ] ?? null;
|
||||||
|
|
||||||
|
$gateway_title = $gateway ? $gateway->get_title() : $title;
|
||||||
|
$gateway_description = $gateway ? $gateway->get_description() : $description;
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'id' => $gateway_id,
|
'id' => $gateway_id,
|
||||||
'title' => $title,
|
'enabled' => wc_string_to_bool( $gateway ? $gateway->enabled : '' ),
|
||||||
'description' => $description,
|
'title' => str_replace( '&', '&', $gateway_title ),
|
||||||
|
'description' => $gateway_description,
|
||||||
'icon' => $icon,
|
'icon' => $icon,
|
||||||
'itemTitle' => $title,
|
'itemTitle' => $title,
|
||||||
'itemDescription' => $description,
|
'itemDescription' => $description,
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'checkoutPageTitle' => array(
|
'checkoutPageTitle' => array(
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'default' => $gateway ? $gateway->get_title() : '',
|
'default' => $gateway_title,
|
||||||
'label' => __( 'Checkout page title', 'woocommerce-paypal-payments' ),
|
'label' => __( 'Checkout page title', 'woocommerce-paypal-payments' ),
|
||||||
),
|
),
|
||||||
'checkoutPageDescription' => array(
|
'checkoutPageDescription' => array(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue