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

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