CompletePurchaseResponse   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 41
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isSuccessful() 0 4 1
A isPending() 0 4 1
A __construct() 0 9 2
1
<?php
2
3
/**
4
 * InterKassa driver for the Omnipay PHP payment processing library
5
 *
6
 * @link      https://github.com/ange007/omnipay-interkassa
7
 * @package   omnipay-interkassa
8
 * @license   MIT
9
 * @copyright Copyright (c) 2017, ange007 ( original author: HiQDev - http://hiqdev.com/ )
10
 */
11
12
namespace Omnipay\InterKassa\Message;
13
14
use Omnipay\Common\Message\RequestInterface;
15
16
/**
17
 * InterKassa Complete Purchase Response.
18
 * 
19
 * https://www.interkassa.com/documentation-sci/#sci-page-return
20
 */
21
class CompletePurchaseResponse extends AbstractResponse
22
{
23
	/**
24
	 * 
25
	 */
26
	private $errorMessage;
27
	
28
	/**
29
	 * Whether the payment is successful.
30
	 *
31
	 * @return boolean
32
	 */
33
	public function isSuccessful( )
34
	{
35
		return false;
36
	}
37
	
38
    /**
39
     * Is the response successful?
40
     *
41
     * @return boolean
42
     */
43
    public function isPending( )
44
    {
45
        return true;
46
    }
47
	
48
	/**
49
	 * {@inheritdoc}
50
	 */
51
	public function __construct( RequestInterface $request, $data )
52
	{
53
		parent::__construct( $request, $data );
54
55
		if( $this->getCheckoutId( ) !== $this->request->getCheckoutId( ) )
56
		{
57
			$this->errorMessage = 'Wrong checkout ID';
58
		}
59
	}
60
	
61
}
62