1 | <?php |
||
13 | abstract class AbstractMerchant implements MerchantInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var string Unique merchant identification. E.g. paypal, webmoney_usd, webmoney_rub. |
||
17 | */ |
||
18 | public $id; |
||
19 | |||
20 | public $library; |
||
21 | |||
22 | /** |
||
23 | * @var string gateway name, corresponding to namespace, e.g.: paypal, webmoney |
||
24 | */ |
||
25 | public $gateway; |
||
26 | |||
27 | /** |
||
28 | * @var array Data that will be passed to Request |
||
29 | * @see request |
||
30 | */ |
||
31 | public $data = []; |
||
32 | |||
33 | /** |
||
34 | * @var string gateway label that should be used to display the merchant, e.g.: PayPal, WebMoney |
||
35 | */ |
||
36 | public $label; |
||
37 | |||
38 | /** |
||
39 | * @var string request class name |
||
40 | */ |
||
41 | public $requestClass; |
||
42 | |||
43 | /** |
||
44 | * @var string response class name |
||
45 | */ |
||
46 | public $responseClass; |
||
47 | |||
48 | /** |
||
49 | * @return string |
||
50 | */ |
||
51 | public function getLabel() |
||
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | */ |
||
59 | public function getGateway() |
||
63 | |||
64 | /** |
||
65 | * @return string |
||
66 | */ |
||
67 | abstract public function getGatewayNamespacePart(); |
||
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | * @return AbstractRequest |
||
72 | */ |
||
73 | 1 | public function request($type, array $data) |
|
82 | |||
83 | /** |
||
84 | * @param RequestInterface $request |
||
85 | * @return AbstractResponse |
||
86 | */ |
||
87 | 1 | public function response(RequestInterface $request) |
|
95 | |||
96 | /** |
||
97 | * @return string |
||
98 | */ |
||
99 | 1 | public function getRequestClass() |
|
103 | |||
104 | /** |
||
105 | * @return string |
||
106 | */ |
||
107 | 1 | public function getResponseClass() |
|
111 | } |
||
112 |