My difficulty is in doing the parsing of the data returned in the ticket generation. My goal is to take this data and do some transformations, such as formatting the date / time and some other changes like translation of ticket status, etc.
My ticket generation and query methods:
/**
* Gera um boleto para pagamento
*
* @param int $valor
* @param array $dados
* @param string $urlCallBack
* @param array $metadados
* @return void
*/
public function gerar($valor, $dados, $urlCallBack = null, $metadados = null)
{
$customer = new Customer($dados);
return $this->pagarMe->transaction()->boletoTransaction(
$valor,
$customer,
$urlCallBack,
$metadados
);
}
/**
* Retorna os dados do boleto
*
* @return \PagarMe\Sdk\Transaction\BoletoTransaction
*/
public function consultar(int $transacaoId)
{
return $this->dicionario($this->pagarMe->transaction()->get($transacaoId));
}