|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Omnipay\AllPay; |
|
4
|
|
|
|
|
5
|
|
|
use Omnipay\AllPay\Message\AuthorizeRequest; |
|
6
|
|
|
use Omnipay\AllPay\Message\CompletePurchaseRequest; |
|
7
|
|
|
use Omnipay\AllPay\Message\PurchaseRequest; |
|
8
|
|
|
use Omnipay\AllPay\Message\RefundRequest; |
|
9
|
|
|
use Omnipay\Common\AbstractGateway; |
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* AllPay Gateway |
|
13
|
|
|
*/ |
|
14
|
|
|
class Gateway extends AbstractGateway |
|
15
|
|
|
{ |
|
16
|
3 |
|
public function getName() |
|
17
|
|
|
{ |
|
18
|
3 |
|
return 'AllPay (allpayx.com)'; |
|
19
|
|
|
} |
|
20
|
|
|
|
|
21
|
81 |
|
public function getDefaultParameters() |
|
22
|
|
|
{ |
|
23
|
|
|
return [ |
|
24
|
81 |
|
'testMode' => false, |
|
25
|
81 |
|
'merchantId' => '', |
|
26
|
81 |
|
'signature' => '', |
|
27
|
81 |
|
'transTime' => date('YmdHis') |
|
28
|
|
|
]; |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
12 |
|
public function setMerchantId($value) |
|
32
|
|
|
{ |
|
33
|
12 |
|
return $this->setParameter('merchantId', $value); |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
3 |
|
public function getMerchantId() |
|
37
|
|
|
{ |
|
38
|
3 |
|
return $this->getParameter('merchantId'); |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
12 |
|
public function setSignature($value) |
|
42
|
|
|
{ |
|
43
|
12 |
|
return $this->setParameter('signature', $value); |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
3 |
|
public function getSignature() |
|
47
|
|
|
{ |
|
48
|
3 |
|
return $this->getParameter('signature'); |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
12 |
|
public function setTransTime($value) |
|
52
|
|
|
{ |
|
53
|
12 |
|
return $this->setParameter('transTime', $value); |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
3 |
|
public function getTransTime() |
|
57
|
|
|
{ |
|
58
|
3 |
|
return $this->getParameter('transTime'); |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
18 |
|
public function purchase(array $options = array()) |
|
62
|
|
|
{ |
|
63
|
18 |
|
return $this->createRequest(PurchaseRequest::class, $options); |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
12 |
|
public function completePurchase(array $options = array()) |
|
67
|
|
|
{ |
|
68
|
12 |
|
return $this->createRequest(CompletePurchaseRequest::class, $options); |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
12 |
|
public function refund(array $options = array()) |
|
72
|
|
|
{ |
|
73
|
12 |
|
return $this->createRequest(RefundRequest::class, $options); |
|
74
|
|
|
} |
|
75
|
|
|
} |
|
76
|
|
|
|