WooCommerce Code Reference

PaymentContext
in package

PaymentContext class.

Table of Contents

$order  : WC_Order
Order object for the order being paid.
$payment_data  : array<string|int, mixed>
Holds data to send to the payment gateway to support payment.
$payment_method  : string
Payment method ID.
__get()  : mixed
Magic getter for protected properties.
get_payment_method_instance()  : WC_Payment_Gateway|null
Retrieve the payment method instance for the current set payment method.
set_order()  : mixed
Set the order context.
set_payment_data()  : mixed
Set payment data context.
set_payment_method()  : mixed
Set the chosen payment method ID context.

Properties

Methods

set_payment_data()

Set payment data context.

public set_payment_data([array<string|int, mixed> $payment_data = [] ]) : mixed
Parameters
$payment_data : array<string|int, mixed> = []

Array of key value pairs of data.

Return values
mixed

set_payment_method()

Set the chosen payment method ID context.

public set_payment_method(string $payment_method) : mixed
Parameters
$payment_method : string

Payment method ID.

Return values
mixed