EscolaLMS/payments

View on GitHub
src/Facades/Fakes/PaymentGatewayFake.php

Summary

Maintainability
A
0 mins
Test Coverage
D
60%
<?php

namespace EscolaLms\Payments\Facades\Fakes;

use EscolaLms\Payments\Gateway\GatewayManager;
use EscolaLms\Payments\Facades\Fakes\FakeDriver;

class PaymentGatewayFake extends GatewayManager
{
    protected ?string $requested_driver = null;

    public function driver($driver = null)
    {
        $this->requested_driver = $driver;
        return new FakeDriver($this->paymentsConfig, $driver);
    }

    public function getRequestedDriver(): ?string
    {
        return $this->requested_driver;
    }
}