Code Duplication    Length = 24-24 lines in 6 locations

src/Services/ChargebackService.php 1 location

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

src/Services/CreateAccountService.php 1 location

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

src/Services/CreateOrderService.php 1 location

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

src/Services/TransactionService.php 1 location

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

src/Services/UpdateAccountService.php 1 location

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

src/Services/UpdateOrderService.php 1 location

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