I am developing a webapp with payment feature on it and I need to integrate webhook to get updates from the payment gateway similar to stripe when payments are made and use it to do stuff like send emails etc., and also grant excess to certain features when a subscription is made.
I am using ngrok to generate a temporary public facing url. I already created a route.php file in my plugin directory and have this in it
<?php
Route::any('/webhook/rave', 'Corymillz\Adverts\Http\Controllers\Webhook@index');
?>
In my plugin directory I also created a folder Http and in it I created another folder Controllers and in it I created a php file Webhook.php. In the file I have this is test it out
<?php namespace Corymillz\Adverts\Http\Controllers;
use Illuminate\Routing\Controller;
use Request;
use Log;
class Webhook extends Controller
{
public function index(Request $request)
{
Log::info('hello');
}
}
?>
I have already added my webhook url example.ngrok.io/webhook/rave
to the payment gateway webhook page but nothing seem to be happening when I try test payment. I'd appreciate any help on this.