Completed
Push — master ( 545774...97e732 )
by Andreas
14:33 queued 11:57
created

TransactionFactory::initiate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 4
crap 1
1
<?php
2
3
namespace Larium\Pay;
4
5
use Larium\CreditCard\CreditCard;
6
7
class TransactionFactory
8
{
9 1
    public static function purchase($amount, CreditCard $card, array $extraOptions = [])
10
    {
11 1
        return new Transaction\PurchaseTransaction($amount, $card, $extraOptions);
12
    }
13
14 1
    public static function authorize($amount, CreditCard $card, array $extraOptions = [])
15
    {
16 1
        return new Transaction\AuthorizeTransaction($amount, $card, $extraOptions);
17
    }
18
19 1
    public static function capture($amount, $id, array $extraOptions = [])
20
    {
21 1
        return new Transaction\CaptureTransaction($amount, $id, $extraOptions);
22
    }
23
24 1
    public static function refund($amount, $id, array $extraOptions = [])
25
    {
26 1
        return new Transaction\RefundTransaction($amount, $id, $extraOptions);
27
    }
28
29 1
    public static function cancel($id, array $extraOptions = [])
30
    {
31 1
        return new Transaction\CancelTransaction($id, $extraOptions);
32
    }
33
34 1
    public static function retrieve($id)
35
    {
36 1
        return new Transaction\RetrieveTransaction($id);
37
    }
38
39 1
    public static function initiate(
40
        $amount,
41
        $successUri,
42
        $cancelUri,
43
        array $extraOptions = []
44
    ) {
45 1
        return new Transaction\InitialTransaction(
46 1
            $amount,
47 1
            $successUri,
48 1
            $cancelUri,
49
            $extraOptions
50 1
        );
51
    }
52
53 1
    public static function query(array $criteria)
54
    {
55 1
        return new Transaction\QueryTransaction($criteria);
56
    }
57
58 1
    public static function threedSecureAuthenticate($pares, $transactionId)
59
    {
60 1
        return new Transaction\ThreedSecureAuthenticateTransaction(
61 1
            $pares,
62
            $transactionId
63 1
        );
64
    }
65
66 1
    public static function transfer(
67
        $amount,
68
        $currency,
69
        $recipientIdentifier,
70
        array $extraOptions = []
71
    ) {
72 1
        return new Transaction\TransferTransaction(
73 1
            $amount,
74 1
            $currency,
75 1
            $recipientIdentifier,
76
            $extraOptions
77 1
        );
78
    }
79
}
80