Completed
Push — master ( b41f42...905377 )
by Gregorio
02:32
created

StorePaymentMethodRequest::getEndpoint()   A

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 0
crap 1.125
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 StorePaymentMethodRequest 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
        return ['transaction' => $data];
25
    }
26
27
    /**
28
     * @return string
29
     * @throws \Omnipay\Common\Exception\InvalidRequestException
30
     */
31 4
    public function getEndpoint()
32
    {
33 4
        return $this->getGatewayEndpoint() . 'store';
34
    }
35
36
    /**
37
     * @return string
38
     */
39 2
    public function getHttpMethod()
40
    {
41 2
        return 'POST';
42
    }
43
}
44