CreatePaymentMethodRequest::setRetained()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1.125

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 4
cp 0.5
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1.125
1
<?php
2
3
namespace Omnipay\Spreedly\Message;
4
5
use Omnipay\Spreedly\Concerns\HasOwnerData;
6
use Omnipay\Spreedly\Message\Concerns\HasPaymentMethodData;
7
8
/**
9
 * @method Response send()
10
 */
11
class CreatePaymentMethodRequest extends AbstractPaymentMethodRequest
12
{
13
    use HasOwnerData, HasPaymentMethodData;
14
15
    /**
16
     * @return array
17
     * @throws \Omnipay\Common\Exception\InvalidCreditCardException
18
     * @throws \Omnipay\Common\Exception\InvalidRequestException
19
     * @throws \Omnipay\Spreedly\Exception\InvalidPaymentMethodException
20
     */
21 4
    public function getData()
22
    {
23 4
        $data = $this->validateAndGetPaymentMethodData();
24
25 4
        $data = $this->fillExistingParameters($data, array(
26 4
            'email' => 'email',
27 4
            'retained' => 'retained',
28 4
            'allow_blank_name' => 'allow_blank_name',
29 4
            'allow_expired_date' => 'allow_expired_date',
30 4
            'allow_blank_date' => 'allow_blank_date',
31 4
            'data' => 'extra',
32 4
        ));
33
34 4
        return array('payment_method' => $data);
35
    }
36
37
    /**
38
     * @return string
39
     */
40 4
    public function getEndpoint()
41
    {
42 4
        return $this->endpoint . 'payment_methods';
43
    }
44
45 4
    public function getRetained()
46
    {
47 4
        return $this->getParameter('retained');
48
    }
49
50 2
    public function setRetained($value)
51
    {
52 2
        return $this->setParameter('retained', $value);
53
    }
54
}
55