Chore: Updates to Notifications
This commit is contained in:
@@ -5,6 +5,8 @@ namespace Modules\Core\Store\Services;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Lunar\Models\Language;
|
||||
use Lunar\Models\Order;
|
||||
use Modules\Core\Order\Services\OrderStatusFlow;
|
||||
use Modules\Core\Store\Events\StoreDetailsUpdated;
|
||||
use Modules\Core\Store\Models\StoreDetails;
|
||||
|
||||
@@ -35,6 +37,24 @@ class StoreDetailsService
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Null for any non-bank-transfer order — the confirmation email only
|
||||
* shows this block when there's actually a wire to send (see
|
||||
* BankTransferPaymentDriver's own docblock for why a bank transfer
|
||||
* order stays at 'awaiting_payment' until staff confirm the wire
|
||||
* arrived). Null also when the store hasn't filled the field in for
|
||||
* $locale, so the caller's own @if($bankTransferInstructions) guard
|
||||
* covers both cases identically.
|
||||
*/
|
||||
public function bankTransferInstructionsFor(Order $order, string $locale): ?string
|
||||
{
|
||||
if (! app(OrderStatusFlow::class)->isBankTransfer($order)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->current()->translate('bank_transfer_instructions', $locale) ?: null;
|
||||
}
|
||||
|
||||
public function update(array $attributes): StoreDetails
|
||||
{
|
||||
$storeDetails = $this->firstOrCreate();
|
||||
|
||||
Reference in New Issue
Block a user