BoletoDecorator::getCustomFields()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 21
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 2

Importance

Changes 2
Bugs 1 Features 0
Metric Value
dl 0
loc 21
ccs 12
cts 12
cp 1
rs 9.3142
c 2
b 1
f 0
cc 2
eloc 13
nc 2
nop 0
crap 2
1
<?php
2
3
/*
4
 * This file is part of gpupo/adyen-sdk
5
 * Created by Gilmar Pupo <[email protected]>
6
 * For the information of copyright and license you should read the file
7
 * LICENSE which is distributed with this source code.
8
 * Para a informação dos direitos autorais e de licença você deve ler o arquivo
9
 * LICENSE que é distribuído com este código-fonte.
10
 * Para obtener la información de los derechos de autor y la licencia debe leer
11
 * el archivo LICENSE que se distribuye con el código fuente.
12
 * For more information, see <https://opensource.gpupo.com/>.
13
 */
14
15
namespace Gpupo\AdyenSdk\Payment\Request\Decorator;
16
17
class BoletoDecorator extends AbstractDecorator
18
{
19 2
    protected function getCustomFields()
20
    {
21
        $data = [
22 2
            'shopperStatement' => 'Não aceitar após o vencimento. Não aceitar o pagamento com cheque',
23 2
            'selectedBrand'    => 'boletobancario_santander',
24 2
            'deliveryDate'     => $this->getOrder()->getDeliveryDate(),
25
        ];
26
27 2
        $socialSecurityNumber = $this->getOrder()->getShopper()->getSocialSecurityNumber();
28
29 2
        if (!empty(intval($socialSecurityNumber))) {
30 2
            $data = array_merge($data, [
31 2
                'shopperName'          => $this->getOrder()->getShopper()->getFullName(),
32 2
                'socialSecurityNumber' => $socialSecurityNumber,
33 2
                'billingAddress'       => $this->getOrder()->getBillingAddress()->toArray(),
34 2
                'shopperName'          => $this->getOrder()->getShopper()->getArrayName(),
35
            ]);
36
        }
37
38 2
        return $data;
39
    }
40
}
41