Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
80.00% covered (warning)
80.00%
8 / 10
66.67% covered (warning)
66.67%
4 / 6
CRAP
0.00% covered (danger)
0.00%
0 / 1
UpayDriver
80.00% covered (warning)
80.00%
8 / 10
66.67% covered (warning)
66.67%
4 / 6
6.29
0.00% covered (danger)
0.00%
0 / 1
 key
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 label
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 configSchema
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
1 / 1
1
 charge
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 verify
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 isImplemented
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace App\Services\Payment\Drivers;
4
5use App\Models\Order;
6use App\Services\Payment\PaymentResult;
7use Illuminate\Http\Request;
8
9/**
10 * Scaffolded, not wired to a real charge yet — same reasoning as
11 * RocketDriver: no widely published direct merchant API confidently known
12 * for Upay; most merchants reach it through an aggregator (SSLCommerz
13 * already covers this indirectly). Declares its config shape so the
14 * settings page and registry are complete; charge() refuses until someone
15 * integrates it against UCB's actual merchant onboarding docs.
16 */
17class UpayDriver extends AbstractDriver
18{
19    public function key(): string
20    {
21        return 'upay';
22    }
23
24    public function label(): string
25    {
26        return 'Upay';
27    }
28
29    public function configSchema(): array
30    {
31        return [
32            'merchant_id' => ['type' => 'text', 'label' => 'Merchant ID', 'required' => true],
33            'api_key' => ['type' => 'password', 'label' => 'API Key', 'required' => true],
34            'sandbox' => ['type' => 'toggle', 'label' => 'Sandbox mode', 'default' => true],
35        ];
36    }
37
38    public function charge(Order $order, array $config): PaymentResult
39    {
40        return $this->notImplemented();
41    }
42
43    public function verify(Request $request, array $config): PaymentResult
44    {
45        return $this->notImplemented();
46    }
47
48    public function isImplemented(): bool
49    {
50        return false;
51    }
52}