WC_Gateway_Paypal_Buttons
in package
Handles PayPal Buttons.
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 : WC_Gateway_Paypal_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
CLIENT_ID_OPTION
The option for the client-id.
private
string
CLIENT_ID_OPTION
= 'woocommerce_paypal_client_id'
Properties
$enabled
Whether the gateway should use Orders v2 API.
private
bool
$enabled
= alse
$gateway
The gateway instance.
private
WC_Gateway_Paypal
$gateway
$request
The request instance.
private
WC_Gateway_Paypal_Request
$request
Methods
__construct()
Constructor.
public
__construct(WC_Gateway_Paypal $gateway) : mixed
Parameters
- $gateway : WC_Gateway_Paypal
-
The gateway instance.
Return values
mixed —get_client_id()
Get the client-id for the PayPal buttons.
public
get_client_id() : string|null
Return values
string|null — The 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>
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.
Return values
string —get_options()
Get the options for the PayPal buttons.
public
get_options() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_page_type()
Get the page type for the PayPal buttons.
public
get_page_type() : string
Return values
string —is_enabled()
Whether PayPal Buttons is enabled.
public
is_enabled() : bool
