TokenPaymentOneStepRequest::getRelativeUrl()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Korobovn\CloudPayments\Message\Request;
6
7
use Korobovn\CloudPayments\Message\Request\Model\ModelInterface;
8
use Korobovn\CloudPayments\Message\Response\CryptogramTransactionAcceptedResponse;
9
use Korobovn\CloudPayments\Message\Response\CryptogramTransactionRejectedResponse;
10
use Korobovn\CloudPayments\Message\Response\InvalidRequestResponse;
11
use Korobovn\CloudPayments\Message\Strategy\StrategyInterface;
12
use Korobovn\CloudPayments\Message\Strategy\TokenPaymentStrategy;
13
use Korobovn\CloudPayments\Message\Request\Model\TokenPaymentModel;
14
15
/**
16
 * @method TokenPaymentModel getModel()
17
 * @method InvalidRequestResponse|CryptogramTransactionRejectedResponse|CryptogramTransactionAcceptedResponse send()
18
 * @method static TokenPaymentOneStepRequest create()
19
 *
20
 * @see https://developers.cloudpayments.ru/#oplata-po-tokenu-rekarring
21
 */
22
class TokenPaymentOneStepRequest extends AbstractRequest
23
{
24
    /**
25
     * {@inheritDoc}
26
     */
27
    protected function getRelativeUrl(): string
28
    {
29
        return '/payments/tokens/charge';
30
    }
31
32
    /**
33
     * {@inheritDoc}
34
     */
35
    public function createModel(): ModelInterface
36
    {
37
        return new TokenPaymentModel;
38
    }
39
40
    /**
41
     * {@inheritDoc}
42
     */
43
    public function getStrategy(): StrategyInterface
44
    {
45
        return new TokenPaymentStrategy;
46
    }
47
}
48