Completed
Push — master ( 2c6af0...6acd1a )
by Mahmoud
05:23
created

Controller::createPaypalAccount()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 1
eloc 7
nc 1
nop 2
1
<?php
2
3
namespace App\Containers\Paypal\UI\API\Controllers;
4
5
use App\Containers\Paypal\Actions\CreatePaypalAccountAction;
6
use App\Containers\Paypal\UI\API\Requests\CreatePaypalAccountRequest;
7
use App\Port\Controller\Abstracts\PortApiController;
8
9
/**
10
 * Class Controller.
11
 *
12
 * @author Mahmoud Zalt <[email protected]>
13
 */
14
class Controller extends PortApiController
15
{
16
17
    /**
18
     * @param \App\Containers\Paypal\UI\API\Requests\CreatePaypalAccountRequest $request
19
     * @param \App\Containers\Paypal\Actions\CreatePaypalAccountAction          $action
20
     *
21
     * @return  \Dingo\Api\Http\Response
22
     */
23
    public function createPaypalAccount(CreatePaypalAccountRequest $request, CreatePaypalAccountAction $action)
24
    {
25
        $paypalAccount = $action->run(
26
            $request->user(),
27
            'some_id' // TODO: To Be Continue...
28
        );
29
30
        return $this->response->accepted(null, [
31
            'message'           => 'Paypal account created successfully.',
32
            'paypal_account_id' => $paypalAccount->id,
33
        ]);
34
    }
35
36
}
37