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
$order
Order object for the order being paid.
protected
WC_Order
$order
$payment_data
Holds data to send to the payment gateway to support payment.
protected
array<string|int, mixed>
$payment_data
= []
$payment_method
Payment method ID.
protected
string
$payment_method
= ''
Methods
__get()
Magic getter for protected properties.
public
__get(string $name) : mixed
Parameters
- $name : string
-
Property name.
Return values
mixed —get_payment_method_instance()
Retrieve the payment method instance for the current set payment method.
public
get_payment_method_instance() : WC_Payment_Gateway|null
Return values
WC_Payment_Gateway|null — An instance of the payment gateway if it exists.set_order()
Set the order context.
public
set_order(WC_Order $order) : mixed
Parameters
- $order : WC_Order
-
Order object.
Return values
mixed —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.