Skip to content

Commit

Permalink
Simplify Paddle passthrough validation
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVanderbist committed Sep 25, 2024
1 parent 1599708 commit 288a3c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/WebhookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ protected function findOrCreateCustomer(string $passthrough)
$passthrough = json_decode($passthrough, true);

// The passthrough data comes from the shop front-end. We cannot trust it.
if (! is_array($passthrough) || ! isset($passthrough['billable_id'], $passthrough['billable_type']) || $passthrough['billable_type'] !== User::class) {
throw new InvalidPassthroughPayload();
if (! is_array($passthrough) || $passthrough['billable_type'] !== User::class) {
throw new InvalidPassthroughPayload;
}

return parent::findOrCreateCustomer($passthrough);
Expand Down

0 comments on commit 288a3c7

Please sign in to comment.