Skip to content

Commit

Permalink
🔧 Fix model on commands
Browse files Browse the repository at this point in the history
  • Loading branch information
MarceauKa committed Mar 20, 2020
1 parent 2a1504a commit 19f4491
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Commands/Purge.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public function handle()
{
/** @var StripeCheckout $model */
$model = Config::get('stripe-server.model');
$model = $model ?? StripeCheckout::class;

DB::table($model->getTable())
->where('is_paid', 0)
Expand Down
2 changes: 2 additions & 0 deletions src/Commands/StripeCompletedCheckout.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Event;
use Lab404\StripeServer\Events\CheckoutSessionCompleted;
use Lab404\StripeServer\Models\StripeCheckout;
use Lab404\StripeServer\Stripe;

class StripeCompletedCheckout extends Command
Expand All @@ -26,6 +27,7 @@ public function handle(Stripe $stripe)

$ids = $events->pluck('payment_intent')->toArray();
$model = Config::get('stripe-server.model');
$model = $model ?? StripeCheckout::class;

/** @var Collection $checkouts */
$checkouts = $model::with('chargeable')->paymentIntentIdsAre($ids)->isNotPaid()->get();
Expand Down

0 comments on commit 19f4491

Please sign in to comment.