CancelPayout
The CancelPayout
-CUWO is responsible for reverting any grant a GrantPayout
-CUWO may have performed before failing (or on failure on the enforePOS side after successful CUWO execution).
As it cannot be guaranteed that the cancelation can be performed, the CUWO may return payout processing data as part of a failure result. That data will be stored as part of the payout request (which will be marked as failed) on the enfore side, so that the payout request on the enfore side and the transaction on the external side can be manually reconciled.
This type of CUWO is invoked when:
- A
GrantPayout
-CUWO failed (to ensure that the potentially granted amount is reverted) - A
GrantPayout
-CUWO returned with "success" but the subsequent processing of the payout request was canceled or failed on the enforePOS side.
Workflow parameters
The CancelPayout
-CUWO will receive a CancelPayoutWorkflowParameters
structure as input.
The structure is defined as:
/**
* The parameter/input structure for a "cancel payout" workflow.
*/
class CancelPayoutWorkflowParameters extends WorkflowParameters {
readonly "@type" : string = "n4.cuwo.workflows.paymentsandpayouts.cancelpayout.CancelPayoutWorkflowParameters";
/**
* The ID of the payout request whose payout is to be canceled.
*/
public payoutRequestID : string;
/**
* The payout reference of the payout to cancel as provided
* by the GrantPayout/RevertPayment workflow.
*/
public payoutReference? : string;
/**
* The payout processing data of the payout to cancel as
* provided by the GrantPayout/RevertPayment workflow.
*/
public payoutProcessingData? : string;
}
Success result
On success, the CancelPayout
-CUWO is expected to pass a CancelPayoutWorkflowResult
structure to terminateSuccess
.
The structure is defined as:
/**
* The result/output structure for a successful "cancel payout" workflow.
*/
class CancelPayoutWorkflowResult extends WorkflowResult {
readonly "@type" : string = "n4.cuwo.workflows.paymentsandpayouts.cancelpayout.CancelPayoutWorkflowResult";
/**
* Optional update for the payout processing data of the payout.
*
* When provided, replaces the previously stored payout processing
* data. When not provided, a previously stored payout processing
* data stays unchanged.
*/
public payoutProcessingData? : string;
}
Failure result
On failure, the CancelPayout
-CUWO is expected to pass a CancelPayoutWorkflowFailure
structure to terminateFailure
.
The structure is defined as:
/**
* The result/output structure for a failed "cancel payout" workflow.
*/
class CancelPayoutWorkflowFailure extends WorkflowFailure {
readonly "@type" : string = "n4.cuwo.workflows.paymentsandpayouts.cancelpayout.CancelPayoutWorkflowFailure";
/**
* The reason for the failure.
*/
public failureReason : CancelPayoutWorkflowFailureReason;
/**
* A failure code specific to the payment method.
*
* The enfore platform simply stores that code and displays it to the user but does
* not understand it or base any processing on it.
*
* This enables storing a short error identifier from an external system in a way
* that allows it to be shown in the enforePOS sales/payment history UI.
*/
public failureCode? : string;
/**
* Optional update for the payout processing data of the payout.
*
* When provided, replaces the previously stored payout processing
* data. When not provided, a previously stored payout processing
* data stays unchanged.
*/
public payoutProcessingData? : string;
}
Cancelation result
The CancelPayout
workflow does not support cancelation.