Pre authorization
We recommend to use the "pre-authorization" transaction type when expecting 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.
<?php
use Tatrapayplus\TatrapayplusApiClient\Api\TatraPayPlusAPIApi;
$tatrapayplus_api = new TatraPayPlusAPIApi(
"your-client-id",
"your-client-secret",
);
$initiate_payment_request = new Tatrapayplus\TatrapayplusApiClient\Model\InitiatePaymentRequest([
"base_payment" => new Tatrapayplus\TatrapayplusApiClient\Model\BasePayment([
"instructed_amount" => new Tatrapayplus\TatrapayplusApiClient\Model\Amount([
"amount_value" => 10.0,
"currency" => "EUR",
]),
"end_to_end" => new Tatrapayplus\TatrapayplusApiClient\Model\E2e([
"variable_symbol" => "1",
"specific_symbol" => "2",
"constant_symbol" => "3",
]),
]),
"bank_transfer" => new Tatrapayplus\TatrapayplusApiClient\Model\BankTransfer(),
"card_detail" => new Tatrapayplus\TatrapayplusApiClient\Model\CardDetail([
"card_holder" => "Janko Hrasko",
"is_pre_authorization" => true,
]),
]);
$response = $tatrapayplus_api->initiatePayment(
"redirect uri",
$initiate_payment_request,
);
$response["object"]->getPaymentId();
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.
<?php
use Tatrapayplus\TatrapayplusApiClient\Api\TatraPayPlusAPIApi;
use Tatrapayplus\TatrapayplusApiClient\Model\CardPayUpdateInstruction;
$tatrapayplus_api = new TatraPayPlusAPIApi(
"your-client-id",
"your-client-secret",
);
$payment_id = 'b54afd37-5bb9-4080-9416-5ec450779087'; // Retrieved from initiatePayment
$pre_authorization_data = new CardPayUpdateInstruction([
"operation_type" => CardPayUpdateInstruction::OPERATION_TYPE_CANCEL_PRE_AUTHORIZATION,
]);
$response = $tatrapayplus_api->updatePaymentIntent($payment_id, $pre_authorization_data);
// or
$pre_authorization_data = new CardPayUpdateInstruction([
"operation_type" => CardPayUpdateInstruction::OPERATION_TYPE_CONFIRM_PRE_AUTHORIZATION,
]);
$response = $tatrapayplus_api->updatePaymentIntent($payment_id, $pre_authorization_data);