Skip to content
Last updated

WHMCS\Billing\Payment\DisputeInterface

Interface

DisputeInterface is used as part of the WHMCS\Billing\Payment\Dispute object to ensure that all required methods are present for output. Utilise the factory method to initialise the DisputeInterface object that will be added to a DisputeCollection object in your custom gateway module.

Methods

factory

public static function factory(string $id, float $amount, string $currencyCode, string $transactionId, Carbon $createdDate, Carbon $respondBy, string $reason, string $status): DisputeInterface

Factory method for a Dispute to create the object with the minimum required information to display a dispute within WHMCS.

Parameters

TypeNameDescription
string$id
float$amount
string$currencyCode
string$transactionId
Carbon$createdDate
Carbon$respondBy
string$reason
string$status

Returns DisputeInterface

setEvidence

public function setEvidence(array $evidence): DisputeInterface

Set an array of evidence. The evidence array format requires each item have a name and value.

Sanitization contract: when an item's value is a string, it is echoed as raw HTML by the admin dispute view in order to preserve formatting markup. Any gateway-supplied (tainted) fields that the module interpolates into that string MUST therefore be encoded by the module before being passed in — for example with \WHMCS\Input\Sanitize::encode(). When value is an array of the shape ['url' => ..., 'filename' => ...], both fields are encoded at the view sink and no module-side encoding is required.

Parameters

TypeNameDescription
array$evidence

Returns self

setEvidenceType

public function setEvidenceType(string $evidenceKey, string $evidenceType): DisputeInterface

Override an evidence type from 'text' to one of 'file' or 'textarea'. Any $evidenceKey provided in setEvidence will default to the type of text.

Parameters

TypeNameDescription
string$evidenceKey
string$evidenceType

Returns self

setGateway

public function setGateway(string $gateway): DisputeInterface

Set the gateway module filename for the dispute for additional loading when viewing a specific dispute.

Parameters

TypeNameDescription
string$gateway

Returns self

setIsClosable

public function setIsClosable(bool $closable): DisputeInterface

Set whether the dispute is closable. This will show the close button on a dispute when set to true.

Parameters

TypeNameDescription
bool$closable

Returns DisputeInterface

setIsSubmittable

public function setIsSubmittable(bool $submittable): DisputeInterface

Set whether the dispute is submittable. This will show the submit dispute button on a dispute when set to true.

Parameters

TypeNameDescription
bool$submittable

Returns DisputeInterface

setIsUpdatable

public function setIsUpdatable(bool $updatable): DisputeInterface

Set whether the dispute is updatable. This will show the update dispute button on a dispute when set to true allowing evidence to be submitted.

Parameters

TypeNameDescription
bool$updatable

Returns DisputeInterface

setTransactionId

public function setTransactionId(string $transactionId): DisputeInterface

Set the related transaction id for the dispute.

Parameters

TypeNameDescription
string$transactionId

Returns DisputeInterface