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

VerifyPaymentMethodRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 30
ccs 8
cts 12
cp 0.6667
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 10 1
A getEndpoint() 0 4 1
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