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
+11 -1
View File
@@ -35,6 +35,16 @@ class StripePaymentDriver implements PaymentDriver
private readonly CheckoutService $checkout,
) {}
/**
* Same key lunarphp/stripe's own StripeManager reads its API key from
* (Stripe::setApiKey(config('services.stripe.key')) in
* StripeManager::__construct()) — no key, no usable driver.
*/
public function isConfigured(): bool
{
return filled(config('services.stripe.key'));
}
/**
* @throws PaymentNotConfirmedException if Stripe hasn't confirmed the
* payment intent (wrong intent id, already processed, order already
@@ -43,7 +53,7 @@ class StripePaymentDriver implements PaymentDriver
* @throws FingerprintMismatchException
* @throws CartException
*/
public function confirm(Cart $cart, string $fingerprint, array $data): Order
public function confirm(Cart $cart, string $type, string $fingerprint, array $data): Order
{
$paymentIntentId = $data['payment_intent'];