Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
justinhartman committed Nov 15, 2019
1 parent 6c62368 commit d816933
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Http/Controllers/WebhookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Str;
use Log;
use Symfony\Component\HttpFoundation\Response;

Expand Down Expand Up @@ -55,11 +56,11 @@ public function handleWebhook(Request $request)
// prepare category event class names like OrderAny
$explodedType = explode('.', $event['type']);
$category = array_shift($explodedType);
$categoryEvent = '\TwentyTwoDigital\CashierFastspring\Events\\'.studly_case($category).'Any';
$categoryEvent = '\TwentyTwoDigital\CashierFastspring\Events\\'.Str::studly($category).'Any';

// prepare category event class names like activity
$activity = str_replace('.', ' ', $event['type']);
$activityEvent = '\TwentyTwoDigital\CashierFastspring\Events\\'.studly_case($activity);
$activityEvent = '\TwentyTwoDigital\CashierFastspring\Events\\'.Str::studly($activity);

// there may be some exceptions on events
// so if anything goes bad its ID won't be added on the successfullEvents
Expand Down

0 comments on commit d816933

Please sign in to comment.