Skip to content

Commit

Permalink
Fixes 22digital#2
Browse files Browse the repository at this point in the history
  • Loading branch information
justinhartman committed Nov 15, 2019
1 parent d816933 commit 8be4c42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Listeners/SubscriptionChargeCompleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use TwentyTwoDigital\CashierFastspring\Invoice;
use TwentyTwoDigital\CashierFastspring\Subscription;
use Carbon\Carbon;
use Illuminate\Support\Str;

/**
* This class is a listener for subscription charge completed events.
Expand Down Expand Up @@ -55,7 +56,7 @@ public function handle(Events\SubscriptionChargeCompleted $event)
$periodEndDate = $nextDate->subDay()->format('Y-m-d H:i:s');

// yeap, weird way
$methodName = 'sub'.title_case($subscription->interval_unit).'sNoOverflow';
$methodName = 'sub'.Str::title($subscription->interval_unit).'sNoOverflow';
$periodStartDate = $nextDate->$methodName($subscription->interval_length)->addDay()->format('Y-m-d H:i:s');

// fill the model
Expand Down

0 comments on commit 8be4c42

Please sign in to comment.