Created
May 23, 2013 19:58
-
-
Save Sigmus/5638971 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// COMPRA REALIZADA | |
Event::listen('pedido.status.realizado', function($id) | |
{ | |
Mailer::sendStatus($id, 'Pedido Realizado'); | |
}); | |
// PAGAMENTO APROVADO | |
Event::listen('pedido.status.aprovado', function($id) | |
{ | |
$pedido = Pedido::find($id); | |
Mailer::sendStatus($id, 'Pagamento Aprovado'); | |
if ($pedido->algumSemEstoque()) | |
{ | |
StatusProduzindo::make(array('pedido' => $pedido)); | |
Mailer::tellAdmin($id, 'Falar para artista produzir obras faltantes'); | |
} | |
else | |
{ | |
Mailer::tellAdmin($id, 'Dispachar produto'); | |
} | |
}); | |
// PEDIDO PRODUZINDO | |
Event::listen('pedido.status.produzindo', function($id) { }); | |
// PEDIDO PRODUZIDO | |
Event::listen('pedido.status.produzido', function($id) { | |
Mailer::tellAdmin($id, 'Todas as obras foram produzidas. Despachar o pedido por correio!!!'); | |
}); | |
// PAGAMENTO REPROVADO | |
/* | |
* Dispobiliza as obras novamente no site. | |
*/ | |
Event::listen('pedido.status.reprovado', function($id) | |
{ | |
$pedido = Pedido::find($id); | |
Mailer::sendStatus($id, 'Pagamento Não Realizado'); | |
}); | |
// PEDIDO ENVIADO | |
Event::listen('pedido.status.enviado', function($id) | |
{ | |
Mailer::sendStatus($id, 'Pedido Enviado'); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment