Cancel payment
This operation can be used with any payment method, but only if it is in authorization_status=NEW.
In the case of payment method PAY_LATER, this method can also be used if authorization_status=AUTH_DONE and at the same time payment status=CUSTOMER_CREATION_IN_PROGRESS.
<?php
use Tatrapayplus\TatrapayplusApiClient\Api\TatraPayPlusAPIApi;
$tatrapayplus_api = new TatraPayPlusAPIApi(
"your-client-id",
"your-client-secret",
);
$payment_id = 'b54afd37-5bb9-4080-9416-5ec450779087'; // Retrieved from initiatePayment
$response = $tatrapayplus_api->cancelPaymentIntent($payment_id);
$response["response"]->getStatusCode(); // 200 or 201 = success