Chargeback
The merchant can also make a full or partial return of the transaction through CardPay. Returns can only be made on successful payments, including completed pre-authorisations, as well as on payments on which a return has already been made, and the amount of the return must not exceed the original amount of the payment (in the case of a pre-authorisation, it is the amount with which the pre-authorisation was confirmed).
<?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
$chargeback_data = new CardPayUpdateInstruction([
"operation_type" => CardPayUpdateInstruction::OPERATION_TYPE_CHARGEBACK,
"amount" => 3.0,
]);
$response = $tatrapayplus_api->updatePaymentIntent($payment_id, $chargeback_data);
$response["response"]->getStatusCode(); // 200 or 201 = success