Skip to content

Commit 8928283

Browse files
committed
Make card requests extend purchase requests to reduce code duplicity
1 parent 58c6ae3 commit 8928283

File tree

2 files changed

+2
-190
lines changed

2 files changed

+2
-190
lines changed

src/Message/RapidSharedCreateCardRequest.php

Lines changed: 1 addition & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
* @link https://eway.io/api-v3/#responsive-shared-page
1414
*/
15-
class RapidSharedCreateCardRequest extends AbstractRequest
15+
class RapidSharedCreateCardRequest extends RapidSharedPurchaseRequest
1616
{
1717
public function getData()
1818
{
@@ -36,98 +36,4 @@ public function getData()
3636

3737
return $data;
3838
}
39-
40-
public function sendData($data)
41-
{
42-
$httpResponse = $this->httpClient->post($this->getEndpoint(), null, json_encode($data))
43-
->setAuth($this->getApiKey(), $this->getPassword())
44-
->send();
45-
46-
return $this->response = new RapidSharedResponse($this, $httpResponse->json());
47-
}
48-
49-
protected function getEndpoint()
50-
{
51-
return $this->getEndpointBase().'/CreateAccessCodeShared.json';
52-
}
53-
54-
public function getCancelUrl()
55-
{
56-
return $this->getParameter('cancelUrl');
57-
}
58-
59-
public function setCancelUrl($value)
60-
{
61-
return $this->setParameter('cancelUrl', $value);
62-
}
63-
64-
public function getLogoUrl()
65-
{
66-
return $this->getParameter('logoUrl');
67-
}
68-
69-
public function setLogoUrl($value)
70-
{
71-
return $this->setParameter('logoUrl', $value);
72-
}
73-
74-
public function getHeaderText()
75-
{
76-
return $this->getParameter('headerText');
77-
}
78-
79-
public function setHeaderText($value)
80-
{
81-
return $this->setParameter('headerText', $value);
82-
}
83-
84-
public function getLanguage()
85-
{
86-
return $this->getParameter('language');
87-
}
88-
89-
public function setLanguage($value)
90-
{
91-
return $this->setParameter('language', $value);
92-
}
93-
94-
public function getCustomerReadOnly()
95-
{
96-
return $this->getParameter('customerReadOnly');
97-
}
98-
99-
public function setCustomerReadOnly($value)
100-
{
101-
return $this->setParameter('customerReadOnly', $value);
102-
}
103-
104-
public function getCustomView()
105-
{
106-
return $this->getParameter('customView');
107-
}
108-
109-
public function setCustomView($value)
110-
{
111-
return $this->setParameter('customView', $value);
112-
}
113-
114-
public function getVerifyCustomerPhone()
115-
{
116-
return $this->getParameter('verifyCustomerPhone');
117-
}
118-
119-
public function setVerifyCustomerPhone($value)
120-
{
121-
return $this->setParameter('verifyCustomerPhone', $value);
122-
}
123-
124-
public function getVerifyCustomerEmail()
125-
{
126-
return $this->getParameter('verifyCustomerEmail');
127-
}
128-
129-
public function setVerifyCustomerEmail($value)
130-
{
131-
return $this->setParameter('verifyCustomerEmail', $value);
132-
}
13339
}

src/Message/RapidSharedUpdateCardRequest.php

Lines changed: 1 addition & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
* @link https://eway.io/api-v3/#responsive-shared-page
1414
*/
15-
class RapidSharedUpdateCardRequest extends AbstractRequest
15+
class RapidSharedUpdateCardRequest extends RapidSharedPurchaseRequest
1616
{
1717
public function getData()
1818
{
@@ -38,98 +38,4 @@ public function getData()
3838

3939
return $data;
4040
}
41-
42-
public function sendData($data)
43-
{
44-
$httpResponse = $this->httpClient->post($this->getEndpoint(), null, json_encode($data))
45-
->setAuth($this->getApiKey(), $this->getPassword())
46-
->send();
47-
48-
return $this->response = new RapidSharedResponse($this, $httpResponse->json());
49-
}
50-
51-
protected function getEndpoint()
52-
{
53-
return $this->getEndpointBase().'/CreateAccessCodeShared.json';
54-
}
55-
56-
public function getCancelUrl()
57-
{
58-
return $this->getParameter('cancelUrl');
59-
}
60-
61-
public function setCancelUrl($value)
62-
{
63-
return $this->setParameter('cancelUrl', $value);
64-
}
65-
66-
public function getLogoUrl()
67-
{
68-
return $this->getParameter('logoUrl');
69-
}
70-
71-
public function setLogoUrl($value)
72-
{
73-
return $this->setParameter('logoUrl', $value);
74-
}
75-
76-
public function getHeaderText()
77-
{
78-
return $this->getParameter('headerText');
79-
}
80-
81-
public function setHeaderText($value)
82-
{
83-
return $this->setParameter('headerText', $value);
84-
}
85-
86-
public function getLanguage()
87-
{
88-
return $this->getParameter('language');
89-
}
90-
91-
public function setLanguage($value)
92-
{
93-
return $this->setParameter('language', $value);
94-
}
95-
96-
public function getCustomerReadOnly()
97-
{
98-
return $this->getParameter('customerReadOnly');
99-
}
100-
101-
public function setCustomerReadOnly($value)
102-
{
103-
return $this->setParameter('customerReadOnly', $value);
104-
}
105-
106-
public function getCustomView()
107-
{
108-
return $this->getParameter('customView');
109-
}
110-
111-
public function setCustomView($value)
112-
{
113-
return $this->setParameter('customView', $value);
114-
}
115-
116-
public function getVerifyCustomerPhone()
117-
{
118-
return $this->getParameter('verifyCustomerPhone');
119-
}
120-
121-
public function setVerifyCustomerPhone($value)
122-
{
123-
return $this->setParameter('verifyCustomerPhone', $value);
124-
}
125-
126-
public function getVerifyCustomerEmail()
127-
{
128-
return $this->getParameter('verifyCustomerEmail');
129-
}
130-
131-
public function setVerifyCustomerEmail($value)
132-
{
133-
return $this->setParameter('verifyCustomerEmail', $value);
134-
}
13541
}

0 commit comments

Comments
 (0)