Code Duplication    Length = 26-26 lines in 6 locations

src/Services/ChargebackService.php 1 location

@@ 15-40 (lines=26) @@
12
 * @package WSW\SiftScience\Services
13
 * @author Ronaldo Matos Rodrigues <[email protected]>
14
 */
15
class ChargebackService extends BaseService
16
{
17
    use Fractal;
18
19
    /**
20
     * @return Chargeback
21
     */
22
    public function createChargebackBuilder()
23
    {
24
        return new Chargeback();
25
    }
26
27
    /**
28
     * @param Chargeback $event
29
     *
30
     * @return bool
31
     */
32
    public function create(Chargeback $event)
33
    {
34
        $event->setApiKey($this->credentials->getApiKey());
35
        $body = $this->loadItem($event, new ChargebackTransformer)->toJson();
36
        $this->post(static::ENDPOINT, $body);
37
38
        return true;
39
    }
40
}
41

src/Services/CreateAccountService.php 1 location

@@ 15-40 (lines=26) @@
12
 * @package WSW\SiftScience\Services
13
 * @author Ronaldo Matos Rodrigues <[email protected]>
14
 */
15
class CreateAccountService extends BaseService
16
{
17
    use Fractal;
18
19
    /**
20
     * @return CreateAccount
21
     */
22
    public function createAccountBuilder()
23
    {
24
        return new CreateAccount();
25
    }
26
27
    /**
28
     * @param CreateAccount $event
29
     *
30
     * @return bool
31
     */
32
    public function create(CreateAccount $event)
33
    {
34
        $event->setApiKey($this->credentials->getApiKey());
35
        $body = $this->loadItem($event, new AccountTransformer)->toJson();
36
        $this->post(static::ENDPOINT, $body);
37
38
        return true;
39
    }
40
}
41

src/Services/CreateOrderService.php 1 location

@@ 15-40 (lines=26) @@
12
 * @package WSW\SiftScience\Services
13
 * @author Ronaldo Matos Rodrigues <[email protected]>
14
 */
15
class CreateOrderService extends BaseService
16
{
17
    use Fractal;
18
19
    /**
20
     * @return CreateOrder
21
     */
22
    public function createOrderBuilder()
23
    {
24
        return new CreateOrder();
25
    }
26
27
    /**
28
     * @param CreateOrder $order
29
     *
30
     * @return bool
31
     */
32
    public function create(CreateOrder $order)
33
    {
34
        $order->setApiKey($this->credentials->getApiKey());
35
        $body = $this->loadItem($order, new OrderTransformer)->toJson();
36
        $this->post(static::ENDPOINT, $body);
37
38
        return true;
39
    }
40
}
41

src/Services/TransactionService.php 1 location

@@ 15-40 (lines=26) @@
12
 * @package WSW\SiftScience\Services
13
 * @author Ronaldo Matos Rodrigues <[email protected]>
14
 */
15
class TransactionService extends BaseService
16
{
17
    use Fractal;
18
19
    /**
20
     * @return Transaction
21
     */
22
    public function createTransactionBuilder()
23
    {
24
        return new Transaction();
25
    }
26
27
    /**
28
     * @param Transaction $event
29
     *
30
     * @return bool
31
     */
32
    public function create(Transaction $event)
33
    {
34
        $event->setApiKey($this->credentials->getApiKey());
35
        $body = $this->loadItem($event, new TransactionTransformer)->toJson();
36
        $this->post(static::ENDPOINT, $body);
37
38
        return true;
39
    }
40
}
41

src/Services/UpdateAccountService.php 1 location

@@ 15-40 (lines=26) @@
12
 * @package WSW\SiftScience\Services
13
 * @author Ronaldo Matos Rodrigues <[email protected]>
14
 */
15
class UpdateAccountService extends BaseService
16
{
17
    use Fractal;
18
19
    /**
20
     * @return UpdateAccount
21
     */
22
    public function updateAccountBuilder()
23
    {
24
        return new UpdateAccount();
25
    }
26
27
    /**
28
     * @param UpdateAccount $event
29
     *
30
     * @return bool
31
     */
32
    public function update(UpdateAccount $event)
33
    {
34
        $event->setApiKey($this->credentials->getApiKey());
35
        $body = $this->loadItem($event, new AccountTransformer)->toJson();
36
        $this->post(static::ENDPOINT, $body);
37
38
        return true;
39
    }
40
}
41

src/Services/UpdateOrderService.php 1 location

@@ 15-40 (lines=26) @@
12
 * @package WSW\SiftScience\Services
13
 * @author Ronaldo Matos Rodrigues <[email protected]>
14
 */
15
class UpdateOrderService extends BaseService
16
{
17
    use Fractal;
18
19
    /**
20
     * @return UpdateOrder
21
     */
22
    public function updateOrderBuilder()
23
    {
24
        return new UpdateOrder();
25
    }
26
27
    /**
28
     * @param UpdateOrder $order
29
     *
30
     * @return bool
31
     */
32
    public function update(UpdateOrder $order)
33
    {
34
        $order->setApiKey($this->credentials->getApiKey());
35
        $body = $this->loadItem($order, new OrderTransformer)->toJson();
36
        $this->post(static::ENDPOINT, $body);
37
38
        return true;
39
    }
40
}
41