Class WC_Payment_Gateway

WooCommerce Payment Gateway class

Extended by individual payment gateways to handle payments.

WC_Settings_API
Extended by WC_Payment_Gateway
Abstract
Package: WooCommerce\Abstracts
Category: Abstract Class
Author: WooThemes
Version: 2.1.0
Class: WC_Payment_Gateway
Extends: WC_Settings_API
Located at includes/abstracts/abstract-wc-payment-gateway.php

Methods summary

public string
# get_return_url( string $order = '' )

Get the return url (thank you page)

Get the return url (thank you page)

Parameters

$order
string
$order (default: '')

Returns

string
protected boolean
# get_order_total( )

Get the order total in checkout and pay_for_order.

Get the order total in checkout and pay_for_order.

Returns

boolean
public boolean
# is_available( )

Check If The Gateway Is Available For Use

Check If The Gateway Is Available For Use

Returns

boolean
public boolean
# has_fields( )

has_fields function.

has_fields function.

Returns

boolean
public string
# get_title( )

Return the gateways title

Return the gateways title

Returns

string
public string
# get_description( )

Return the gateways description

Return the gateways description

Returns

string
public string
# get_icon( )

get_icon function.

get_icon function.

Returns

string
public
# set_current( )

Set As Current Gateway.

Set As Current Gateway.

Set this as the current gateway.

public
# process_payment( integer $order_id )

Process Payment

Process Payment

Process the payment. Override this in your gateway.

Parameters

$order_id
integer
$order_id
public boolean
# validate_fields( )

Validate Frontend Fields

Validate Frontend Fields

Validate payment fields on the frontend.

Returns

boolean
public
# payment_fields( )

If There are no payment fields show the description if set. Override this in your gateway if you have some.

If There are no payment fields show the description if set. Override this in your gateway if you have some.

public boolean
# supports( mixed $feature )

Check if a gateway supports a given feature.

Check if a gateway supports a given feature.

Gateways should override this to declare support (or lack of support) for a feature. For backward compatibility, gateways support 'products' by default, but nothing else.

Parameters

$feature
mixed
$feature string The name of a feature to test support for.

Returns

boolean
True if the gateway supports the feature, false otherwise.

Since

1.5.7
public
# credit_card_form( array $args = array(), mixed $fields = array() )

Core credit card form which gateways can used if needed.

Core credit card form which gateways can used if needed.

Parameters

$args
array
$args
$fields

Methods inherited from WC_Settings_API

admin_options(), display_errors(), format_settings(), generate_checkbox_html(), generate_decimal_html(), generate_multiselect_html(), generate_password_html(), generate_price_html(), generate_select_html(), generate_settings_html(), generate_text_html(), generate_textarea_html(), generate_title_html(), get_custom_attribute_html(), get_description_html(), get_form_fields(), get_option(), get_tooltip_html(), init_form_fields(), init_settings(), process_admin_options(), validate_checkbox_field(), validate_decimal_field(), validate_multiselect_field(), validate_password_field(), validate_price_field(), validate_select_field(), validate_settings_fields(), validate_text_field(), validate_textarea_field()

Magic methods summary

Properties summary

public string $id
#

Payment method ID.

Payment method ID.

public string $order_button_text
#

Set if the place order button should be renamed on selection.

Set if the place order button should be renamed on selection.

public string $title
#

Payment method title.

Payment method title.

public string $chosen
#

Chosen payment method id.

Chosen payment method id.

public boolean $has_fields
#

True if the gateway shows fields on the checkout.

True if the gateway shows fields on the checkout.

public array $countries
#

Array of countries this gateway is allowed for.

Array of countries this gateway is allowed for.

public string $availability
#

Available for all counties or specific.

Available for all counties or specific.

public string $enabled
#

'yes' if the method is enabled.

'yes' if the method is enabled.

public string $icon
#

Icon for the gateway.

Icon for the gateway.

public string $description
#

Description for the gateway.

Description for the gateway.

public array $supports
#

Array of supported features such as 'default_credit_card_form'

Array of supported features such as 'default_credit_card_form'

public integer $max_amount
#

Maximum transaction amount, zero does not define a maximum

Maximum transaction amount, zero does not define a maximum

Properties inherited from WC_Settings_API

$errors, $form_fields, $plugin_id, $sanitized_fields, $settings

WooCommerce API documentation generated by ApiGen 2.8.0