This repository was archived by the owner on Mar 7, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +145
-19
lines changed Expand file tree Collapse file tree 8 files changed +145
-19
lines changed Original file line number Diff line number Diff line change
1
+ language : php
2
+
3
+ php :
4
+ - 5.3
5
+ - 5.4
6
+ - 5.5
7
+ - 5.6
8
+ - hhvm
9
+
10
+ before_script :
11
+ - composer install -n --dev --prefer-source
12
+
13
+ script : vendor/bin/phpcs --standard=PSR2 src && vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
14
+
15
+ after_script :
16
+ - wget https://scrutinizer-ci.com/ocular.phar
17
+ - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * w-vision
4
+ *
5
+ * LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License version 3 (GPLv3)
8
+ * For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt
9
+ * files that are distributed with this source code.
10
+ *
11
+ * @copyright Copyright (c) 2016 Woche-Pass AG (http://www.w-vision.ch)
12
+ * @license GNU General Public License version 3 (GPLv3)
13
+ */
2
14
3
15
namespace Omnipay \Datatrans ;
4
16
@@ -28,7 +40,8 @@ public function getDefaultParameters()
28
40
* @param $value
29
41
* @return $this
30
42
*/
31
- public function setMerchantId ($ value ) {
43
+ public function setMerchantId ($ value )
44
+ {
32
45
return $ this ->setParameter ('merchantId ' , $ value );
33
46
}
34
47
@@ -37,22 +50,25 @@ public function setMerchantId($value) {
37
50
*
38
51
* @return string
39
52
*/
40
- public function getMerchantId () {
53
+ public function getMerchantId ()
54
+ {
41
55
return $ this ->getParameter ('merchantId ' );
42
56
}
43
57
44
58
/**
45
59
* @param $value
46
60
* @return $this
47
61
*/
48
- public function setSign ($ value ) {
62
+ public function setSign ($ value )
63
+ {
49
64
return $ this ->setParameter ('sign ' , $ value );
50
65
}
51
66
52
67
/**
53
68
* @return string
54
69
*/
55
- public function getSign () {
70
+ public function getSign ()
71
+ {
56
72
return $ this ->getParameter ('sign ' );
57
73
}
58
74
}
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * w-vision
4
+ *
5
+ * LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License version 3 (GPLv3)
8
+ * For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt
9
+ * files that are distributed with this source code.
10
+ *
11
+ * @copyright Copyright (c) 2016 Woche-Pass AG (http://www.w-vision.ch)
12
+ * @license GNU General Public License version 3 (GPLv3)
13
+ */
2
14
3
15
namespace Omnipay \Datatrans ;
4
16
5
- use Omnipay \Common \AbstractGateway ;
6
-
7
17
/**
8
18
* Datatrans Gateway
9
- *
10
- * @TODO: add optional fields
11
19
*/
12
20
class Gateway extends AbstractDatatransGateway
13
21
{
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * w-vision
4
+ *
5
+ * LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License version 3 (GPLv3)
8
+ * For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt
9
+ * files that are distributed with this source code.
10
+ *
11
+ * @copyright Copyright (c) 2016 Woche-Pass AG (http://www.w-vision.ch)
12
+ * @license GNU General Public License version 3 (GPLv3)
13
+ */
2
14
3
15
namespace Omnipay \Datatrans \Message ;
4
16
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * w-vision
4
+ *
5
+ * LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License version 3 (GPLv3)
8
+ * For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt
9
+ * files that are distributed with this source code.
10
+ *
11
+ * @copyright Copyright (c) 2016 Woche-Pass AG (http://www.w-vision.ch)
12
+ * @license GNU General Public License version 3 (GPLv3)
13
+ */
2
14
3
15
namespace Omnipay \Datatrans \Message ;
4
16
5
- use Omnipay \Common \Exception \InvalidResponseException ;
6
-
7
17
class CompletePurchaseRequest extends AbstractRequest
8
18
{
19
+ /**
20
+ * @return array
21
+ */
9
22
public function getData ()
10
23
{
11
24
return $ this ->httpRequest ->request ->all ();
12
25
}
13
26
14
- // Sending the 1.x way
27
+ /**
28
+ * @return ResponseInterface
29
+ */
15
30
public function send ()
16
31
{
17
32
return $ this ->sendData ($ this ->getData ());
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * w-vision
4
+ *
5
+ * LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License version 3 (GPLv3)
8
+ * For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt
9
+ * files that are distributed with this source code.
10
+ *
11
+ * @copyright Copyright (c) 2016 Woche-Pass AG (http://www.w-vision.ch)
12
+ * @license GNU General Public License version 3 (GPLv3)
13
+ */
2
14
3
15
namespace Omnipay \Datatrans \Message ;
4
16
9
21
*/
10
22
class CompletePurchaseResponse extends AbstractResponse
11
23
{
24
+ /**
25
+ * @return bool
26
+ */
12
27
public function isSuccessful ()
13
28
{
14
29
$ status = $ this ->getStatus ();
15
30
16
31
return $ status === 'success ' ;
17
32
}
18
33
34
+ /**
35
+ * @return string
36
+ */
19
37
public function getMessage ()
20
38
{
21
39
if (!$ this ->isSuccessful ()) {
@@ -25,13 +43,19 @@ public function getMessage()
25
43
return '' ;
26
44
}
27
45
28
-
46
+ /**
47
+ * @return string
48
+ */
29
49
public function getTransactionReference ()
30
50
{
31
51
return isset ($ this ->data ['refno ' ]) ? $ this ->data ['refno ' ] : '' ;
32
52
}
33
53
34
- public function getStatus () {
54
+ /**
55
+ * @return mixed
56
+ */
57
+ public function getStatus ()
58
+ {
35
59
return $ this ->data ['status ' ];
36
60
}
37
61
}
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * w-vision
4
+ *
5
+ * LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License version 3 (GPLv3)
8
+ * For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt
9
+ * files that are distributed with this source code.
10
+ *
11
+ * @copyright Copyright (c) 2016 Woche-Pass AG (http://www.w-vision.ch)
12
+ * @license GNU General Public License version 3 (GPLv3)
13
+ */
2
14
3
15
namespace Omnipay \Datatrans \Message ;
4
16
5
- use Omnipay \Common \CreditCard ;
17
+ use Omnipay \Common \Message \ ResponseInterface ;
6
18
7
19
class PurchaseRequest extends AbstractRequest
8
20
{
21
+ /**
22
+ * @var array
23
+ */
9
24
protected $ optionalParams = array (
10
25
11
26
);
12
27
28
+ /**
29
+ * @return array
30
+ */
13
31
public function getData ()
14
32
{
15
33
$ this ->validate ('merchantId ' , 'transactionId ' , 'sign ' );
@@ -40,20 +58,24 @@ public function getData()
40
58
41
59
/**
42
60
* @param $value
43
- * @return $this
61
+ * @return string
44
62
*/
45
- public function setErrorUrl ($ value ) {
63
+ public function setErrorUrl ($ value )
64
+ {
46
65
return $ this ->setParameter ('errorUrl ' , $ value );
47
66
}
48
67
49
68
/**
50
69
* @return string
51
70
*/
52
- public function getErrorUrl () {
71
+ public function getErrorUrl ()
72
+ {
53
73
return $ this ->getParameter ('errorUrl ' );
54
74
}
55
75
56
- // Send request the 1.x way
76
+ /**
77
+ * @return ResponseInterface
78
+ */
57
79
public function send ()
58
80
{
59
81
return $ this ->sendData ($ this ->getData ());
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * w-vision
4
+ *
5
+ * LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License version 3 (GPLv3)
8
+ * For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt
9
+ * files that are distributed with this source code.
10
+ *
11
+ * @copyright Copyright (c) 2016 Woche-Pass AG (http://www.w-vision.ch)
12
+ * @license GNU General Public License version 3 (GPLv3)
13
+ */
2
14
3
15
namespace Omnipay \Datatrans \Message ;
4
16
@@ -74,7 +86,7 @@ protected function getCheckoutEndpoint()
74
86
{
75
87
$ req = $ this ->getRequest ();
76
88
77
- if ($ req ->getTestMode ()) {
89
+ if ($ req ->getTestMode ()) {
78
90
return $ this ->testEndpoint ;
79
91
}
80
92
You can’t perform that action at this time.
0 commit comments