Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Remover preferência de notificação

Caio Gaspar edited this page Jul 17, 2017 · 1 revision

No exemplo abaixo removeremos uma preferência de notificação webhook.

Para remover uma preferência de notificação basta enviar seu id, no exemplo passamos o id através da variável $notification_id. Então, chamamos o método delete que faz efetivamente a remoção.

try {
    $notification_id = 'NPR-123456789012';
    $notification = $moip->notifications()->delete($notification_id);
    print_r($notification);
} catch (Exception $e) {
    printf($e->__toString());    
}

A variável $moip no exemplo é um objeto do tipo Moip que garante a autenticação básica, como você pode conferir na seção Como Começar.

Clone this wiki locally