Payment
extends AbstractUniqueEntity
in package
Tags
Table of Contents
- $amount : float
- $bookingId : int
- $currency : string
- $gatewayId : string
- $gatewayMode : string
- $id : int
- $paymentMethod : string
- $status : string
- $transactionId : string
- $uid : string
- Unique identifier. Most likely is UUID v4.
- __construct() : mixed
- addLog() : int|false
- getAmount() : float
- getBooking() : Booking|null
- getExpectingBooking() : Booking|null
- getExpirationTime() : int
- getGateway() : PaymentGatewayInterface|null
- getId() : int
- getLogs() : array<string|int, WP_Comment>
- getUid() : string
- isCompleted() : bool
- isFailed() : bool
- isPending() : bool
- removeExpirationTime() : mixed
- resetExpirationTime() : mixed
- Set the expiration time to current time + pending payment time.
- setExpirationTime() : mixed
- setGatewayMode() : mixed
- setPaymentMethod() : mixed
- setTransactionId() : mixed
- setupFields() : mixed
Properties
$amount
public
float
$amount
= 0.0
Tags
$bookingId
public
int
$bookingId
= 0
Tags
$currency
public
string
$currency
= 'EUR'
Tags
$gatewayId
public
string
$gatewayId
= 'manual'
Tags
$gatewayMode
public
string
$gatewayMode
= \MotoPress\Appointment\MODE_LIVE
Tags
$id
public
int
$id
= 0
Tags
$paymentMethod
public
string
$paymentMethod
= ''
Tags
$status
public
string
$status
= 'new'
Tags
$transactionId
public
string
$transactionId
= ''
Tags
$uid
Unique identifier. Most likely is UUID v4.
public
string
$uid
= ''
Tags
Methods
__construct()
public
__construct(int $id[, array<string|int, mixed> $fieldValues = [] ]) : mixed
Parameters
- $id : int
- $fieldValues : array<string|int, mixed> = []
-
Optional.
Tags
Return values
mixed —addLog()
public
addLog(string $message[, int|null $authorId = null ]) : int|false
Parameters
- $message : string
- $authorId : int|null = null
-
Optional. Current logged in user ID by default.
Tags
Return values
int|false —The new comment's ID on success, false on failure.
getAmount()
public
getAmount() : float
Tags
Return values
float —getBooking()
public
getBooking() : Booking|null
Tags
Return values
Booking|null —getExpectingBooking()
public
getExpectingBooking() : Booking|null
Tags
Return values
Booking|null —getExpirationTime()
public
getExpirationTime() : int
Tags
Return values
int —getGateway()
public
getGateway() : PaymentGatewayInterface|null
Tags
Return values
PaymentGatewayInterface|null —getId()
public
getId() : int
Tags
Return values
int —getLogs()
public
getLogs() : array<string|int, WP_Comment>
Tags
Return values
array<string|int, WP_Comment> —Logs in descending order.
getUid()
public
getUid() : string
Tags
Return values
string —isCompleted()
public
isCompleted() : bool
Tags
Return values
bool —isFailed()
public
isFailed() : bool
Tags
Return values
bool —isPending()
public
isPending() : bool
Tags
Return values
bool —removeExpirationTime()
public
removeExpirationTime() : mixed
Tags
Return values
mixed —resetExpirationTime()
Set the expiration time to current time + pending payment time.
public
resetExpirationTime() : mixed
Tags
Return values
mixed —setExpirationTime()
public
setExpirationTime(int $timestamp) : mixed
Parameters
- $timestamp : int
Tags
Return values
mixed —setGatewayMode()
public
setGatewayMode(mixed $gatewayMode[, mixed $save = false ]) : mixed
Parameters
- $gatewayMode : mixed
- $save : mixed = false
Return values
mixed —setPaymentMethod()
public
setPaymentMethod(string $paymentMethod[, bool|mixed $save = false ]) : mixed
Parameters
- $paymentMethod : string
- $save : bool|mixed = false
-
Optional. Whether to update the post meta. False by default.
Tags
Return values
mixed —setTransactionId()
public
setTransactionId(string $transactionId[, bool|mixed $save = false ]) : mixed
Parameters
- $transactionId : string
- $save : bool|mixed = false
-
Optional. Whether to update the post meta. False by default.
Tags
Return values
mixed —setupFields()
protected
setupFields( $fieldValues) : mixed