Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getNotificacao() {
- try {
- if (\PagSeguro\Helpers\Xhr::hasPost()) {
- $this->credentials->getCredentials();
- $response = \PagSeguro\Services\Transactions\Notification::check(
- \PagSeguro\Configuration\Configure::getAccountCredentials()
- );
- } else {
- $this->LOGERROR->error('status', $_POST);
- throw new \InvalidArgumentException($_POST);
- }
- if ($_POST['notificationType'] === "transaction") {
- $this->LOGINFO->info("codigo da notificação ->> " . $_POST['notificationCode']);
- $notificationCode = $_POST['notificationCode'];
- // repassando o codigo da notificação para o metodo pegar os dados da transacao
- $this->getDataTransaction($notificationCode);
- }
- } catch (Exception $e) {
- $this->LOGERROR->error($e->getMessage());
- }
- }
- public function getDataTransaction($notificationCode) {
- try {
- $this->credentials->getCredentials();
- $response = \PagSeguro\Services\PreApproval\Search\Notification::search(
- \PagSeguro\Configuration\Configure::getAccountCredentials(), $notificationCode
- );
- //print_r($response);
- $this->LOGINFO->info("DADOS DA TRANSACAO" . $response);
- } catch (Exception $e) {
- $this->LOGERROR->error($e->getMessage());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement