<?php
// Testar no sandbox
// Explicação: https://xflowpayments.com/blog/api-pix-php/
require __DIR__ . '/xflow.php';

$teste = xflow('POST', '/charges', [
    'amountCents' => 1990,
    'customer' => ['name' => 'Cliente', 'email' => 'c@exemplo.com', 'document' => '00000000000'],
]);

xflow('POST', "/test/charges/{$teste['id']}/pay");

$paga = xflow('GET', "/charges/{$teste['id']}");
echo $paga['status']; // paid
