CryptogramPaymentOneStepRequest::createModel()   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\Cryptogram3dSecureAuthRequiredResponse;
9
use Korobovn\CloudPayments\Message\Response\CryptogramTransactionAcceptedResponse;
10
use Korobovn\CloudPayments\Message\Response\CryptogramTransactionRejectedResponse;
11
use Korobovn\CloudPayments\Message\Response\InvalidRequestResponse;
12
use Korobovn\CloudPayments\Message\Strategy\CryptogramPaymentStrategy;
13
use Korobovn\CloudPayments\Message\Request\Model\CryptogramPaymentModel;
14
use Korobovn\CloudPayments\Message\Strategy\StrategyInterface;
15
16
/**
17
 * @method CryptogramPaymentModel getModel()
18
 * @method InvalidRequestResponse|Cryptogram3dSecureAuthRequiredResponse|CryptogramTransactionRejectedResponse|CryptogramTransactionAcceptedResponse send()
19
 * @method static CryptogramPaymentOneStepRequest create()
20
 *
21
 * @see https://developers.cloudpayments.ru/#oplata-po-kriptogramme
22
 */
23
class CryptogramPaymentOneStepRequest extends AbstractRequest
24
{
25
    /**
26
     * {@inheritDoc}
27
     */
28
    protected function getRelativeUrl(): string
29
    {
30
        return '/payments/cards/charge';
31
    }
32
33
    /**
34
     * {@inheritDoc}
35
     */
36
    public function createModel(): ModelInterface
37
    {
38
        return new CryptogramPaymentModel;
39
    }
40
41
    /**
42
     * {@inheritDoc}
43
     */
44
    public function getStrategy(): StrategyInterface
45
    {
46
        return new CryptogramPaymentStrategy;
47
    }
48
}
49