forked from resuelve/wax
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Oscar Olivera
committed
Jan 10, 2020
1 parent
708b7f2
commit 3b5c298
Showing
8 changed files
with
88 additions
and
21 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
defmodule Whatsapp.Api.Account do | ||
@moduledoc """ | ||
Módulo para el manejo de la configuración de Whatsapp | ||
""" | ||
|
||
@parser Application.get_env(:wax, :parser) | ||
|
||
@doc """ | ||
Registrar una cuenta en Whatsapp | ||
""" | ||
@spec create(tuple(), map) :: boolean | ||
def create({url, auth_header}, data) do | ||
url | ||
|> Kernel.<>("/account") | ||
|> WhatsappApiRequest.post!(data, [auth_header]) | ||
|> @parser.parse(:account) | ||
end | ||
|
||
@doc """ | ||
Verificar la cuenta con el código recibido en el móvil | ||
""" | ||
@spec create(tuple(), map) :: boolean | ||
def verify({url, auth_header}, code) do | ||
url | ||
|> Kernel.<>("/account/verify") | ||
|> WhatsappApiRequest.post!(%{"code" => code}, [auth_header]) | ||
|> @parser.parse(:account) | ||
end | ||
end |
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
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
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
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
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
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
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