WooCommerce Code Reference

SetWCPaymentGateways extends Step

Class SetWCPaymentGateways

This class sets WooCommerce payment gateways and extends the Step class.

Table of Contents

$payment_gateways  : array<string|int, mixed>
Payment gateways.
__construct()  : mixed
Constructor.
add_payment_gateway()  : mixed
Add a payment gateway.
get_schema()  : array<string|int, mixed>
Get the schema for the step.
get_step_name()  : string
Get the name of the step.
prepare_json_array()  : array<string|int, mixed>
Prepare the JSON array for the step.

Properties

Methods

__construct()

Constructor.

public __construct([array<string|int, mixed> $payment_gateways = array() ]) : mixed
Parameters
$payment_gateways : array<string|int, mixed> = array()

Optional array of payment gateways.

Return values
mixed

add_payment_gateway()

Add a payment gateway.

public add_payment_gateway(string $id, string $title, string $description, string $enabled) : mixed
Parameters
$id : string

The ID of the payment gateway.

$title : string

The title of the payment gateway.

$description : string

The description of the payment gateway.

$enabled : string

Whether the payment gateway is enabled ('yes' or 'no').

Return values
mixed

get_schema()

Get the schema for the step.

public static get_schema([int $version = 1 ]) : array<string|int, mixed>
Parameters
$version : int = 1

Optional version number of the schema.

Return values
array<string|int, mixed>The schema array.