Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed Feb 8, 2025
1 parent 066116d commit 1f50b81
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
8 changes: 4 additions & 4 deletions config/simple-commerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@
'webhook_secret' => env('STRIPE_WEBHOOK_SECRET'),
],

'mollie' => [
'api_key' => env('MOLLIE_KEY'),
'profile_id' => env('MOLLIE_PROFILE_ID'),
],
// 'mollie' => [
// 'api_key' => env('MOLLIE_KEY'),
// 'profile_id' => env('MOLLIE_PROFILE_ID'),
// ],
],
],

Expand Down
13 changes: 9 additions & 4 deletions src/Orders/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,23 @@ public function date($date = null)
}

if ($date instanceof \Carbon\CarbonInterface) {
return $date;
return $date->setTimezone('UTC');
}

if (strlen($date) === 10) {
return Carbon::createFromFormat('Y-m-d', $date)->startOfDay();
return Carbon::createFromFormat('Y-m-d', $date)
->setTimezone('UTC')
->startOfDay();
}

if (strlen($date) === 15) {
return Carbon::createFromFormat('Y-m-d-Hi', $date)->startOfMinute();
return Carbon::createFromFormat('Y-m-d-Hi', $date)
->setTimezone('UTC')
->startOfMinute();
}

return Carbon::createFromFormat('Y-m-d-His', $date);
return Carbon::createFromFormat('Y-m-d-His', $date)
->setTimezone('UTC');
})
->args(func_get_args());
}
Expand Down
2 changes: 1 addition & 1 deletion src/Stache/Repositories/OrderRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function save(Order $order): void
}

if (! $order->date()) {
$order->date(Carbon::now());
$order->date(Carbon::now('UTC'));
}

if (! $order->orderNumber()) {
Expand Down

0 comments on commit 1f50b81

Please sign in to comment.