1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Empatix\OmnipaySwedbank; |
4
|
|
|
|
5
|
|
|
use Omnipay\Common\AbstractGateway; |
6
|
|
|
|
7
|
|
|
class Gateway extends AbstractGateway |
8
|
|
|
{ |
9
|
|
|
public function getName() |
10
|
|
|
{ |
11
|
|
|
return 'Swedbank Payments'; |
12
|
|
|
} |
13
|
|
|
|
14
|
|
|
public function getDefaultParameters() |
15
|
|
|
{ |
16
|
|
|
return [ |
17
|
|
|
'merchantId' => '', |
18
|
|
|
'password' => '', |
19
|
|
|
'testMode' => false, |
20
|
|
|
]; |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
public function getMerchantId() |
24
|
|
|
{ |
25
|
|
|
return $this->getParameter('merchantId'); |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
public function setMerchantId($value) |
29
|
|
|
{ |
30
|
|
|
return $this->setParameter('merchantId', $value); |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
public function getPassword() |
34
|
|
|
{ |
35
|
|
|
return $this->getParameter('password'); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
public function setPassword($value) |
39
|
|
|
{ |
40
|
|
|
return $this->setParameter('password', $value); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
public function purchase(array $parameters = array()) |
44
|
|
|
{ |
45
|
|
|
return $this->createRequest('Empatix\OmnipaySwedbank\Messages\PurchaseRequest', $parameters); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
public function capture(array $parameters = array()) |
49
|
|
|
{ |
50
|
|
|
return $this->createRequest('Empatix\OmnipaySwedbank\Messages\CaptureRequest', $parameters); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
public function completePurchase(array $parameters = array()) |
54
|
|
|
{ |
55
|
|
|
return $this->createRequest('Empatix\OmnipaySwedbank\Messages\CompletePurchaseRequest', $parameters); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
public function void(array $parameters = array()) |
59
|
|
|
{ |
60
|
|
|
return $this->createRequest('Empatix\OmnipaySwedbank\Messages\AnnulRequest', $parameters); |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
public function refund(array $parameters = array()) |
64
|
|
|
{ |
65
|
|
|
return $this->createRequest('Empatix\OmnipaySwedbank\Messages\ReversalRequest', $parameters); |
66
|
|
|
} |
67
|
|
|
} |
68
|
|
|
|