7
7
/**
8
8
* WorldPay Gateway
9
9
*
10
- * @link http ://www .worldpay.com/support/kb/bg/htmlredirect/rhtml.html
10
+ * @link https ://developer .worldpay.com/jsonapi/docs
11
11
*/
12
12
class JsonGateway extends AbstractGateway
13
13
{
14
+ /**
15
+ * Name of the gateway
16
+ *
17
+ * @return string
18
+ */
14
19
public function getName ()
15
20
{
16
21
return 'WorldPay JSON ' ;
17
22
}
18
23
24
+ /**
25
+ * Setup the default parameters
26
+ *
27
+ * @return string[]
28
+ */
19
29
public function getDefaultParameters ()
20
30
{
21
31
return array (
@@ -25,51 +35,109 @@ public function getDefaultParameters()
25
35
);
26
36
}
27
37
38
+ /**
39
+ * Get the stored service key
40
+ *
41
+ * @return string
42
+ */
28
43
public function getServiceKey ()
29
44
{
30
45
return $ this ->getParameter ('serviceKey ' );
31
46
}
32
47
48
+ /**
49
+ * Set the stored service key
50
+ *
51
+ * @param string $value Service key to store
52
+ */
33
53
public function setServiceKey ($ value )
34
54
{
35
55
return $ this ->setParameter ('serviceKey ' , $ value );
36
56
}
37
57
58
+ /**
59
+ * Get the stored merchant ID
60
+ *
61
+ * @return string
62
+ */
38
63
public function getMerchantId ()
39
64
{
40
65
return $ this ->getParameter ('merchantId ' );
41
66
}
42
67
68
+ /**
69
+ * Set the stored merchant ID
70
+ *
71
+ * @param string $value Merchant ID to store
72
+ */
43
73
public function setMerchantId ($ value )
44
74
{
45
75
return $ this ->setParameter ('merchantId ' , $ value );
46
76
}
47
77
78
+ /**
79
+ * Get the stored client key
80
+ *
81
+ * @return string
82
+ */
48
83
public function getClientKey ()
49
84
{
50
85
return $ this ->getParameter ('clientKey ' );
51
86
}
52
87
88
+ /**
89
+ * Set the stored client key
90
+ *
91
+ * @param string $value Client key to store
92
+ */
53
93
public function setClientKey ($ value )
54
94
{
55
95
return $ this ->setParameter ('clientKey ' , $ value );
56
96
}
57
97
98
+ /**
99
+ * Create purchase request
100
+ *
101
+ * @param array $parameters
102
+ *
103
+ * @return \Omnipay\WorldPay\Message\JsonPurchaseRequest
104
+ */
58
105
public function purchase (array $ parameters = array ())
59
106
{
60
107
return $ this ->createRequest ('\Omnipay\WorldPay\Message\JsonPurchaseRequest ' , $ parameters );
61
108
}
62
109
110
+ /**
111
+ * Create authorize request
112
+ *
113
+ * @param array $parameters
114
+ *
115
+ * @return \Omnipay\WorldPay\Message\JsonAuthorizeRequest
116
+ */
63
117
public function authorize (array $ parameters = array ())
64
118
{
65
119
return $ this ->createRequest ('\Omnipay\WorldPay\Message\JsonAuthorizeRequest ' , $ parameters );
66
120
}
67
121
122
+ /**
123
+ * Create refund request
124
+ *
125
+ * @param array $parameters
126
+ *
127
+ * @return \Omnipay\WorldPay\Message\JsonRefundRequest
128
+ */
68
129
public function refund (array $ parameters = array ())
69
130
{
70
131
return $ this ->createRequest ('\Omnipay\WorldPay\Message\JsonRefundRequest ' , $ parameters );
71
132
}
72
133
134
+ /**
135
+ * Create capture request
136
+ *
137
+ * @param array $parameters
138
+ *
139
+ * @return \Omnipay\WorldPay\Message\JsonCaptureRequest
140
+ */
73
141
public function capture (array $ parameters = array ())
74
142
{
75
143
return $ this ->createRequest ('\Omnipay\WorldPay\Message\JsonCaptureRequest ' , $ parameters );
0 commit comments