Property | Type | Description | |
---|---|---|---|
$availability | string | Available for all counties or specific. | |
$chosen | boolean | Chosen payment method id. | |
$countries | array | Countries this gateway is allowed for. | |
$description | string | Payment method description for the frontend. | |
$enabled | string | yes or no based on whether the method is enabled. | |
$has_fields | boolean | True if the gateway shows fields on the checkout. | |
$icon | string | Icon for the gateway. | |
$max_amount | integer | Maximum transaction amount, zero does not define a maximum. | |
$method_description | string | Gateway description. | |
$method_title | string | Gateway title. | |
$new_method_label | string | Optional label to show for "new payment method" in the payment method/token selection radio selection. | |
$order_button_text | string | Set if the place order button should be renamed on selection. | |
$supports | array | Supported features such as 'default_credit_card_form', 'refunds'. | |
$title | string | Payment method title for the frontend. | |
$view_transaction_url | string | Optional URL to view a transaction. |
Property | Type | Description | |
---|---|---|---|
$tokens | array | Contains a users saved tokens for this gateway. |
Method | Description | |
---|---|---|
admin_options ( ) | Output the gateway settings screen. | |
credit_card_form ( array $args = [], array $fields = [] ) | Core credit card form which gateways can used if needed. Deprecated - inheirt WC_Payment_Gateway_CC instead. | |
get_description ( ) : string | Return the gateway's description. | |
get_icon ( ) : string | Return the gateway's icon. | |
get_method_description ( ) : string | Return the description for admin screens. | |
get_method_title ( ) : string | Return the title for admin screens. | |
get_new_payment_method_option_html ( ) | Displays a radio button for entering a new payment method (new CC details) instead of using a saved method. | |
get_return_url ( WC_Order $order = null ) : string | Get the return url (thank you page). | |
get_saved_payment_method_option_html ( WC_Payment_Token $token ) : string | Gets saved payment method HTML from a token. | |
get_title ( ) : string | Return the gateway's title. | |
get_tokens ( ) : array | Returns a users saved tokens for this gateway. | |
get_transaction_url ( WC_Order $order ) : string | Get a link to the transaction on the 3rd party gateway size (if applicable). | |
has_fields ( ) : boolean | Check if the gateway has fields on the checkout. | |
init_settings ( ) | Init settings for gateways. | |
is_available ( ) : boolean | Check if the gateway is available for use. | |
payment_fields ( ) | If There are no payment fields show the description if set. | |
process_payment ( integer $order_id ) : array | Process Payment. | |
process_refund ( integer $order_id, float $amount = null, string $reason = '' ) : boolean | Process refund. | |
save_payment_method_checkbox ( ) | Outputs a checkbox for saving a new payment method to the database. | |
saved_payment_methods ( ) | Grab and display our saved payment methods. | |
set_current ( ) | Set as current gateway. | |
supports ( string $feature ) : boolean | Check if a gateway supports a given feature. | |
tokenization_script ( ) | Enqueues our tokenization script to handle some of the new form options. | |
validate_fields ( ) : boolean | Validate frontend fields. |
Method | Description | |
---|---|---|
get_order_total ( ) : float | Get the order total in checkout and pay_for_order. |
public credit_card_form ( array $args = [], array $fields = [] ) | ||
$args | array | |
$fields | array |
public get_description ( ) : string | ||
return | string |
public get_method_description ( ) : string | ||
return | string |
public get_method_title ( ) : string | ||
return | string |
public get_new_payment_method_option_html ( ) |
protected get_order_total ( ) : float | ||
return | float |
public get_return_url ( WC_Order $order = null ) : string | ||
$order | WC_Order | |
return | string |
public get_saved_payment_method_option_html ( WC_Payment_Token $token ) : string | ||
$token | WC_Payment_Token | Payment Token |
return | string | Generated payment method HTML |
public get_tokens ( ) : array | ||
return | array |
public get_transaction_url ( WC_Order $order ) : string | ||
$order | WC_Order | the order object. |
return | string | transaction URL, or empty string. |
public has_fields ( ) : boolean | ||
return | boolean |
public is_available ( ) : boolean | ||
return | boolean |
public payment_fields ( ) |
public process_payment ( integer $order_id ) : array | ||
$order_id | integer | |
return | array |
public save_payment_method_checkbox ( ) |
public saved_payment_methods ( ) |
public tokenization_script ( ) |
public validate_fields ( ) : boolean | ||
return | boolean |
public string $availability | ||
return | string |
public array $countries | ||
return | array |
public string $description | ||
return | string |
public string $enabled | ||
return | string |
public bool $has_fields | ||
return | boolean |
public int $max_amount | ||
return | integer |
public string $method_description | ||
return | string |
public string $new_method_label | ||
return | string |
public string $order_button_text | ||
return | string |
public array $supports | ||
return | array |
protected array $tokens | ||
return | array |
public string $view_transaction_url | ||
return | string |