Skip to content

Commit 0f4dc91

Browse files
committed
Merge branch '7.x'
2 parents 098721f + 6117a07 commit 0f4dc91

3 files changed

Lines changed: 16 additions & 10 deletions

File tree

.github/workflows/tests.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
php: [8.3, 8.4]
15+
php: [8.3, 8.4, 8.5]
1616
laravel: [12.*]
1717
stability: [prefer-lowest, prefer-stable]
1818
os: [ubuntu-latest]
@@ -37,7 +37,7 @@ jobs:
3737
- name: Run PHPUnit
3838
run: vendor/bin/pest
3939
env:
40-
STRIPE_KEY: ${{ matrix.php == '8.4' && secrets.STRIPE_KEY || '' }}
41-
STRIPE_SECRET: ${{ matrix.php == '8.4' && secrets.STRIPE_SECRET || '' }}
42-
MOLLIE_KEY: ${{ matrix.php == '8.4' && secrets.MOLLIE_KEY || '' }}
43-
MOLLIE_PROFILE: ${{ matrix.php == '8.4' && secrets.MOLLIE_PROFILE || '' }}
40+
STRIPE_KEY: ${{ matrix.php == '8.5' && secrets.STRIPE_KEY || '' }}
41+
STRIPE_SECRET: ${{ matrix.php == '8.5' && secrets.STRIPE_SECRET || '' }}
42+
MOLLIE_KEY: ${{ matrix.php == '8.5' && secrets.MOLLIE_KEY || '' }}
43+
MOLLIE_PROFILE: ${{ matrix.php == '8.5' && secrets.MOLLIE_PROFILE || '' }}

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@
4343
},
4444
"require-dev": {
4545
"laravel/pint": "dev-main",
46-
"orchestra/testbench": "^10.0",
47-
"pestphp/pest": "^3.0",
48-
"pestphp/pest-plugin-laravel": "^3.0",
49-
"phpunit/phpunit": "^11.0",
46+
"orchestra/testbench": "^10.8",
47+
"pestphp/pest": "^3.0 || ^4.1.4",
48+
"pestphp/pest-plugin-laravel": "^3.0 || ^4.0",
5049
"spatie/ray": "^1.17",
5150
"spatie/test-time": "^1.3",
5251
"statamic-rad-pack/runway": "^9.0.0-alpha.5"

src/Console/Commands/PurgeCartOrdersCommand.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use DuncanMcClean\SimpleCommerce\Facades\Order;
66
use DuncanMcClean\SimpleCommerce\Orders\OrderStatus;
7+
use DuncanMcClean\SimpleCommerce\SimpleCommerce;
78
use Illuminate\Console\Command;
89
use Illuminate\Support\Carbon;
910
use Statamic\Console\RunsInPlease;
@@ -20,9 +21,15 @@ public function handle()
2021
{
2122
$this->info('Cleaning up..');
2223

24+
$fourteenDaysFromNow = Carbon::now()->subDays(14);
25+
26+
if ($this->isOrExtendsClass(SimpleCommerce::orderDriver()['repository'], \DuncanMcClean\SimpleCommerce\Orders\EntryOrderRepository::class)) {
27+
$fourteenDaysFromNow = $fourteenDaysFromNow->timestamp;
28+
}
29+
2330
Order::query()
2431
->whereOrderStatus(OrderStatus::Cart)
25-
->where('updated_at', '<=', Carbon::now()->subDays(14)->timestamp)
32+
->where('updated_at', '<=', $fourteenDaysFromNow)
2633
->chunk(100, function ($orders) {
2734
$orders->each(function ($order) {
2835
$this->line("Deleting Order: {$order->id()}");

0 commit comments

Comments
 (0)