PHP 클래스 WC_Payment_Gateway

Extended by individual payment gateways to handle payments.
저자: WooThemes
상속: extends WC_Settings_API
파일 보기 프로젝트 열기: woocommerce/woocommerce 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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.

보호된 프로퍼티들

프로퍼티 타입 설명
$tokens array Contains a users saved tokens for this gateway.

공개 메소드들

메소드 설명
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.

보호된 메소드들

메소드 설명
get_order_total ( ) : float Get the order total in checkout and pay_for_order.

메소드 상세

admin_options() 공개 메소드

Output the gateway settings screen.
public admin_options ( )

credit_card_form() 공개 메소드

Core credit card form which gateways can used if needed. Deprecated - inheirt WC_Payment_Gateway_CC instead.
public credit_card_form ( array $args = [], array $fields = [] )
$args array
$fields array

get_description() 공개 메소드

Return the gateway's description.
public get_description ( ) : string
리턴 string

get_icon() 공개 메소드

Return the gateway's icon.
public get_icon ( ) : string
리턴 string

get_method_description() 공개 메소드

Return the description for admin screens.
public get_method_description ( ) : string
리턴 string

get_method_title() 공개 메소드

Return the title for admin screens.
public get_method_title ( ) : string
리턴 string

get_new_payment_method_option_html() 공개 메소드

Only displayed when a gateway supports tokenization.
부터: 2.6.0

get_order_total() 보호된 메소드

Get the order total in checkout and pay_for_order.
protected get_order_total ( ) : float
리턴 float

get_return_url() 공개 메소드

Get the return url (thank you page).
public get_return_url ( WC_Order $order = null ) : string
$order WC_Order
리턴 string

get_saved_payment_method_option_html() 공개 메소드

Gets saved payment method HTML from a token.
부터: 2.6.0
public get_saved_payment_method_option_html ( WC_Payment_Token $token ) : string
$token WC_Payment_Token Payment Token
리턴 string Generated payment method HTML

get_title() 공개 메소드

Return the gateway's title.
public get_title ( ) : string
리턴 string

get_tokens() 공개 메소드

Returns a users saved tokens for this gateway.
부터: 2.6.0
public get_tokens ( ) : array
리턴 array

get_transaction_url() 공개 메소드

Get a link to the transaction on the 3rd party gateway size (if applicable).
public get_transaction_url ( WC_Order $order ) : string
$order WC_Order the order object.
리턴 string transaction URL, or empty string.

has_fields() 공개 메소드

Check if the gateway has fields on the checkout.
public has_fields ( ) : boolean
리턴 boolean

init_settings() 공개 메소드

Init settings for gateways.
public init_settings ( )

is_available() 공개 메소드

Check if the gateway is available for use.
public is_available ( ) : boolean
리턴 boolean

payment_fields() 공개 메소드

Override this in your gateway if you have some.
public payment_fields ( )

process_payment() 공개 메소드

Process the payment. Override this in your gateway. When implemented, this should. return the success and redirect in an array. e.g: return array( 'result' => 'success', 'redirect' => $this->get_return_url( $order ) );
public process_payment ( integer $order_id ) : array
$order_id integer
리턴 array

process_refund() 공개 메소드

If the gateway declares 'refunds' support, this will allow it to refund. a passed in amount.
public process_refund ( integer $order_id, float $amount = null, string $reason = '' ) : boolean
$order_id integer
$amount float
$reason string
리턴 boolean True or false based on success, or a WP_Error object.

save_payment_method_checkbox() 공개 메소드

Outputs a checkbox for saving a new payment method to the database.
부터: 2.6.0

saved_payment_methods() 공개 메소드

Grab and display our saved payment methods.
부터: 2.6.0

set_current() 공개 메소드

Set this as the current gateway.
public set_current ( )

supports() 공개 메소드

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.
부터: 1.5.7
public supports ( string $feature ) : boolean
$feature string string The name of a feature to test support for.
리턴 boolean True if the gateway supports the feature, false otherwise.

tokenization_script() 공개 메소드

Enqueues our tokenization script to handle some of the new form options.
부터: 2.6.0
public tokenization_script ( )

validate_fields() 공개 메소드

Validate payment fields on the frontend.
public validate_fields ( ) : boolean
리턴 boolean

프로퍼티 상세

$availability 공개적으로 프로퍼티

Available for all counties or specific.
public string $availability
리턴 string

$chosen 공개적으로 프로퍼티

Chosen payment method id.
public bool $chosen
리턴 boolean

$countries 공개적으로 프로퍼티

Countries this gateway is allowed for.
public array $countries
리턴 array

$description 공개적으로 프로퍼티

Payment method description for the frontend.
public string $description
리턴 string

$enabled 공개적으로 프로퍼티

yes or no based on whether the method is enabled.
public string $enabled
리턴 string

$has_fields 공개적으로 프로퍼티

True if the gateway shows fields on the checkout.
public bool $has_fields
리턴 boolean

$icon 공개적으로 프로퍼티

Icon for the gateway.
public string $icon
리턴 string

$max_amount 공개적으로 프로퍼티

Maximum transaction amount, zero does not define a maximum.
public int $max_amount
리턴 integer

$method_description 공개적으로 프로퍼티

Gateway description.
public string $method_description
리턴 string

$method_title 공개적으로 프로퍼티

Gateway title.
public string $method_title
리턴 string

$new_method_label 공개적으로 프로퍼티

Optional label to show for "new payment method" in the payment method/token selection radio selection.
public string $new_method_label
리턴 string

$order_button_text 공개적으로 프로퍼티

Set if the place order button should be renamed on selection.
public string $order_button_text
리턴 string

$supports 공개적으로 프로퍼티

Supported features such as 'default_credit_card_form', 'refunds'.
public array $supports
리턴 array

$title 공개적으로 프로퍼티

Payment method title for the frontend.
public string $title
리턴 string

$tokens 보호되어 있는 프로퍼티

Contains a users saved tokens for this gateway.
protected array $tokens
리턴 array

$view_transaction_url 공개적으로 프로퍼티

Optional URL to view a transaction.
public string $view_transaction_url
리턴 string