Closed sandulat closed 4 years ago
Wow Paddle began to spam the webhook endpoint:
My bad! I've configured the one time product to additionally request the webhook endpoint once purchased. Sorry for bothering you!
@sandulat I'm facing the same problem. I have already created a webhook for the PaymentSuccess, but I'm not sure how to disable the other ProductFulfillment webhook on Paddle. I must choose an option from there: download, license or webhook. Thanks!
@zoltanszogyenyi I've chosen the "webhook" option and ended up pointing it to the homepage/landing page of my app so that the webhook would just receive a 200 response. Very dirty, I know. But hey, it works 😄! I'd also love to find out a better way.
@sandulat Oh that's dirty alright lol. Here's what I managed to do to still use the library:
When setting the main webhook (the one you must choose as fulfillment) I added a static value with "alert_name" as a label and "payment_suceeded" as the value. Then I would basically hackishly use the PaymentSuceeded event as a hook to get the data from the main webhook.
I contacted the Paddle team and they recommend using the main webhook comparative to the PaymentSucceeded one because they also make security checks after the payment, so there are some rare occasions when your code may be faulty.
Anyways, I hope the author of this library gives support to this fulfillment webhook. It's a great library!
@zoltanszogyenyi will look into it!
I've just tagged v1.1.2
, which has a new GenericWebhook
event. This event gets fired when the alert_name
is missing. It also brings support for accessing the request:
<?php
namespace App\Listeners;
use ProtoneMedia\LaravelPaddle\Events\GenericWebhook;
class HandleProductFulfillment
{
public function handle(GenericWebhook $event)
{
$webhookData = $event->all();
$request = $event->getRequest();
}
}
Hello! Thank you for building this awesome package!
When I receive a "payment_succeeded" webhook from Paddle, an exception log is created:
However, everything works excellently. My listener catches the event and does the business logic as expected. I don't understand why this exception is happening while everything works as expected. It feels like Paddle is dispatching 2 requests, instead of 1. But the
Alert History
from Paddle shows only 1 request, and the payload does containalert_name
.Should I submit a PR which checks if "alert_name" exists in the payload, inside the
fire
method from theEvent
base class? Like this:Thank you very much!