Skip to content

Commit

Permalink
Fix timestamp on stripe events
Browse files Browse the repository at this point in the history
Fixes #24
  • Loading branch information
mikebronner committed Mar 1, 2017
1 parent d426304 commit e007cf1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Http/Requests/RecordStripeEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ private function recordSubscription($transaction, $user, array $originalValues =
if ($planStatus === 'canceled') {
$profileData = [
'Subscription' => 'None',
'Churned' => Carbon::now('UTC')->format('Y-m-d\Th:i:s'),
'Churned' => Carbon::parse($transaction['canceled_at'])->format('Y-m-d\Th:i:s'),
'Plan When Churned' => $planName,
'Paid Lifetime' => Carbon::createFromTimestampUTC($planStart)->diffInDays(Carbon::now('UTC')) . ' days'
'Paid Lifetime' => Carbon::createFromTimestampUTC($planStart)->diffInDays(Carbon::timestamp($transaction['ended_at'])->timezone('UTC')) . ' days'
];
$trackingData = [
['Subscription', ['Status' => 'Canceled', 'Upgraded' => false]],
Expand All @@ -125,7 +125,7 @@ private function recordSubscription($transaction, $user, array $originalValues =
if ($planAmount < $oldPlanAmount) {
$profileData = [
'Subscription' => $planName,
'Churned' => Carbon::now('UTC')->format('Y-m-d\Th:i:s'),
'Churned' => Carbon::timestamp($transaction['ended_at'])->timezone('UTC')->format('Y-m-d\Th:i:s'),
'Plan When Churned' => $oldPlanName,
];
$trackingData = [
Expand Down

0 comments on commit e007cf1

Please sign in to comment.