1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Omnipay\FirstAtlanticCommerce; |
4
|
|
|
|
5
|
|
|
use Omnipay\Common\AbstractGateway; |
6
|
|
|
use Omnipay\FirstAtlanticCommerce\ParameterTrait; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* First Atlantic Commerce Payment Gateway 2 (XML POST Service) |
10
|
|
|
*/ |
11
|
|
|
class Gateway extends AbstractGateway |
12
|
|
|
{ |
13
|
|
|
use ParameterTrait; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* @return string Gateway name. |
17
|
|
|
*/ |
18
|
|
|
public function getName() |
19
|
|
|
{ |
20
|
|
|
return 'First Atlantic Commerce Payment Gateway 2'; |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @return array Default parameters. |
|
|
|
|
25
|
|
|
*/ |
26
|
|
|
public function getDefaultParameters() |
27
|
|
|
{ |
28
|
|
|
return [ |
29
|
|
|
'merchantId' => null, |
30
|
|
|
'merchantPassword' => null, |
31
|
|
|
'acquirerId' => '464748', |
32
|
|
|
'testMode' => false, |
33
|
|
|
'requireAvsCheck' => true |
34
|
|
|
]; |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* Authorize an amount on the customer’s card. |
39
|
|
|
* |
40
|
|
|
* @param array $parameters |
41
|
|
|
* |
42
|
|
|
* @return \Omnipay\FirstAtlanticCommerce\Message\AuthorizeRequest |
43
|
|
|
*/ |
44
|
|
|
public function authorize(array $parameters = []) |
45
|
|
|
{ |
46
|
|
|
return $this->createRequest('\Omnipay\FirstAtlanticCommerce\Message\AuthorizeRequest', $parameters); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* Capture an amount you have previously authorized. |
51
|
|
|
* |
52
|
|
|
* @param array $parameters |
53
|
|
|
* |
54
|
|
|
* @return \Omnipay\FirstAtlanticCommerce\Message\CaptureRequest |
55
|
|
|
*/ |
56
|
|
|
public function capture(array $parameters = []) |
57
|
|
|
{ |
58
|
|
|
return $this->createRequest('\Omnipay\FirstAtlanticCommerce\Message\CaptureRequest', $parameters); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Authorize and immediately capture an amount on the customer’s card. |
63
|
|
|
* |
64
|
|
|
* @param array $parameters |
65
|
|
|
* |
66
|
|
|
* @return \Omnipay\FirstAtlanticCommerce\Message\PurchaseRequest |
67
|
|
|
*/ |
68
|
|
|
public function purchase(array $parameters = []) |
69
|
|
|
{ |
70
|
|
|
return $this->createRequest('\Omnipay\FirstAtlanticCommerce\Message\PurchaseRequest', $parameters); |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* Refund an already processed transaction. |
75
|
|
|
* |
76
|
|
|
* @param array $parameters |
77
|
|
|
* |
78
|
|
|
* @return \Omnipay\FirstAtlanticCommerce\Message\RefundRequest |
79
|
|
|
*/ |
80
|
|
|
public function refund(array $parameters = []) |
81
|
|
|
{ |
82
|
|
|
return $this->createRequest('\Omnipay\FirstAtlanticCommerce\Message\RefundRequest', $parameters); |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* Reverse an already submitted transaction that hasn't been settled. |
87
|
|
|
* |
88
|
|
|
* @param array $parameters |
89
|
|
|
* |
90
|
|
|
* @return \Omnipay\FirstAtlanticCommerce\Message\VoidRequest |
91
|
|
|
*/ |
92
|
|
|
public function void(array $parameters = []) |
93
|
|
|
{ |
94
|
|
|
return $this->createRequest('\Omnipay\FirstAtlanticCommerce\Message\VoidRequest', $parameters); |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* Retrieve the status of any previous transaction. |
99
|
|
|
* |
100
|
|
|
* @param array $parameters |
101
|
|
|
* |
102
|
|
|
* @return \Omnipay\FirstAtlanticCommerce\Message\StatusRequest |
103
|
|
|
*/ |
104
|
|
|
public function status(array $parameters = []) |
105
|
|
|
{ |
106
|
|
|
return $this->createRequest('\Omnipay\FirstAtlanticCommerce\Message\StatusRequest', $parameters); |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* Create a stored card and return the reference token for future transactions. |
111
|
|
|
* |
112
|
|
|
* @param array $parameters |
113
|
|
|
* |
114
|
|
|
* @return \Omnipay\FirstAtlanticCommerce\Message\CreateCardRequest |
115
|
|
|
*/ |
116
|
|
|
public function createCard(array $parameters = []) |
117
|
|
|
{ |
118
|
|
|
return $this->createRequest('\Omnipay\FirstAtlanticCommerce\Message\CreateCardRequest', $parameters); |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* Update a stored card. |
123
|
|
|
* |
124
|
|
|
* @param array $parameters |
125
|
|
|
* |
126
|
|
|
* @return \Omnipay\FirstAtlanticCommerce\Message\UpdateCardRequest |
127
|
|
|
*/ |
128
|
|
|
public function updateCard(array $parameters = []) |
129
|
|
|
{ |
130
|
|
|
return $this->createRequest('\Omnipay\FirstAtlanticCommerce\Message\UpdateCardRequest', $parameters); |
131
|
|
|
} |
132
|
|
|
} |
133
|
|
|
|
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.