Click or drag to resize
Infosoft Logo

IOnlinePaymentServiceCancelPayment Method

Cancels a payment. This may be used either before or after the transaction has been completed.

Namespace: Infosoft.Common.Contracts.ServiceContracts.Economy.Payments
Assembly: Infosoft.Common.Contracts (in Infosoft.Common.Contracts.dll) Version: 4.00.0.0
Syntax

Parameters

request  CancelPaymentRequest
A request object that contains the Infosoft order reference that identifies the transaction.

Return Value

CancelPaymentResponse
A response object that contains the PaymentProcess object that represents the now canceled transaction.
Remarks

If this is called while the transaction is in the "Initialized" state, it will simply set the status to "Canceled" and return. If it's called when the transaction is in the "Completed" state, it will do the above, but only after it has also sent a cancel request to the underlying provider.

The "Initialized" case is mostly useful in situations where the payment window provides a Cancel button that the user can press to "bail out" of the payment. Since a payment has previously been created in the Infosoft database, it's good practice (though not required) to call this method in those cases. Doing so will ensure that the payment entry can never be confused for a completed payment, but will have no effect beyond that.

The "Completed" case is useful if the shop has an "undo" feature for payments that have been authorized but not yet captured. In such cases, the Cancel call is important, since it will cause the monetary reservation made in the customer's bank account to be deleted, in addition to marking the payment as canceled in the Infosoft database.

See Also