WooCommerce Code Reference

PaymentResult
in package

PaymentResult class.

Table of Contents

$payment_details  : array<string|int, mixed>
Array of details about the payment.
$redirect_url  : string
Redirect URL for checkout.
$status  : string
Current payment status.
$valid_statuses  : array<string|int, mixed>
List of valid payment statuses.
__construct()  : mixed
Constructor.
__get()  : mixed
Magic getter for protected properties.
get_payment_details()  : array<string|int, mixed>
Get the payment details.
get_redirect_url()  : string
Get the redirect URL.
get_status()  : string
Get payment status.
set_payment_details()  : mixed
Set payment details.
set_redirect_url()  : mixed
Set redirect URL.
set_status()  : mixed
Set payment status.

Properties

Methods

__construct()

Constructor.

public __construct([string $status = '' ]) : mixed
Parameters
$status : string = ''

Sets the payment status for the result.

Return values
mixed —

get_payment_details()

Get the payment details.

public get_payment_details() : array<string|int, mixed>
Tags
since
11.2.0
Return values
array<string|int, mixed> — Key value pairs the gateway returned, empty when none were set.

get_redirect_url()

Get the redirect URL.

public get_redirect_url() : string
Tags
since
11.2.0
Return values
string — URL the customer is sent to after checkout, empty when none was set.

set_payment_details()

Set payment details.

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

Array of key value pairs of data.

Return values
mixed —

set_redirect_url()

Set redirect URL.

public set_redirect_url([string $redirect_url = '' ]) : mixed
Parameters
$redirect_url : string = ''

URL to redirect the customer to after checkout.

Return values
mixed —

set_status()

Set payment status.

public set_status(string $payment_status) : mixed
Parameters
$payment_status : string

Status to set.

Tags
throws
Exception

When an invalid status is provided.

Return values
mixed —