Test Failed
Push — master ( 4695a7...74b52e )
by Bojan
03:28
created

UpdateHeldTransactionRequest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 24
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setAction() 0 4 1
A setRefTransId() 0 4 1
A attachData() 0 5 1
1
<?php
2
3
namespace CommerceGuys\AuthNet;
4
5
use GuzzleHttp\Client;
6
use CommerceGuys\AuthNet\Request\RequestInterface;
7
8
/**
9
 * Updates a held transaction.
10
 *
11
 * @link https://developer.authorize.net/api/reference/index.html#fraud-management-approve-or-decline-held-transaction
12
 */
13
class UpdateHeldTransactionRequest extends BaseApiRequest
14
{
15
    const APPROVE = 'approve';
16
    const DECLINE = 'decline';
17
18
    protected $action;
19
    protected $refTransId;
20
21
    public function setAction($action)
22
    {
23
        $this->action = $action;
24
    }
25
26
    public function setRefTransId($refTransId)
27
    {
28
        $this->refTransId = $refTransId;
29
    }
30
31
    protected function attachData(RequestInterface $request)
32
    {
33
        $request->addData('action', $this->action);
34
        $request->addData('refTransId', $this->refTransId);
35
    }
36
}
37