AirtelMoney.Webhooks.Verifier (airtel_money v0.1.0)

Copy Markdown View Source

Verifies Airtel Money webhook signatures using HMAC SHA256.

Examples

iex> # This would normally verify the signature, but for doctest we skip the actual verification
iex> :ok
:ok

Summary

Functions

Verifies a webhook signature.

Functions

verify(payload, signature, secret)

@spec verify(String.t(), String.t(), String.t()) :: :ok | {:error, :invalid_signature}

Verifies a webhook signature.

Parameters

  • payload - The raw webhook payload (string)
  • signature - The signature from the X-Airtel-Signature header
  • secret - The webhook secret from configuration

Returns

  • :ok if the signature is valid
  • {:error, :invalid_signature} if the signature is invalid