@@ -2,4 +2,4 @@ |
||
| 2 | 2 | |
| 3 | 3 | use GeneaLabs\LaravelMixpanel\Http\Controllers\StripeWebhooksController; |
| 4 | 4 | |
| 5 | -Route::post('genealabs/laravel-mixpanel/stripe', StripeWebhooksController::class .'@postTransaction'); |
|
| 5 | +Route::post('genealabs/laravel-mixpanel/stripe', StripeWebhooksController::class . '@postTransaction'); |
|
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | { |
| 22 | 22 | $data = $this->json()->all(); |
| 23 | 23 | |
| 24 | - if (! $data || ! array_key_exists('data', $data)) { |
|
| 24 | + if ( ! $data || ! array_key_exists('data', $data)) { |
|
| 25 | 25 | return; |
| 26 | 26 | } |
| 27 | 27 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $authModel = config('auth.providers.users.model') ?? config('auth.model'); |
| 34 | 34 | $user = app($authModel)->where('stripe_id', $stripeCustomerId)->first(); |
| 35 | 35 | |
| 36 | - if (! $user) { |
|
| 36 | + if ( ! $user) { |
|
| 37 | 37 | return; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | ]; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - if (! $transaction['paid'] && $transaction['captured'] && ! $transaction['refunded']) { |
|
| 73 | + if ( ! $transaction['paid'] && $transaction['captured'] && ! $transaction['refunded']) { |
|
| 74 | 74 | $trackingData = [ |
| 75 | 75 | ['Payment', [ |
| 76 | 76 | 'Status' => 'Failed', |
@@ -107,8 +107,8 @@ discard block |
||
| 107 | 107 | 'Churned' => Carbon::parse($transaction['canceled_at'])->format('Y-m-d\Th:i:s'), |
| 108 | 108 | 'Plan When Churned' => $planName, |
| 109 | 109 | 'Paid Lifetime' => Carbon::createFromTimestampUTC($planStart) |
| 110 | - ->diffInDays(Carbon::timestamp($transaction['ended_at']) |
|
| 111 | - ->timezone('UTC')) . ' days' |
|
| 110 | + ->diffInDays(Carbon::timestamp($transaction['ended_at']) |
|
| 111 | + ->timezone('UTC')) . ' days' |
|
| 112 | 112 | ]; |
| 113 | 113 | $trackingData = [ |
| 114 | 114 | ['Subscription', ['Status' => 'Canceled', 'Upgraded' => false]], |
@@ -122,8 +122,8 @@ discard block |
||
| 122 | 122 | $profileData = [ |
| 123 | 123 | 'Subscription' => $planName, |
| 124 | 124 | 'Churned' => Carbon::timestamp($transaction['ended_at']) |
| 125 | - ->timezone('UTC') |
|
| 126 | - ->format('Y-m-d\Th:i:s'), |
|
| 125 | + ->timezone('UTC') |
|
| 126 | + ->format('Y-m-d\Th:i:s'), |
|
| 127 | 127 | 'Plan When Churned' => $oldPlanName, |
| 128 | 128 | ]; |
| 129 | 129 | $trackingData = [ |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | $data = array_filter($data); |
| 62 | 62 | $properties = array_filter($properties); |
| 63 | 63 | |
| 64 | - if ((! array_key_exists('$browser', $data)) && $browserInfo->isRobot()) { |
|
| 64 | + if (( ! array_key_exists('$browser', $data)) && $browserInfo->isRobot()) { |
|
| 65 | 65 | $data['$browser'] = 'Robot'; |
| 66 | 66 | } |
| 67 | 67 | |