Test Setup Failed
Pull Request — dev (#310)
by Alies
03:54
created

PaymentGatewayServiceProvider::provides()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Diglabby\Doika\Providers;
4
5
use Diglabby\Doika\Services\PaymentGateways\BePaidApiContext;
6
use Diglabby\Doika\Services\PaymentGateways\BePaidPaymentGateway;
7
use Illuminate\Contracts\Support\DeferrableProvider;
8
use Illuminate\Support\ServiceProvider;
9
10
final class PaymentGatewayServiceProvider extends ServiceProvider implements DeferrableProvider
11
{
12
    /** @inheritdoc */
13
    public function register(): void
14
    {
15
        $this->app->singleton(BePaidApiContext::class, function () {
16
17
            return new BePaidApiContext([
18
                'marketId' => config('services.bepaid.marketId'),
19
                'marketKey' => config('services.bepaid.marketKey'),
20
                'live' => config('services.bepaid.live'),
21
            ]);
22
        });
23
24
        $this->app->bind(BePaidPaymentGateway::class, BePaidPaymentGateway::class);
25
    }
26
27
    /** @inheritdoc */
28
    public function provides(): array
29
    {
30
        return [
31
            BePaidApiContext::class,
32
            BePaidPaymentGateway::class,
33
        ];
34
    }
35
}
36