Feat: Updating PaymentDrivers and CheckoutService to handle payment methods

This commit is contained in:
2026-08-31 14:12:21 +03:00
parent 2db1e1331f
commit 9529036585
7 changed files with 179 additions and 71 deletions
+9 -1
View File
@@ -290,6 +290,14 @@ class InstallLunarCommand extends Command
* left untouched. Safe to re-run after a new payment type is added to
* config('lunar.payments.types') (e.g. installing a Stripe/Nexi
* package), which is the whole reason this isn't a one-time-only seed.
*
* Seeded disabled — a newly-seeded row (whether from this store's
* initial install, or a payment provider package installed later)
* shouldn't go live for shoppers before staff have actually reviewed
* it (real credentials configured, a fee set, etc.) and turned it on
* via the Payment Methods resource. See CheckoutService::
* getPaymentMethods(), which only offers a type once both 'enabled'
* here and its driver's own isConfigured() check pass.
*/
private function seedPaymentMethods(): void
{
@@ -302,7 +310,7 @@ class InstallLunarCommand extends Command
PaymentMethod::create([
'type' => $type,
'enabled' => true,
'enabled' => false,
'data' => [],
]);
}