1
1
<?php
2
- /**
3
- * Created by PhpStorm.
4
- * User: jam
5
- * Date: 24.9.15
6
- * Time: 11:08
7
- */
2
+ declare (strict_types=1 );
8
3
9
4
namespace Trejjam \ThePay \Helper ;
10
5
@@ -25,20 +20,12 @@ function __construct(Trejjam\ThePay\MerchantConfig $config)
25
20
$ this ->config = $ config ;
26
21
}
27
22
28
- /**
29
- * @return Trejjam\ThePay\MerchantConfig
30
- */
31
- public function getMerchantConfig ()
23
+ public function getMerchantConfig () : Trejjam \ThePay \MerchantConfig
32
24
{
33
25
return $ this ->config ;
34
26
}
35
27
36
- /**
37
- * @param bool $onlyActive
38
- *
39
- * @return Tp\DataApi\Responses\GetPaymentMethodsResponse
40
- */
41
- public function getPaymentMethods ($ onlyActive = TRUE )
28
+ public function getPaymentMethods (bool $ onlyActive = TRUE ) : Tp \DataApi \Responses \GetPaymentMethodsResponse
42
29
{
43
30
return Tp \Helper \DataApi::getPaymentMethods ($ this ->config , $ onlyActive );
44
31
}
@@ -49,55 +36,48 @@ public function getPaymentMethods($onlyActive = TRUE)
49
36
*
50
37
* @return null|string
51
38
*/
52
- public function getPaymentMethodIcon (Parameters \MerchantAccountMethod $ method , $ type = 'tight ' )
39
+ public function getPaymentMethodIcon (Parameters \MerchantAccountMethod $ method , string $ type = 'tight ' ) : string
53
40
{
54
41
return Nette \Utils \Strings::replace ($ this ->config ->gateUrl , [
55
- '~/demo-~ ' => '/ ' ,
56
- ]) . 'images/logos/public/ ' . $ type . '/ ' . $ method ->getId () . '.png ' ;
42
+ '~/demo-~ ' => '/ ' ,
43
+ ]) . 'images/logos/public/ ' . $ type . '/ ' . $ method ->getId () . '.png ' ;
57
44
}
58
45
59
- /**
60
- * @param string $paymentId
61
- *
62
- * @return Tp\DataApi\Responses\GetPaymentResponse
63
- */
64
- public function getPayment ($ paymentId )
46
+ public function getPayment (string $ paymentId ) : Tp \DataApi \Responses \GetPaymentResponse
65
47
{
66
48
return Tp \Helper \DataApi::getPayment ($ this ->config , $ paymentId );
67
49
}
68
50
69
- /**
70
- * @param string $paymentId
71
- *
72
- * @return Tp\DataApi\Responses\GetPaymentInstructionsResponse
73
- */
74
- public function getPaymentInstructions ($ paymentId )
51
+ public function getPaymentInstructions (string $ paymentId ) : Tp \DataApi \Responses \GetPaymentInstructionsResponse
75
52
{
76
53
return Tp \Helper \DataApi::getPaymentInstructions ($ this ->config , $ paymentId );
77
54
}
78
55
79
- /**
80
- * @param string $paymentId
81
- *
82
- * @return Tp\DataApi\Responses\GetPaymentStateResponse
83
- */
84
- public function getPaymentState ($ paymentId )
56
+ public function getPaymentState (string $ paymentId ) : Tp \DataApi \Responses \GetPaymentStateResponse
85
57
{
86
58
return Tp \Helper \DataApi::getPaymentState ($ this ->config , $ paymentId );
87
59
}
88
60
89
- /**
90
- * @param Parameters\GetPaymentsSearchParams|NULL $searchParams
91
- * @param Parameters\PaginationRequest|NULL $pagination
92
- * @param Parameters\Ordering|NULL $ordering
93
- *
94
- * @return Tp\DataApi\Responses\GetPaymentsResponse
95
- */
96
61
public function getPayments (
97
62
Parameters \GetPaymentsSearchParams $ searchParams = NULL ,
98
63
Parameters \PaginationRequest $ pagination = NULL ,
99
- Parameters \Ordering $ ordering = NULL )
100
- {
64
+ Parameters \Ordering $ ordering = NULL
65
+ ) : Tp \ DataApi \ Responses \ GetPaymentsResponse {
101
66
return Tp \Helper \DataApi::getPayments ($ this ->config , $ searchParams , $ pagination , $ ordering );
102
67
}
68
+
69
+ /**
70
+ * @param $type
71
+ * @param array $paymentMethods
72
+ *
73
+ * @return Tp\DataApi\Responses\SetPaymentMethodsResponse
74
+ * @throws Tp\InvalidSignatureException
75
+ * @throws Tp\SoapException
76
+ */
77
+ public function setPaymentMethods (
78
+ $ type ,
79
+ array $ paymentMethods = NULL
80
+ ) : Tp \DataApi \Responses \SetPaymentMethodsResponse {
81
+ return Tp \Helper \DataApi::setPaymentMethods ($ this ->config , $ type , $ paymentMethods );
82
+ }
103
83
}
0 commit comments