<?php


require_once '../vendor/autoload.php';

$db = new Source\Conn\DataLayer();


$return = json_decode(file_get_contents('php://input'), true);

if($return['event'] == 'PAYMENT_CONFIRMED'){
    $idCob = str_replace('pay_', '', $return['payment']['id']);
    $upBuy['buy_status'] = '1';
    $db->db()->update('buy')->where('buy_code')->is($idCob)->set($upBuy);
    echo 'BAIXADO';
}
