Completed
Push — master ( 4a03fb...09659a )
by Gregorio
03:13
created

VerifyPaymentMethodRequest::getData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1.0156

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 6
cts 8
cp 0.75
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
crap 1.0156
1
<?php
2
3
namespace Omnipay\Spreedly\Message;
4
use Omnipay\Spreedly\Message\Concerns\HasGateway;
5
use Omnipay\Spreedly\Message\Concerns\HasPaymentMethodData;
6
7
/**
8
 * @method Response send()
9
 */
10
class VerifyPaymentMethodRequest extends AbstractPaymentMethodRequest
11
{
12
    use HasGateway, HasPaymentMethodData;
13
14
    /**
15
     * @return null
16
     * @throws \Omnipay\Common\Exception\InvalidCreditCardException
17
     * @throws \Omnipay\Common\Exception\InvalidRequestException
18
     * @throws \Omnipay\Spreedly\Exception\InvalidPaymentMethodException
19
     */
20 4
    public function getData()
21
    {
22 4
        $data = $this->validateAndGetPaymentMethodData();
23
24 4
        $data = $this->fillExistingParameters($data, array(
25 4
            'retain_on_success' => 'retain_on_success',
26 4
        ));
27
28 4
        return ['transaction' => $data];
29
    }
30
31
    /**
32
     * @return string
33
     * @throws \Omnipay\Common\Exception\InvalidRequestException
34
     */
35 4
    public function getEndpoint()
36
    {
37 4
        return $this->getGatewayEndpoint() . 'verify';
38
    }
39
}
40