Transaction   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 52
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A queryByOrderID() 0 6 1
A queryByRequestID() 0 6 1
A cancelTransaction() 0 6 1
1
<?php
2
/**
3
 * Created By: Henry Ejemuta
4
 * PC: Enrico Systems
5
 * Project: laravel-clubkonnect
6
 * Company: Stimolive Technologies Limited
7
 * Class Name: Transaction.php
8
 * Date Created: 5/14/21
9
 * Time Created: 10:24 AM
10
 */
11
12
namespace HenryEjemuta\LaravelClubKonnect;
13
14
use HenryEjemuta\LaravelClubKonnect\Classes\ClubKonnectResponse;
15
16
abstract class Transaction
17
{
18
    private $clubKonnect;
19
20
    /**
21
     * Transactions constructor.
22
     * @param ClubKonnect $clubKonnect
23
     */
24
    public function __construct(ClubKonnect $clubKonnect)
25
    {
26
        $this->clubKonnect = $clubKonnect;
27
    }
28
29
30
    /**
31
     *
32
     * @param string $orderID
33
     * @return ClubKonnectResponse
34
     */
35
    public function queryByOrderID(string $orderID): ClubKonnectResponse
36
    {
37
        return $this->clubKonnect->withAuth('APIQueryV1.asp', [
38
            'OrderID' => $orderID
39
        ]);
40
    }
41
42
    /**
43
     *
44
     * @param string $requestID
45
     * @return ClubKonnectResponse
46
     */
47
    public function queryByRequestID(string $requestID): ClubKonnectResponse
48
    {
49
        return $this->clubKonnect->withAuth('APIQueryV1.asp', [
50
            'RequestID' => $requestID
51
        ]);
52
    }
53
54
    /**
55
     *
56
     * @param string $orderID
57
     * @return ClubKonnectResponse
58
     */
59
    public function cancelTransaction(string $orderID): ClubKonnectResponse
60
    {
61
        return $this->clubKonnect->withAuth('APICancelV1.asp', [
62
            'OrderID' => $orderID
63
        ]);
64
    }
65
66
67
}
68