Automattic\WooCommerce\Gateways\PayPal

Buttons::get_common_optionspublicWC 10.5.0

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

Method of the class: Buttons{}

No Hooks.

Returns

Array.

Usage

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

Changelog

Since 10.5.0 Introduced.

Buttons::get_common_options() code WC 10.8.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,
	);
}