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 is_pre_authorization: true while initiating payment.
from tatrapayplus.client import TBPlusSDK
from tatrapayplus.models import *
client = TBPlusSDK(
"your-client-id",
"your-client-secret",
)
payment_data = InitiatePaymentRequest(
base_payment=BasePayment(
instructed_amount=Amount(
amount_value=120.0,
currency="EUR",
),
end_to_end="ORDER123456",
),
card_detail=CardDetail(
is_pre_authorization=True,
card_holder="Janko Hruska",
),
bank_transfer=BankTransfer(),
)
response = client.create_payment(payment_data, "https://your-redirect-uri.com", "127.0.0.1")
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.
from tatrapayplus.client import TBPlusSDK
from tatrapayplus.models import *
client = TBPlusSDK(
"your-client-id",
"your-client-secret"
)
payment_id = "b54afd37-5bb9-4080-9416-5ec450779087"
cancel_pre_authorization_data = CardPayUpdateInstruction(
operation_type=CardPayUpdateInstructionOperationType.CANCEL_PRE_AUTHORIZATION,
)
chargeback_response = client.update_payment(payment_id, cancel_pre_authorization_data)
# or
cancel_pre_authorization_data = CardPayUpdateInstruction(
operation_type=CardPayUpdateInstructionOperationType.CONFIRM_PRE_AUTHORIZATION,
)
chargeback_response = client.update_payment(payment_id, cancel_pre_authorization_data)