Improvements for timing of Postmark webhooks

This commit is contained in:
David Bomba 2024-11-25 17:32:23 +11:00
parent 5e5dc3eb65
commit eb1475a451
3 changed files with 2 additions and 6 deletions

View File

@ -65,7 +65,7 @@ class PostMarkController extends BaseController
public function webhook(Request $request) public function webhook(Request $request)
{ {
if ($request->header('X-API-SECURITY') && $request->header('X-API-SECURITY') == config('services.postmark.token')) { if ($request->header('X-API-SECURITY') && $request->header('X-API-SECURITY') == config('services.postmark.token')) {
ProcessPostmarkWebhook::dispatch($request->all())->delay(rand(6, 14)); ProcessPostmarkWebhook::dispatch($request->all())->delay(15);
return response()->json(['message' => 'Success'], 200); return response()->json(['message' => 'Success'], 200);
} }

View File

@ -77,7 +77,7 @@ class AutoBill implements ShouldQueue
nlog($e->getMessage()); nlog($e->getMessage());
} }
nlog("Firing email for invoice {$invoice->number}"); nlog("Firing email for invoice {$invoice->number} which failed to capture payment");
} }
}); });

View File

@ -119,10 +119,6 @@ class AutoBillInvoice extends AbstractService
/* $gateway fee */ /* $gateway fee */
$this->invoice = $this->invoice->service()->addGatewayFee($gateway_token->gateway, $gateway_token->gateway_type_id, $amount)->save(); $this->invoice = $this->invoice->service()->addGatewayFee($gateway_token->gateway, $gateway_token->gateway_type_id, $amount)->save();
nlog($this->invoice->amount);
nlog($this->invoice->balance);
//change from $this->invoice->amount to $this->invoice->balance //change from $this->invoice->amount to $this->invoice->balance
if ($is_partial) { if ($is_partial) {
$fee = $this->invoice->balance - $invoice_total; $fee = $this->invoice->balance - $invoice_total;