PHP Class WC_Gateway_Paypal

Provides a PayPal Standard Payment Gateway.
Author: WooThemes
Inheritance: extends WC_Payment_Gateway
ファイルを表示 Open project: woocommerce/woocommerce Class Usage Examples

Public Properties

Property Type Description
$log Logger instance
$log_enabled Whether or not logging is enabled

Public Methods

Method Description
__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.

Protected Methods

Method Description
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.

Method Details

__construct() public method

Constructor for the gateway.
public __construct ( )

admin_options() public method

- Options for bits like 'title' and availability on a country-by-country basis.
Since: 1.0.0
public admin_options ( )

can_refund_order() public method

Can the order be refunded via PayPal?
public can_refund_order ( WC_Order $order ) : boolean
$order WC_Order
return boolean

capture_payment() public method

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() public method

Get gateway icon.
public get_icon ( ) : string
return string

get_icon_image() protected method

Get PayPal images for a country.
protected get_icon_image ( string $country ) : array
$country string
return array of image URLs

get_icon_url() protected method

Get the link for an icon based on country.
protected get_icon_url ( string $country ) : string
$country string
return string

get_transaction_url() public method

Get the transaction URL.
public get_transaction_url ( WC_Order $order ) : string
$order WC_Order
return string

init_api() protected method

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

init_form_fields() public method

Initialise Gateway Settings Form Fields.
public init_form_fields ( )

is_valid_for_use() public method

Check if this gateway is enabled and available in the user's country.
public is_valid_for_use ( ) : boolean
return boolean

log() public static method

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

process_payment() public method

Process the payment and return the result.
public process_payment ( integer $order_id ) : array
$order_id integer
return array

process_refund() public method

Process a refund if supported.
public process_refund ( integer $order_id, float $amount = null, string $reason = '' ) : boolean
$order_id integer
$amount float
$reason string
return boolean True or false based on success, or a WP_Error object

Property Details

$log public_oe static_oe property

Logger instance
public static $log

$log_enabled public_oe static_oe property

Whether or not logging is enabled
public static $log_enabled