Chore: Updates to Notifications
This commit is contained in:
@@ -5,6 +5,7 @@ namespace Modules\Core\Checkout\Services;
|
||||
use Lunar\Exceptions\FingerprintMismatchException;
|
||||
use Lunar\Exceptions\Carts\CartException;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Lunar\Base\Addressable;
|
||||
use Lunar\DataTypes\ShippingOption;
|
||||
@@ -431,6 +432,22 @@ class CheckoutService
|
||||
'terms_accepted' => true,
|
||||
'terms_accepted_at' => now()->toIso8601String(),
|
||||
'terms_accepted_policy_version' => $policyVersion,
|
||||
// Order.locale doesn't exist as a column — saved here so every
|
||||
// order notification (OrderPaymentResolutionService/
|
||||
// MarkOrderPlacedOnDeferredPayment fire OrderPlaced synchronously
|
||||
// in THIS request, but a later one — e.g. a Stripe 3-D Secure
|
||||
// webhook, or a staff status change from Filament — has no
|
||||
// request-scoped locale of its own) can render in the locale the
|
||||
// shopper actually checked out in, not whatever locale (or none)
|
||||
// happens to be active when the notification is sent. See
|
||||
// NotificationRegistry::register(), which reads this back.
|
||||
'locale' => App::getLocale(),
|
||||
// Lunar copies the discount onto Order.discount_breakdown but not
|
||||
// the coupon CODE itself — that stays on the cart row, which may
|
||||
// since have been cleared/reused for a new cart. Copied here so
|
||||
// the confirmation email always shows what code THIS order was
|
||||
// actually placed with.
|
||||
'coupon_code' => $cart->coupon_code,
|
||||
];
|
||||
$order->save();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user