# Cancel an authorized payment

This is the operation by which it is possible to cancel an authorised transaction. It may be performed only if M.O.T.O. is set with separate phases.

The WSs2s web service call to use for this purpose is CallDeleteS2S. Click the link to see the API.

However, before using this method, it is necessary to assign to CallDeleteS2S arguments all the information required to securely identify the transaction to be settled.

A transaction may be uniquely identified by the pair shopLogin + bankTransactionId, where shopLogin is the merchant code and bankTransactionId is the code assigned to the transaction by Gestpay.

It is however also possible to use the code assigned to the transaction by the merchant (shopTransactionId), taking care to ascertain that this code uniquely identifies a transaction; otherwise CallDeleteS2S will return an error code referring to a Non-uniquely identified transaction.

To do so it is sufficient to fill the following specific fields:

• shopLogin (merchant code)
• bankTransactionId (GestPay Transaction Identification Code) or shopTransactionId (Merchant Transaction Identification Code)

In order to know the result of this operation it is sufficient to consult the technical result by reading in the following fields in the response:

• ErrorCode (if 0, everything is OK)
• ErrorDescription (contains a textual explanation of the ErrorCode, in the configured language).