PHP Класс WC_Gateway_Paypal

Provides a PayPal Standard Payment Gateway.
Автор: WooThemes
Наследование: extends WC_Payment_Gateway
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$log Logger instance
$log_enabled Whether or not logging is enabled

Открытые методы

Метод Описание
__construct ( ) Constructor for the gateway.
admin_options ( ) Admin Panel Options.
can_refund_order ( WC_Order $order ) : boolean Can the order be refunded via PayPal?
capture_payment ( integer $order_id ) Capture payment when the order is changed from on-hold to complete or processing
get_icon ( ) : string Get gateway icon.
get_transaction_url ( WC_Order $order ) : string Get the transaction URL.
init_form_fields ( ) Initialise Gateway Settings Form Fields.
is_valid_for_use ( ) : boolean Check if this gateway is enabled and available in the user's country.
log ( string $message ) Logging method.
process_payment ( integer $order_id ) : array Process the payment and return the result.
process_refund ( integer $order_id, float $amount = null, string $reason = '' ) : boolean Process a refund if supported.

Защищенные методы

Метод Описание
get_icon_image ( string $country ) : array Get PayPal images for a country.
get_icon_url ( string $country ) : string Get the link for an icon based on country.
init_api ( ) Init the API class and set the username/password etc.

Описание методов

__construct() публичный Метод

Constructor for the gateway.
public __construct ( )

admin_options() публичный Метод

- Options for bits like 'title' and availability on a country-by-country basis.
С версии: 1.0.0
public admin_options ( )

can_refund_order() публичный Метод

Can the order be refunded via PayPal?
public can_refund_order ( WC_Order $order ) : boolean
$order WC_Order
Результат boolean

capture_payment() публичный Метод

Capture payment when the order is changed from on-hold to complete or processing
public capture_payment ( integer $order_id )
$order_id integer

get_icon() публичный Метод

Get gateway icon.
public get_icon ( ) : string
Результат string

get_icon_image() защищенный Метод

Get PayPal images for a country.
protected get_icon_image ( string $country ) : array
$country string
Результат array of image URLs

get_icon_url() защищенный Метод

Get the link for an icon based on country.
protected get_icon_url ( string $country ) : string
$country string
Результат string

get_transaction_url() публичный Метод

Get the transaction URL.
public get_transaction_url ( WC_Order $order ) : string
$order WC_Order
Результат string

init_api() защищенный Метод

Init the API class and set the username/password etc.
protected init_api ( )

init_form_fields() публичный Метод

Initialise Gateway Settings Form Fields.
public init_form_fields ( )

is_valid_for_use() публичный Метод

Check if this gateway is enabled and available in the user's country.
public is_valid_for_use ( ) : boolean
Результат boolean

log() публичный статический Метод

Logging method.
public static log ( string $message )
$message string

process_payment() публичный Метод

Process the payment and return the result.
public process_payment ( integer $order_id ) : array
$order_id integer
Результат array

process_refund() публичный Метод

Process a refund if supported.
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

Описание свойств

$log публичное статическое свойство

Logger instance
public static $log

$log_enabled публичное статическое свойство

Whether or not logging is enabled
public static $log_enabled