OldCompletePurchaseRequest::sendData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * InterKassa driver for the Omnipay PHP payment processing library
4
 *
5
 * @link      https://github.com/hiqdev/omnipay-interkassa
6
 * @package   omnipay-interkassa
7
 * @license   MIT
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace Omnipay\InterKassa\Message;
12
13
/**
14
 * InterKassa Complete Purchase Request
15
 * Implements request for APIv1.
16
 */
17
class OldCompletePurchaseRequest extends CompletePurchaseRequest
18
{
19
    /**
20
     * Send the request with specified data.
21
     *
22
     * @param mixed $data The data to send
23
     *
24
     * @return OldCompletePurchaseResponse
25
     */
26 4
    public function sendData($data)
27
    {
28 4
        return $this->response = new OldCompletePurchaseResponse($this, $data);
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34 4 View Code Duplication
    public function calculateSign($data, $signKey)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
35
    {
36 4
        unset($data['ik_sign_hash']);
37 4
        ksort($data, SORT_STRING);
38 4
        array_push($data, $signKey);
39 4
        $signAlgorithm = $this->getSignAlgorithm();
40 4
        $signString = implode(':', $data);
41
        return base64_encode(hash($signAlgorithm, $signString, true));
42 4
    }
43
}
44