Coder Social home page Coder Social logo

laravel-paystack-webhooks's People

Contributors

timoladoyinbo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

laravel-paystack-webhooks's Issues

Problem with VerifySignature Wehbook Request Header

When i try running the webhook i keep getting the AccessDeniedException and for some reason i believe the request header here might be the problem

 if ((! $request->isMethod('post')) || ! $request->header('HTTP_X_PAYSTACK_SIGNATURE', null)) {
            throw new AccessDeniedHttpException("Invalid Request");
        }

Because when i did this

$request->header('x-paystack-signature');

It works, kindly look into this please. Also my credentials are correct

Also the WebhooksController needs to be changed to this

public function handleWebhook(Request $request): \Symfony\Component\HttpFoundation\Response
    {
        $payload = json_decode($request->getContent(), true);
        $method = 'handle'.Str::studly(str_replace('.', '_', $payload['event']));

        WebhookReceived::dispatch($payload);

        if (method_exists($this, $method)) {
            $response = $this->{$method}($payload);

            WebhookHandled::dispatch($payload);

            return $response ?? $this->successMethod();
        }

        return $this->missingMethod();
    }

Demo request

Sorry there is no issue but I want to ask if you have a demo or an example for us to follow. Thanks for this amazing package :)

Cannot receive event data from Paystack

Hello anyone, I followed your instruction and added webhook url in Paystack dasboard but no event data returned from paystack to my website.

Controller:

<?php

namespace App\Http\Controllers\Web;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Digikraaft\PaystackWebhooks\Http\Controllers\WebhooksController as PaystackWebhooksController;

class WebhookController extends PaystackWebhooksController
{
    /**
     * Handle charge success.
     *
     * @param  array  $payload
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function handleChargeSuccess($payload)
    {
        try {
            Log::info("Received charge.success event");
            Log::info(json_encode($payload));
        } catch (\Exception $e) {
            Log::error($e->getMessage());
        }
    }
}

Route - web.php
Route::post("/paystack/webhooks", [WebhookController::class, "handleChargeSuccess"]);

VerifyCsrfToken

protected $except = [
    'paystack/*',
];

.env

PAYSTACK_SECRET_KEY=sk_live_...
PAYSTACK_PUBLIC_KEY=pk_live_...
PAYSTACK_WEBHOOK_PATH=paystack

config.php

'public_key' => env('PAYSTACK_PUBLIC_KEY'),
'secret' => env('PAYSTACK_SECRET_KEY'),
'webhook_path' => env('PAYSTACK_WEBHOOK_PATH', 'paystack'),

webhook path url
https://phplaravel-99.cloudwaysapps.com/paystack/webhooks

What did I miss? Please help me out. Thanks

Support for Laravel 8

Hi team, I noticed that you can not install this package on a Laravel version 8.75๐Ÿ˜ข

Inheriting WebhooksControllerfrom Digikraaft returns a 403 Forbidden error.

Hello team,

I hope this gets resolved soon.

Whenever a request is made on a class with an inheritance from the WebhooksController class inside of the Digikraaft package, it always returns a 403 forbidden error.

The error is not as descriptive making it seemingly impossible to debug what the problem could be.

I'd be on the lookout for some assistance in resolving this issue.
Screenshot (220)

guzzlehttp version conflict

i require and updated version of guzzle http in my project but this package require older version, thereby creating conflicts.
this is the response i get
`Your requirements could not be resolved to an installable set of packages.

Problem 1
- Root composer.json requires digikraaft/laravel-paystack-webhooks ^1.1 -> satisfiable by digikraaft/laravel-paystack-webhooks[v1.1.0].
- digikraaft/laravel-paystack-webhooks v1.1.0 requires guzzlehttp/guzzle ^6.5 -> found guzzlehttp/guzzle[6.5.0, ..., 6.5.x-dev] but it conflicts with your root composer.json require (^7.3).

Installation failed, reverting ./composer.json to its original content.`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.