Passed
Pull Request — master (#7)
by Lucas
02:44
created

CheckoutEndpointV2   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 13
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getInstallments() 0 3 2
1
<?php
2
3
namespace Ipag\Sdk\Endpoint;
4
5
use Ipag\Sdk\Core\Endpoint;
6
use Ipag\Sdk\Http\Response;
7
use Ipag\Sdk\Model\CheckoutInstallments;
8
9
/**
10
 * CheckoutEndpoint class
11
 *
12
 * Classe responsável pelo controle dos endpoints do recurso Checkout versão `2`.
13
 */
14
class CheckoutEndpointV2 extends Endpoint
15
{
16
    protected string $location = '/service/v2/checkout';
17
18
    /**
19
     * Endpoint para obter parcelamento do recurso `Checkout`.
20
     *
21
     * @param array|null $params
22
     * @return Response
23
     */
24
    public function getInstallments(?CheckoutInstallments $checkoutInstallments = null): Response
25
    {
26
        return $this->_GET(empty($checkoutInstallments) ? [] : $checkoutInstallments->jsonSerialize(), [], '/installments');
27
    }
28
}