1 | <?php |
||
8 | class Gateway extends AbstractGateway |
||
9 | { |
||
10 | |||
11 | const GATEWAY_NAME = "Gtpay"; |
||
12 | |||
13 | const GATEWAY_WEBPAY = 'webpay'; |
||
14 | |||
15 | const GATEWAY_BANK = 'ibank'; |
||
16 | |||
17 | // - demo |
||
18 | |||
19 | 1 | public function getName() |
|
23 | |||
24 | /** |
||
25 | * Set Merchant ID parameter as required by Gtpay. |
||
26 | * This is the GTPay-wide unique identifier of merchant, assigned by GTPay and communicated to merchant by GTBank |
||
27 | * @param $merchantId |
||
28 | * @return $this |
||
29 | */ |
||
30 | 39 | public function setMerchantId($merchantId) |
|
34 | |||
35 | /** |
||
36 | * set Gtpay Hash Key Given to Merchant at Setup |
||
37 | * @param $hashKey |
||
38 | * @return $this |
||
39 | */ |
||
40 | 39 | public function setHashKey($hashKey) |
|
44 | |||
45 | /** |
||
46 | * @see Gateway::setHashKey() |
||
47 | * @return mixed |
||
48 | */ |
||
49 | 2 | public function getHashKey() |
|
53 | |||
54 | 39 | public function getDefaultParameters() |
|
55 | { |
||
56 | return [ |
||
57 | 39 | Data::MERCHANT_ID => '', |
|
58 | 39 | Data::HASH_KEY => '', |
|
59 | 'testMode' => true, |
||
60 | 39 | Data::GATEWAY_FIRST=>'no', |
|
61 | 39 | Data::GATEWAY_NAME=>self::GATEWAY_WEBPAY |
|
62 | ]; |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * @see Gateway::setMerchantId() |
||
67 | * @return mixed |
||
68 | */ |
||
69 | 2 | public function getMerchantId() |
|
73 | |||
74 | |||
75 | /** |
||
76 | * |
||
77 | * If specified, then customer cannot choose what gateway to use for the transaction. |
||
78 | * Accepted values are "webpay" or "ibank" (Bank Transfer) only. |
||
79 | * @param $gateway |
||
80 | * @return $this |
||
81 | */ |
||
82 | 39 | public function setGatewayName($gateway) |
|
86 | |||
87 | /** |
||
88 | * @see Gateway::setGatewayName() |
||
89 | * @return mixed |
||
90 | */ |
||
91 | 2 | public function getGatewayName() |
|
95 | |||
96 | /** |
||
97 | * @param $value |
||
98 | * @return $this |
||
99 | */ |
||
100 | 39 | public function setGatewayFirst($value) |
|
104 | |||
105 | 2 | public function getGatewayFirst() |
|
109 | |||
110 | |||
111 | /** |
||
112 | * @param array $parameters |
||
113 | * @return \Omnipay\Common\Message\AbstractRequest|\Omnipay\Common\Message\RequestInterface |
||
114 | */ |
||
115 | 3 | public function purchase(array $parameters = array()) |
|
119 | |||
120 | |||
121 | 13 | public function completePurchase(array $options = array()) |
|
125 | } |
||
126 |