<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
adejorosam / laravel-flutterwave-webhook example snippets
return [
/*
* Flutterwave will sign each webhook using the secret hash you fielded.
* You can do that at the webhook configuration settings: https://dashboard.flutterwave.com/account/webhooks.
*/
'signing_secret' => env('SECRET_HASH'),
/*
* The classname of the model to be used. The class should equal or extend
* \Spatie\WebhookClient\ProcessWebhookJob.
*/
'process_webhook_job' => '',
];
namespace Adejorosam\LaravelFlutterwaveWebhook;
use \Spatie\WebhookClient\ProcessWebhookJob;
//The class extends "ProcessWebhookJob" class as that is the class
//that will handle the job of processing our webhook before we have
//access to it.
class ProcessFlutterwaveWebhook extends ProcessWebhookJob
{
public function handle()
{
$data = json_decode($this->webhookCall, true);
//Do something with great with this!
http_response_code(200); //Acknowledge you received the response
}
}