PaymentMethodRegistry
extends IntegrationRegistry
in package
Class used for interacting with payment method types.
Tags
Table of Contents
- $registered_integrations : array<string|int, IntegrationInterface>
- Registered integrations, as `$name => $instance` pairs.
- $registry_identifier : string
- Integration identifier is used to construct hook names and is given when the integration registry is initialized.
- get_all_active_payment_method_script_dependencies() : array<string|int, string>
- Gets an array of all registered payment method script handles, but only for active payment methods.
- get_all_active_registered() : array<string|int, PaymentMethodTypeInterface>
- Retrieves all registered payment methods that are also active.
- get_all_registered() : array<string|int, IntegrationInterface>
- Retrieves all registered integrations.
- get_all_registered_editor_script_handles() : array<string|int, string>
- Gets an array of all registered integration's script handles for the editor.
- get_all_registered_script_data() : array<string|int, mixed>
- Gets an array of all registered payment method script data, but only for active payment methods.
- get_all_registered_script_handles() : array<string|int, string>
- Gets an array of all registered integration's script handles.
- get_registered() : IntegrationInterface|null
- Retrieves a registered Integration by name.
- initialize() : mixed
- Initializes all registered integrations.
- is_registered() : bool
- Checks if an integration is already registered.
- register() : bool
- Registers an integration.
- unregister() : bool|IntegrationInterface
- Un-register an integration.
Properties
$registered_integrations
Registered integrations, as `$name => $instance` pairs.
protected
array<string|int, IntegrationInterface>
$registered_integrations
= []
$registry_identifier
Integration identifier is used to construct hook names and is given when the integration registry is initialized.
protected
string
$registry_identifier
= 'payment_method_type'
Methods
get_all_active_payment_method_script_dependencies()
Gets an array of all registered payment method script handles, but only for active payment methods.
public
get_all_active_payment_method_script_dependencies() : array<string|int, string>
Return values
array<string|int, string> —get_all_active_registered()
Retrieves all registered payment methods that are also active.
public
get_all_active_registered() : array<string|int, PaymentMethodTypeInterface>
Return values
array<string|int, PaymentMethodTypeInterface> —get_all_registered()
Retrieves all registered integrations.
public
get_all_registered() : array<string|int, IntegrationInterface>
Return values
array<string|int, IntegrationInterface> —get_all_registered_editor_script_handles()
Gets an array of all registered integration's script handles for the editor.
public
get_all_registered_editor_script_handles() : array<string|int, string>
Return values
array<string|int, string> —get_all_registered_script_data()
Gets an array of all registered payment method script data, but only for active payment methods.
public
get_all_registered_script_data() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_all_registered_script_handles()
Gets an array of all registered integration's script handles.
public
get_all_registered_script_handles() : array<string|int, string>
Return values
array<string|int, string> —get_registered()
Retrieves a registered Integration by name.
public
get_registered(string $name) : IntegrationInterface|null
Parameters
- $name : string
-
Integration name.
Return values
IntegrationInterface|null — The registered integration, or null if it is not registered.initialize()
Initializes all registered integrations.
public
initialize([string $registry_identifier = '' ]) : mixed
Integration identifier is used to construct hook names and is given when the integration registry is initialized.
Parameters
- $registry_identifier : string = ''
-
Identifier for this registry.
Return values
mixed —is_registered()
Checks if an integration is already registered.
public
is_registered(string $name) : bool
Parameters
- $name : string
-
Integration name.
Return values
bool — True if the integration is registered, false otherwise.register()
Registers an integration.
public
register(IntegrationInterface $integration) : bool
Parameters
- $integration : IntegrationInterface
-
An instance of IntegrationInterface.
Return values
bool — True means registered successfully.unregister()
Un-register an integration.
public
unregister(string|IntegrationInterface $name) : bool|IntegrationInterface
Parameters
- $name : string|IntegrationInterface
-
Integration name, or alternatively a IntegrationInterface instance.