Completed
Push — master ( 98d687...92b683 )
by Andrii
03:05
created

PurchaseRequest::getClient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * RoboKassa driver for Omnipay PHP payment library
4
 *
5
 * @link      https://github.com/hiqdev/omnipay-robokassa
6
 * @package   omnipay-robokassa
7
 * @license   MIT
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace Omnipay\RoboKassa\Message;
12
13
class PurchaseRequest extends AbstractRequest
14
{
15
    public function getCurrency()
16
    {
17
        return $this->getParameter('currency');
18
    }
19
20
    public function setCurrency($value)
21
    {
22
        return $this->setParameter('currency', $value);
23
    }
24
25
    public function getLanguage()
26
    {
27
        return $this->getParameter('language');
28
    }
29
30
    public function setLanguage($value)
31
    {
32
        return $this->setParameter('language', $value);
33
    }
34
35
    public function getSignature()
36
    {
37
        return $this->getParameter('signature');
38
    }
39
40
    public function setSignature($value)
41
    {
42
        return $this->setParameter('signature', $value);
43
    }
44
45
    public function getInvId()
46
    {
47
        return $this->getParameter('inv_id');
48
    }
49
50
    public function setInvId($value)
51
    {
52
        return $this->setParameter('inv_id', $value);
53
    }
54
55
    public function getClient()
56
    {
57
        return $this->getParameter('client');
58
    }
59
60
    public function setClient($value)
61
    {
62
        return $this->setParameter('client', $value);
63
    }
64
65
    public function getTime()
66
    {
67
        return $this->getParameter('time');
68
    }
69
70
    public function setTime($value)
71
    {
72
        return $this->setParameter('time', $value);
73
    }
74
75
    public function getShpCart()
76
    {
77
        return $this->getParameter('shp_cart');
78
    }
79
80
    public function setShpCart($value)
81
    {
82
        return $this->setParameter('shp_cart', $value);
83
    }
84
85
    public function getData()
86
    {
87
        $this->validate(
88
            'purse',
89
            'amount', 'currency', 'description',
90
            'returnUrl', 'cancelUrl', 'notifyUrl'
91
        );
92
93
        return [
94
            'Desc' => $this->getDescription(),
95
            'MrchLogin' => $this->getPurse(),
96
            'OutSum' => $this->getAmount(),
97
            'IncCurrLabel' => $this->getCurrency(),
98
            'InvId' => $this->getInvId(),
99
            'Culture' => $this->getLanguage(),
100
            'ShpCart' => $this->getShpCart(),
101
            'ShpClient' => $this->getClient(),
102
            'ShpTime' => $this->getTime(),
103
            'SignatureValue' => $this->getSignature(),
104
        ];
105
    }
106
107
    public function sendData($data)
108
    {
109
        return $this->response = new PurchaseResponse($this, $data);
110
    }
111
}
112