<commit_before><?php

$body = file_get_contents('php://input');
$event_json = json_decode($body);

if ($event_json->type == 'charge.paid'){
 
 //Hacer algo con la información como actualizar los atributos de la orden en tu base de datos
 
 //charge = $this->Charge->find('first', array(
 
 //  'conditions' => array('Charge.id' => $event_json->object->id)
 
 //))
    
    echo $event_json->object->id;
    echo $event_json->object->status;
    echo $event_json->object->amount;
    
    http_response_code(200);
}<commit_msg>Manejo correcto de webhooks<commit_after><?php

$body = file_get_contents('php://input');
$event_json = json_decode($body);

if ($event_json->type == 'charge.paid'){
 
    
    $message = $event_json->data->object->id;
    $message .= $event_json->data->object->status;
    $message .= $event_json->data->object->amount;
    
     $destinatario = "<EMAIL>";
        $asunto = "Compra Confirmada" ;
        
        //para el envío en formato HTML 
     
       mail($destinatario,$asunto,$message,$headers);
    
    http_response_code(200);
}
{'fraction_non_alphanumeric': 0.17118802619270346, 'fraction_numerical': 0.005612722170252572, 'mean_word_length': 3.3495934959349594, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2413646', 'n_tokens_mistral': 370, 'n_tokens_neox': 357, 'n_words': 68}