<?php require 'config.php'; require '../vendor/autoload.php'; use EuMatheusGomes\BCash\BCashClient; // use EuMatheusGomes\BCash\Entity\Cliente; use EuMatheusGomes\BCash\Entity\Transacao; // $cliente = new Cliente(); // $clienteData = $cliente->parseRetorno($_POST); $transacao = new Transacao(); $transacaoData = $transacao->parseRetorno($_POST); $bCashClient = new BCashClient($email, $token); if ($bCashClient->verify($transacao)) { die('OK'); } die('ERROR');
// ->setRg() // ->setDataEmissao_rg() // ->setOrgaoEmissor_rg() // ->setEstadoEmissor_rg() $configuracoes = new Configuracoes(); $configuracoes->setUrlRetorno($urlRetorno)->setRedirect('true')->setAcrescimo('1.90')->setRedirectTime('30'); // ->setFree() // ->setUrlAviso() // ->setHash() // ->setDesconto() // ->setParcelaMaxima() // ->setMeioPagamento() // ->setIdPlataforma() // ->setEmailDependente() // ->setValorDependente() $bCashClient = new BCashClient($email, $token); $paymentData = $bCashClient->getPaymentData($pedido, $entrega, $comprador, $configuracoes); $paymentUrl = $bCashClient->getPaymentUrl(); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>BCash - Payment</title> </head> <body> You will be redirected to the BCash website... <form id="paymentForm" method="post" action="<?php echo $paymentUrl; ?>