Passed
Push — feature/paypal-express ( f7c875...7c53e3 )
by Volodymyr
06:16
created

CaptureItemsTransaction::doTransaction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Zed\Braintree\Business\Payment\Transaction;
9
10
use Braintree\Transaction as BraintreeTransaction;
11
use SprykerEco\Zed\Braintree\Business\Payment\Method\ApiConstants;
12
13
class CaptureItemsTransaction extends AbstractTransaction
14
{
15
    /**
16
     * @return string
17
     */
18
    protected function getTransactionType()
19
    {
20
        return ApiConstants::SALE;
21
    }
22
23
    /**
24
     * @return string
25
     */
26
    protected function getTransactionCode()
27
    {
28
        return ApiConstants::TRANSACTION_CODE_CAPTURE;
29
    }
30
31
    /**
32
     * @return \Braintree\Result\Error|\Braintree\Result\Successful
33
     */
34
    protected function doTransaction()
35
    {
36
        return $this->capture();
37
    }
38
39
    /**
40
     * @return \Braintree\Result\Error|\Braintree\Result\Successful
41
     */
42
    protected function capture()
43
    {
44
        return BraintreeTransaction::submitForSettlement($this->getTransactionIdentifier());
45
    }
46
}
47