1 | <?php |
||
2 | namespace Omnipay\Pelecard\Message; |
||
3 | /** |
||
4 | * Authorize Request |
||
5 | * |
||
6 | * @method Response send() |
||
7 | */ |
||
8 | class AuthorizeRequest extends AbstractRequest |
||
9 | { |
||
10 | public function getData() |
||
11 | { |
||
12 | $this->validate('amount', 'card'); |
||
13 | //$this->getCard()->validate(); |
||
14 | $data = parent::getData(); |
||
15 | $data['UserKey'] = $this->getTransactionId(); |
||
16 | $data['Total'] = $this->getAmountInteger(); |
||
17 | $data['Currency'] = $this->getCurrency(); |
||
18 | $data['GoodURL'] = $this->getReturnUrl(); |
||
19 | $data['ErrorURL'] = $this->getReturnUrl(); |
||
20 | $data['CancelURL'] = $this->getCancelUrl(); |
||
21 | $data['CardHolderName'] = $this->getCard()->getName(); |
||
22 | $data['CustomerAddressField'] = implode(' ',[$this->getCard()->getAddress1(),$this->getCard()->getAddress2()]); |
||
23 | $data['CustomerCityField'] = $this->getCard()->getCity(); |
||
24 | $data['CustomerIndexField'] = $this->getCard()->getPostcode(); |
||
25 | $data['CustomerCountryField'] = $this->getCard()->getCountry(); |
||
26 | $data['EmailField'] = $this->getCard()->getEmail(); |
||
27 | if($this->getParameter('Language')) $data['Language'] = $this->getParameter('Language'); |
||
28 | if($this->getParameter('QAResultStatus')) $data['QAResultStatus'] = $this->getParameter('QAResultStatus'); |
||
29 | return $data; |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Get GoodURL |
||
34 | * |
||
35 | * @return string |
||
36 | */ |
||
37 | public function getReturnUrl() |
||
38 | { |
||
39 | if (empty($this->getParameter('returnUrl'))) { |
||
40 | throw new InvalidRequestException('returnUrl must be set.'); |
||
0 ignored issues
–
show
|
|||
41 | } |
||
42 | return $this->getParameter('returnUrl'); |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * Set GoodURL |
||
47 | * |
||
48 | * @param string $value |
||
49 | */ |
||
50 | public function setReturnUrl($value) |
||
51 | { |
||
52 | return $this->setParameter('returnUrl', $value); |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * Sets the language code. |
||
57 | * |
||
58 | * @param string $value |
||
59 | */ |
||
60 | public function setLanguage($value) |
||
61 | { |
||
62 | if ($value !== null) { |
||
0 ignored issues
–
show
|
|||
63 | $value = strtoupper($value); |
||
64 | } |
||
65 | if(!in_array($value, ['HE','EN','RU'])) { |
||
66 | throw new RuntimeException('Unknown language'); |
||
0 ignored issues
–
show
|
|||
67 | } |
||
68 | return $this->setParameter('Language', $value); |
||
69 | } |
||
70 | } |
||
71 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths