|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Omnipay\Moneris; |
|
4
|
|
|
|
|
5
|
|
|
use Omnipay\Common\AbstractGateway; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* Moneris Gateway. |
|
9
|
|
|
* |
|
10
|
|
|
* @link https://esqa.moneris.com/mpg/reports/transaction/index.php |
|
11
|
|
|
* @link https://developer.moneris.com/en/Documentation/NA/E-Commerce%20Solutions/API/ |
|
12
|
|
|
*/ |
|
13
|
|
|
class Gateway extends AbstractGateway |
|
14
|
|
|
{ |
|
15
|
3 |
|
public function getName() |
|
16
|
|
|
{ |
|
17
|
3 |
|
return 'Moneris'; |
|
18
|
|
|
} |
|
19
|
|
|
|
|
20
|
117 |
|
public function getDefaultParameters() |
|
21
|
|
|
{ |
|
22
|
|
|
return [ |
|
23
|
117 |
|
'merchantId' => '', |
|
24
|
|
|
'merchantKey' => '', |
|
25
|
|
|
'cryptType' => 1, |
|
26
|
|
|
]; |
|
27
|
|
|
} |
|
28
|
|
|
|
|
29
|
3 |
|
public function getMerchantId() |
|
30
|
|
|
{ |
|
31
|
3 |
|
return $this->getParameter('merchantId'); |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
24 |
|
public function setMerchantId($value) |
|
35
|
|
|
{ |
|
36
|
24 |
|
return $this->setParameter('merchantId', $value); |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
3 |
|
public function getMerchantKey() |
|
40
|
|
|
{ |
|
41
|
3 |
|
return $this->getParameter('merchantKey'); |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
24 |
|
public function setMerchantKey($value) |
|
45
|
|
|
{ |
|
46
|
24 |
|
return $this->setParameter('merchantKey', $value); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
6 |
|
public function getCryptType() |
|
50
|
|
|
{ |
|
51
|
6 |
|
return $this->getParameter('cryptType'); |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
24 |
|
public function setCryptType($value) |
|
55
|
|
|
{ |
|
56
|
24 |
|
return $this->setParameter('cryptType', $value); |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
12 |
|
public function createCard(array $parameters = []) |
|
60
|
|
|
{ |
|
61
|
12 |
|
return $this->createRequest('\Omnipay\Moneris\Message\CreateCardRequest', $parameters); |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
12 |
|
public function deleteCard(array $parameters = []) |
|
65
|
|
|
{ |
|
66
|
12 |
|
return $this->createRequest('\Omnipay\Moneris\Message\DeleteCardRequest', $parameters); |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
12 |
|
public function purchase(array $parameters = []) |
|
70
|
|
|
{ |
|
71
|
12 |
|
return $this->createRequest('\Omnipay\Moneris\Message\PurchaseRequest', $parameters); |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
15 |
|
public function refund(array $parameters = []) |
|
75
|
|
|
{ |
|
76
|
15 |
|
return $this->createRequest('\Omnipay\Moneris\Message\RefundRequest', $parameters); |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
12 |
|
public function authorize(array $parameters = []) |
|
80
|
|
|
{ |
|
81
|
12 |
|
return $this->createRequest('\Omnipay\Moneris\Message\AuthorizeRequest', $parameters); |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
12 |
|
public function void(array $parameters = []) |
|
85
|
|
|
{ |
|
86
|
12 |
|
return $this->createRequest('\Omnipay\Moneris\Message\VoidRequest', $parameters); |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
12 |
|
public function capture(array $parameters = []) |
|
90
|
|
|
{ |
|
91
|
12 |
|
return $this->createRequest('\Omnipay\Moneris\Message\CaptureRequest', $parameters); |
|
92
|
|
|
} |
|
93
|
|
|
} |
|
94
|
|
|
|