Automattic\WooCommerce\Gateways\PayPal

Buttons::get_common_optionspublicWC 10.5.0

Get the common attributes for the PayPal JS SDK script and modules.

Метод класса: Buttons{}

Хуков нет.

Возвращает

Массив.

Использование

$Buttons = new Buttons();
$Buttons->get_common_options(): array;

Список изменений

С версии 10.5.0 Введена.

Код Buttons::get_common_options() WC 11.0.1

public function get_common_options(): array {
	$intent = $this->gateway->get_option( 'paymentaction' ) === 'authorization' ? 'authorize' : 'capture';

	return array(
		'client-id'       => $this->get_client_id(),
		'components'      => 'buttons,funding-eligibility,messages',
		'disable-funding' => 'card,applepay',
		'enable-funding'  => 'venmo,paylater',
		'currency'        => get_woocommerce_currency(),
		'intent'          => $intent,
		'merchant-id'     => $this->gateway->email,
	);
}