Skip to main content

Pre authorization

We recommend to use the "pre-authorization" transaction type in case of the assumption of an increased number of cancellation requests or partial cancellation of payments due to unavailability of goods/services, changes in the price of the order, etc. If you want to use pre-authorization for card payments you can pass isPreAuthorization: true while initiating payment.

const availablePaymentMethods = await sdk.createPayment(
{
userData: {
firstName: "Jozko",
lastName: "Hruska",
phone: "+421911123456",
},
cardDetail: {
cardHolder: "Jozko Hruska",
isPreAuthorization: true,
},
basePayment: {
endToEnd: "/VS0123456789/SS0123456789/KS123456",
instructedAmount: {
amountValue: 10000,
currency: "EUR",
},
},
},
REDIRECT_URI,
);

In case of payment by pre-authorisation, the merchant is obliged to ensure the termination/cancellation of the pre-authorisation by calling the online interface within 7 days from the date on which the pre-authorisation was made. If the merchant performs a pre-authorisation transaction for the purpose of registering the card for ComfortPay, the transaction will not be cleared and will be released to the cardholder by the cardholder's bank within a few days. We do not recommend making a subsequent reversal of this type of transaction. This is due to the authorization message containing all the information for a future recurring payment. There is a risk that the customer's bank will not retain this information as part of the cancellation of the transaction.

const paymentId = "b54afd37-5bb9-4080-9416-5ec450779087";
const cancelPreAuthorization = await sdk.updatePayment(paymentId, {
operationType: "CANCEL_PRE_AUTHORIZATION",
});
// or
const confirmPreAuthorization = await sdk.updatePayment(paymentId, {
operationType: "CONFIRM_PRE_AUTHORIZATION",
});