Completed
Push — master ( ae809f...3d25d5 )
by Vladimir
06:15
created

StatusRequest::getData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 10
Ratio 100 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 10
loc 10
ccs 6
cts 6
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Omnipay\AcquiroPay\Message;
4
5
/**
6
 * Status Request.
7
 *
8
 * @method Response send()
9
 */
10 View Code Duplication
class StatusRequest extends AbstractRequest
0 ignored issues
show
Duplication introduced by
This class 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...
11
{
12
    /**
13
     * Get the raw data array for this message. The format of this varies from gateway to
14
     * gateway, but will usually be either an associative array, or a SimpleXMLElement.
15
     *
16
     * @return mixed
17
     */
18 6
    public function getData()
19
    {
20 6
        $this->validate('transactionReference');
21
22
        return array(
23 6
            'opcode' => 2,
24 6
            'payment_id' => $this->getTransactionReference(),
25 6
            'token' => $this->getRequestToken(),
26 6
        );
27
    }
28
29
    /**
30
     * Get a request token.
31
     *
32
     * @return string
33
     */
34 9
    public function getRequestToken()
35
    {
36 9
        return md5($this->getMerchantId().$this->getTransactionReference().$this->getSecretWord());
37
    }
38
}