Filter
rpress_payment_gateways
On this page
Filters the registered payment gateways.
Runs in rpress_get_payment_gateways after the built-in gateways (paypal, manual and cash_on_delivery) are defined. Each entry is keyed by gateway ID and holds the arrays admin_label and checkout_label, plus an optional supports list. Add an entry to register a gateway, then handle the checkout with an action named rpress_gateway_ followed by the gateway ID.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$gateways | array | Gateways keyed by ID, each with 'admin_label', 'checkout_label' and optionally 'supports'. |
Return value#
array. The registered gateways.
Example#
function my_register_gateway( $gateways ) {
$gateways['my_gateway'] = array(
'admin_label' => __( 'My Gateway', 'my-plugin' ),
'checkout_label' => __( 'Pay with My Gateway', 'my-plugin' ),
);
return $gateways;
}
add_filter( 'rpress_payment_gateways', 'my_register_gateway', 10, 1 );
Notes#
A registered gateway only appears at checkout when it is also enabled in the gateways setting.
Source#
Applied in:
includes/gateways/functions.php(line 44), inrpress_get_payment_gateways()
See also#
Was this page helpful?
