Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
80.00% |
8 / 10 |
|
66.67% |
4 / 6 |
CRAP | |
0.00% |
0 / 1 |
| RocketDriver | |
80.00% |
8 / 10 |
|
66.67% |
4 / 6 |
6.29 | |
0.00% |
0 / 1 |
| key | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| label | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| configSchema | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
1 | |||
| charge | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| verify | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| isImplemented | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Services\Payment\Drivers; |
| 4 | |
| 5 | use App\Models\Order; |
| 6 | use App\Services\Payment\PaymentResult; |
| 7 | use Illuminate\Http\Request; |
| 8 | |
| 9 | /** |
| 10 | * Scaffolded, not wired to a real charge yet — Rocket (DBBL) has no widely |
| 11 | * published direct merchant checkout API the way bKash/SSLCommerz do; most |
| 12 | * merchants reach it through an aggregator (SSLCommerz already covers this |
| 13 | * indirectly). Declares its config shape so the settings page and registry |
| 14 | * are complete; charge() refuses until someone integrates it against DBBL's |
| 15 | * actual merchant onboarding docs. |
| 16 | */ |
| 17 | class RocketDriver extends AbstractDriver |
| 18 | { |
| 19 | public function key(): string |
| 20 | { |
| 21 | return 'rocket'; |
| 22 | } |
| 23 | |
| 24 | public function label(): string |
| 25 | { |
| 26 | return 'Rocket (DBBL)'; |
| 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 | } |