Create cancellation
It is possible to cancel a specific purchase from the payment ID using the SDK below. For details on request parameters, check the Cancellation API.
<?php
MercadoPago\SDK::setAccessToken("YOUR_ACCESS_TOKEN");
$payment_id = 000000000;
$payment = MercadoPago\Payment::find_by_id($payment_id);
$payment->status = "cancelled";
$payment->update();
?>