Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Cashier to v15 #858

Merged
merged 4 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Services/PayPalService.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@
$this->user->save();

$sub = new Subscription();
$sub->user_id = $this->user->id; // @phpstan-ignore-line

Check failure on line 91 in app/Services/PayPalService.php

View workflow job for this annotation

GitHub Actions / PHP 8.3

No error to ignore is reported on line 91.
$sub->name = 'kanka'; // @phpstan-ignore-line
$sub->type = 'kanka'; // @phpstan-ignore-line

Check failure on line 92 in app/Services/PayPalService.php

View workflow job for this annotation

GitHub Actions / PHP 8.3

No error to ignore is reported on line 92.
$sub->stripe_id = 'manual_sub_' . uniqid(); // @phpstan-ignore-line

Check failure on line 93 in app/Services/PayPalService.php

View workflow job for this annotation

GitHub Actions / PHP 8.3

No error to ignore is reported on line 93.
spitfire305 marked this conversation as resolved.
Show resolved Hide resolved
$sub->stripe_status = 'canceled'; // @phpstan-ignore-line

Check failure on line 94 in app/Services/PayPalService.php

View workflow job for this annotation

GitHub Actions / PHP 8.3

No error to ignore is reported on line 94.
$sub->stripe_price = 'paypal_' . $this->user->pledge; // @phpstan-ignore-line

Check failure on line 95 in app/Services/PayPalService.php

View workflow job for this annotation

GitHub Actions / PHP 8.3

No error to ignore is reported on line 95.
$sub->quantity = 1; // @phpstan-ignore-line

Check failure on line 96 in app/Services/PayPalService.php

View workflow job for this annotation

GitHub Actions / PHP 8.3

No error to ignore is reported on line 96.
$sub->ends_at = Carbon::now()->addYear(); // @phpstan-ignore-line

Check failure on line 97 in app/Services/PayPalService.php

View workflow job for this annotation

GitHub Actions / PHP 8.3

No error to ignore is reported on line 97.
$sub->save();
} else {
// Add the subscription to the user level
Expand Down
2 changes: 1 addition & 1 deletion app/Services/SubscriptionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ public function sourceCharge(array $payload)

\Laravel\Cashier\Subscription::create([
'user_id' => $this->user->id,
'name' => 'kanka',
'type' => 'kanka',
'stripe_id' => $source->method . '_' . $source->id,
'stripe_status' => 'active',
'stripe_price' => $source->plan(),
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function asUser(bool $subscribed = false): self

$sub = new Subscription();
$sub->user_id = $user->id; // @phpstan-ignore-line
$sub->name = 'kanka'; // @phpstan-ignore-line
$sub->type = 'kanka'; // @phpstan-ignore-line
$sub->stripe_id = 'manual_sub_' . uniqid(); // @phpstan-ignore-line
$sub->stripe_status = 'canceled'; // @phpstan-ignore-line
$sub->stripe_price = 'paypal_' . $user->pledge; // @phpstan-ignore-line
Expand Down
Loading