CryptogramPaymentOneStepRequest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getStrategy() 0 3 1
A createModel() 0 3 1
A getRelativeUrl() 0 3 1
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