-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathServerGateway.php
99 lines (88 loc) · 2.75 KB
/
ServerGateway.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
namespace Omnipay\SagePay;
// CHECKME: do we really need these?
use Omnipay\SagePay\Message\ServerAuthorizeRequest;
use Omnipay\SagePay\Message\ServerCompleteAuthorizeRequest;
use Omnipay\SagePay\Message\ServerPurchaseRequest;
use Omnipay\SagePay\Message\ServerNotifyRequest;
use Omnipay\SagePay\Message\SharedTokenRemovalRequest;
use Omnipay\SagePay\Message\ServerTokenRegistrationRequest;
use Omnipay\SagePay\Message\ServerTokenRegistrationCompleteRequest;
/**
* Sage Pay Server Gateway
*/
class ServerGateway extends DirectGateway
{
public function getName()
{
return 'Sage Pay Server';
}
/**
* Authorize a payment.
*/
public function authorize(array $parameters = array())
{
return $this->createRequest(ServerAuthorizeRequest::class, $parameters);
}
/**
* Authorize and capture a payment.
*/
public function purchase(array $parameters = array())
{
return $this->createRequest(ServerPurchaseRequest::class, $parameters);
}
/**
* Handle notification callback.
* Replaces completeAuthorize() and completePurchase()
*/
public function acceptNotification(array $parameters = array())
{
return $this->createRequest(ServerNotifyRequest::class, $parameters);
}
/**
* Accept card details from a user and return a token, without any
* authorization against that card.
* i.e. standalone token creation.
* Omnipay standard function; alias for registerToken()
*/
public function createCard(array $parameters = array())
{
return $this->registerToken($parameters);
}
/**
* Remove a card token from the account.
* Standard Omnipay function.
*/
public function deleteCard(array $parameters = array())
{
return $this->createRequest(SharedTokenRemovalRequest::class, $parameters);
}
/**
* Accept card details from a user and return a token, without any
* authorization against that card.
* i.e. standalone token creation.
* Gateway-specific function.
*/
public function registerToken(array $parameters = array())
{
return $this->createRequest(ServerTokenRegistrationRequest::class, $parameters);
}
/**
* Handle authorize notification callback.
* Please now use acceptNotification()
* @deprecated
*/
public function completeAuthorize(array $parameters = array())
{
return $this->createRequest(ServerCompleteAuthorizeRequest::class, $parameters);
}
/**
* Handle purchase notification callback.
* Please now use acceptNotification()
* @deprecated
*/
public function completePurchase(array $parameters = array())
{
return $this->completeAuthorize($parameters);
}
}