Ejemplo n.º 1
1
 public function teste()
 {
     $data = ['items' => [['id' => '18', 'description' => 'Item Um', 'quantity' => '1', 'amount' => '1.15']], 'notificationURL' => 'http://www.webcontabilidade.com/pagseguro', 'reference' => '123', 'sender' => ['email' => '*****@*****.**', 'name' => 'Aldir Junior', 'documents' => [['number' => '06873589900', 'type' => 'CPF']], 'phone' => '(47)9617-2512', 'bornDate' => '1989-03-10']];
     $checkout = Pagseguro::checkout()->createFromArray($data);
     $credentials = PagSeguro::credentials()->get();
     $information = $checkout->send($credentials);
     // Retorna um objeto de laravel\pagseguro\Checkout\Information\Information
     if ($information) {
         print_r($information->getCode());
         print_r($information->getDate());
         print_r($information->getLink());
     }
 }
Ejemplo n.º 2
0
 public function botao_pagamento()
 {
     if ($this->status == 'Devolvida' || $this->status == 'Cancelada' || $this->status == 'Pendente' || $this->status == 'Aguardando pagamento') {
         $data = ['items' => [['id' => $this->mensalidade->id, 'description' => 'Mensalidade WebContabilidade', 'quantity' => '1', 'amount' => $this->mensalidade->valor]], 'notificationURL' => 'http://www.webcontabilidade.com/pagseguro', 'reference' => $this->id, 'sender' => ['email' => '*****@*****.**', 'name' => 'Aldir Junior', 'documents' => [['number' => '06873589900', 'type' => 'CPF']], 'phone' => '(47)9617-2512', 'bornDate' => '1989-03-10']];
         $checkout = Pagseguro::checkout()->createFromArray($data);
         $credentials = PagSeguro::credentials()->get();
         $information = $checkout->send($credentials);
         // Retorna um objeto de laravel\pagseguro\Checkout\Information\Information
         return '<a href="' . $information->getLink() . '" class="btn btn-success">Clique para pagar</a>';
     }
     if ($this->status == 'Disponível' || $this->status == 'Em análise') {
         return '<a href="" class="btn btn-success" disabled>Em processamento</a>';
     }
     return null;
 }
Ejemplo n.º 3
0
 public function botao_pagamento()
 {
     if (($this->status == 'Atenção' || $this->status == 'Em Processamento' || $this->status == 'Novo') && ($this->pagamento->status == 'Devolvida' || $this->pagamento->status == 'Cancelada' || $this->pagamento->status == 'Pendente' || $this->pagamento->status == 'Aguardando pagamento')) {
         $data = ['items' => [['id' => $this->id, 'description' => 'Abertura de Empresa', 'quantity' => '1', 'amount' => $this->pagamento->valor]], 'notificationURL' => 'http://www.webcontabilidade.com/pagseguro', 'reference' => $this->pagamento->id, 'sender' => ['email' => $this->usuario->email, 'name' => $this->usuario->nome, 'phone' => $this->usuario->telefone]];
         $checkout = Pagseguro::checkout()->createFromArray($data);
         $credentials = PagSeguro::credentials()->get();
         $information = $checkout->send($credentials);
         // Retorna um objeto de laravel\pagseguro\Checkout\Information\Information
         return '<a href="' . $information->getLink() . '" class="btn btn-success">Clique para pagar</a>';
     }
     if ($this->status == 'Disponível' || $this->status == 'Em análise') {
         return '<a href="" class="btn btn-success" disabled>Em processamento</a>';
     }
     return null;
 }