Skip to content

Commit

Permalink
fix: sns notification
Browse files Browse the repository at this point in the history
  • Loading branch information
itzArtha committed Feb 20, 2025
1 parent eeec06f commit 31aab52
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions app/Actions/Comms/Notifications/GetSnsNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@
use Aws\Sns\Message;
use Aws\Sns\MessageValidator;
use Illuminate\Support\Arr;
use Lorisleiva\Actions\ActionRequest;
use Lorisleiva\Actions\Concerns\AsAction;

class GetSnsNotification
{
use AsAction;

public function asController(): string
public function asController(ActionRequest $request): string
{
$message = Message::fromRawPostData();
$message = new Message($request->all());
$validator = new MessageValidator();

if ($validator->isValid($message)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function htmlResponse(PalletReturn $palletReturn, ActionRequest $request)
} else {
$tooltipSubmit = __('Submit');
}

$buttonSubmit = [
'type' => 'button',
'style' => 'save',
Expand Down
2 changes: 1 addition & 1 deletion routes/grp/webhooks/webhooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use App\Actions\Dropshipping\Shopify\Webhook\ShopRedactWebhookShopify;

Route::name('webhooks.')->group(function () {
Route::any('sns', GetSnsNotification::class)->name('sns');
Route::post('sns', GetSnsNotification::class)->name('sns');
});

Route::prefix('shopify-user/{shopifyUser:id}')->name('webhooks.shopify.')->group(function () {
Expand Down

0 comments on commit 31aab52

Please sign in to comment.