See also the Dispute response object.
You can only finalize disputes that have a status
of Open
. This will submit the evidence to the banks and update the status to Disputed
.
Node.js
const result = gateway.dispute.finalize("a_dispute_id");
If the dispute is successfully finalized, the result will be successful. Otherwise, check for validation errors.
Node.js
result.then((response) => {
if (response.success) {
// dispute successfully finalized
} else {
const deepErrors = response.errors.deepErrors();
for (const i in deepErrors) {
if (deepErrors.hasOwnProperty(i)) {
console.log(deepErrors[i].code);
console.log(deepErrors[i].message);
console.log(deepErrors[i].attribute);
}
}
}
});
If the dispute can't be found, it will return a notFoundError
.
Arguments
disputeId
required, String
The unique dispute identifier. You can only finalize disputes that have a status
of Open
.