<?php
// Set your access token here
$access_token = 'APP_USR-7924565816849832-082312-21941521997fab717db925cf1ea2c190-1071840315';

// Payment data
$payment_data = [
    "transaction_amount" => 100.00,
    "token" => "YOUR_CARD_TOKEN",
    "description" => "Description of the product",
    "installments" => 1,
    "payment_method_id" => "visa",
    "payer" => [
        "email" => "payer_email@example.com"
    ]
];

// Convert the payment data to JSON
$payment_data_json = json_encode($payment_data);

// Initialize cURL
$ch = curl_init();

// Set the cURL options
curl_setopt($ch, CURLOPT_URL, "https://api.mercadopago.com/v1/payments");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $access_token,
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payment_data_json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Execute the cURL request and get the response
$response = curl_exec($ch);

// Check for cURL errors
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
} else {
    // Decode the response
    $response_data = json_decode($response, true);
    // Display the response
    echo '<pre>' . print_r($response_data, true) . '</pre>';
}

// Close the cURL session
curl_close($ch);
?>