Add sleep(2) to allow the app to catch up with speed of webhooks

This commit is contained in:
Benjamin Beganović 2021-08-13 07:53:00 +02:00
parent a90fa63b0b
commit 800025bf5d
2 changed files with 6 additions and 0 deletions

View File

@ -273,6 +273,9 @@ class MolliePaymentDriver extends BaseDriver
public function processWebhookRequest(PaymentWebhookRequest $request)
{
// Allow app to catch up with webhook request.
sleep(2);
$validator = Validator::make($request->all(), [
'id' => ['required', 'starts_with:tr'],
]);

View File

@ -390,6 +390,9 @@ class StripePaymentDriver extends BaseDriver
public function processWebhookRequest(PaymentWebhookRequest $request)
{
// Allow app to catch up with webhook request.
sleep(2);
if ($request->type === 'charge.succeeded' || $request->type === 'source.chargeable') {
foreach ($request->data as $transaction) {
$payment = Payment::query()