Completed
Push — master ( ee7786...e4569e )
by Nikolay
53:54 queued 26s
created

CancelPaymentRequest   A

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\CancelPaymentModel;
8
use Korobovn\CloudPayments\Message\Request\Model\ModelInterface;
9
use Korobovn\CloudPayments\Message\Response\InvalidRequestResponse;
10
use Korobovn\CloudPayments\Message\Response\SuccessResponse;
11
use Korobovn\CloudPayments\Message\Strategy\StrategyInterface;
12
use Korobovn\CloudPayments\Message\Strategy\SuccessStrategy;
13
14
/**
15
 * @method CancelPaymentModel getModel()
16
 * @method InvalidRequestResponse|SuccessResponse send()
17
 *
18
 * @see https://developers.cloudpayments.ru/#otmena-oplaty
19
 */
20
class CancelPaymentRequest extends AbstractRequest
21
{
22
    /**
23
     * {@inheritDoc}
24
     */
25
    protected function getRelativeUrl(): string
26
    {
27
        return '/payments/void';
28
    }
29
30
    /**
31
     * {@inheritDoc}
32
     */
33
    public function createModel(): ModelInterface
34
    {
35
        return new CancelPaymentModel;
36
    }
37
38
    /**
39
     * {@inheritDoc}
40
     */
41
    public function getStrategy(): StrategyInterface
42
    {
43
        return new SuccessStrategy;
44
    }
45
}
46