Users still have to decode Paystack webhook signature by themselves. The SDK can handle this for them with something like the following:
from os import getenv
from paystack import PaystackClient, APIError
paystack_client = PaystackClient(secret_key=getenv("PAYSTACK_SECRET_KEY"))
def paystack_webhook(request):
try:
paystack_client.webhook.verify_signature(request)
webhook_data = paystack_client.webhook,get_data(request)
# ...rest of user's code
except APIError as e:
return (
f"Failed to verify Paystack signature header: {e}"
)
Users still have to decode Paystack webhook signature by themselves. The SDK can handle this for them with something like the following: