-
Notifications
You must be signed in to change notification settings - Fork 17
/
DirectGateway.php
67 lines (56 loc) · 1.61 KB
/
DirectGateway.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
/**
* eWAY Legacy Direct XML Payments Gateway
*/
namespace Omnipay\Eway;
use Omnipay\Common\AbstractGateway;
/**
* eWAY Legacy Direct XML Payments Gateway
*
* This class forms the gateway class for eWAY Legacy Direct XML requests.
*
* NOTE: The APIs called by this gateway are older legacy APIs, new integrations should instead
* use eWAY Rapid.
*/
class DirectGateway extends AbstractGateway
{
public function getName()
{
return 'eWAY Direct';
}
public function getDefaultParameters()
{
return [
'customerId' => '',
'testMode' => false,
];
}
public function getCustomerId()
{
return $this->getParameter('customerId');
}
public function setCustomerId($value)
{
return $this->setParameter('customerId', $value);
}
public function authorize(array $parameters = [])
{
return $this->createRequest('\Omnipay\Eway\Message\DirectAuthorizeRequest', $parameters);
}
public function capture(array $parameters = [])
{
return $this->createRequest('\Omnipay\Eway\Message\DirectCaptureRequest', $parameters);
}
public function purchase(array $parameters = [])
{
return $this->createRequest('\Omnipay\Eway\Message\DirectPurchaseRequest', $parameters);
}
public function refund(array $parameters = [])
{
return $this->createRequest('\Omnipay\Eway\Message\DirectRefundRequest', $parameters);
}
public function void(array $parameters = [])
{
return $this->createRequest('\Omnipay\Eway\Message\DirectVoidRequest', $parameters);
}
}