Feat: Updating PaymentDrivers and CheckoutService to handle payment methods
This commit is contained in:
@@ -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'];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user