WooCommerce Code Reference

Buttons
in package

Handles PayPal Buttons.

Tags
since
10.5.0

Table of Contents

CLIENT_ID_OPTION  = 'woocommerce_paypal_client_id'
The option for the client-id.
$enabled  : bool
Whether the gateway should use Orders v2 API.
$gateway  : WC_Gateway_Paypal
The gateway instance.
$request  : Request
The request instance.
__construct()  : mixed
Constructor.
get_client_id()  : string|null
Get the client-id for the PayPal buttons.
get_common_options()  : array<string|int, mixed>
Get the common attributes for the PayPal JS SDK script and modules.
get_current_page_for_app_switch()  : string
Get the current page URL, to be used for App Switch.
get_options()  : array<string|int, mixed>
Get the options for the PayPal buttons.
get_page_type()  : string
Get the page type for the PayPal buttons.
is_enabled()  : bool
Whether PayPal Buttons is enabled.

Constants

Properties

Methods

get_client_id()

Get the client-id for the PayPal buttons.

public get_client_id() : string|null
Tags
since
10.5.0
Return values
string|nullThe PayPal client-id, or null if the request fails.

get_common_options()

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

public get_common_options() : array<string|int, mixed>
Tags
since
10.5.0
Return values
array<string|int, mixed>

get_current_page_for_app_switch()

Get the current page URL, to be used for App Switch.

public get_current_page_for_app_switch() : string

Limited to checkout, cart, and product pages for security.

Tags
since
10.5.0
Return values
string

get_options()

Get the options for the PayPal buttons.

public get_options() : array<string|int, mixed>
Tags
since
10.5.0
Return values
array<string|int, mixed>

get_page_type()

Get the page type for the PayPal buttons.

public get_page_type() : string
Tags
since
10.5.0
Return values
string

is_enabled()

Whether PayPal Buttons is enabled.

public is_enabled() : bool
Tags
since
10.5.0
Return values
bool