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

PaymentGatewayServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A provides() 0 5 1
A register() 0 12 1
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