PHP Class WC_Gateway_Paypal

Provides a PayPal Standard Payment Gateway.
Author: WooThemes
Inheritance: extends WC_Payment_Gateway
Afficher le fichier Open project: woocommerce/woocommerce Class Usage Examples

Méthodes publiques

Свойство Type Description
$log Logger instance
$log_enabled Whether or not logging is enabled

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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 méthode

Constructor for the gateway.
public __construct ( )

admin_options() public méthode

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

can_refund_order() public méthode

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

capture_payment() public méthode

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 méthode

Get gateway icon.
public get_icon ( ) : string
Résultat string

get_icon_image() protected méthode

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

get_icon_url() protected méthode

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

get_transaction_url() public méthode

Get the transaction URL.
public get_transaction_url ( WC_Order $order ) : string
$order WC_Order
Résultat string

init_api() protected méthode

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

init_form_fields() public méthode

Initialise Gateway Settings Form Fields.
public init_form_fields ( )

is_valid_for_use() public méthode

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

log() public static méthode

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

process_payment() public méthode

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

process_refund() public méthode

Process a refund if supported.
public process_refund ( integer $order_id, float $amount = null, string $reason = '' ) : boolean
$order_id integer
$amount float
$reason string
Résultat 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