Skip to content

Commit f79a14f

Browse files
committed
Merge pull request #162 from adrianmacneil/custom-send-data
Custom send data parameters
2 parents 48922c1 + f1205c1 commit f79a14f

File tree

47 files changed

+111
-91
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+111
-91
lines changed

src/Omnipay/AuthorizeNet/Message/AbstractRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ protected function getBillingData()
115115
return $data;
116116
}
117117

118-
public function send()
118+
public function sendData($data)
119119
{
120-
$httpResponse = $this->httpClient->post($this->getEndpoint(), null, $this->getData())->send();
120+
$httpResponse = $this->httpClient->post($this->getEndpoint(), null, $data)->send();
121121

122122
return $this->response = new AIMResponse($this, $httpResponse->getBody());
123123
}

src/Omnipay/AuthorizeNet/Message/SIMAuthorizeRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public function getHash($data)
4949
return hash_hmac('md5', $fingerprint, $this->getTransactionKey());
5050
}
5151

52-
public function send()
52+
public function sendData($data)
5353
{
54-
return $this->response = new SIMAuthorizeResponse($this, $this->getData(), $this->getEndpoint());
54+
return $this->response = new SIMAuthorizeResponse($this, $data, $this->getEndpoint());
5555
}
5656
}

src/Omnipay/AuthorizeNet/Message/SIMCompleteAuthorizeRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ public function getHash()
2323
return md5($this->getHashSecret().$this->getApiLoginId().$this->getTransactionId().$this->getAmount());
2424
}
2525

26-
public function send()
26+
public function sendData($data)
2727
{
28-
return $this->response = new SIMCompleteAuthorizeResponse($this, $this->getData());
28+
return $this->response = new SIMCompleteAuthorizeResponse($this, $data);
2929
}
3030
}

src/Omnipay/Buckaroo/Message/CompletePurchaseRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public function generateResponseSignature()
3535
);
3636
}
3737

38-
public function send()
38+
public function sendData($data)
3939
{
40-
return $this->response = new CompletePurchaseResponse($this, $this->getData());
40+
return $this->response = new CompletePurchaseResponse($this, $data);
4141
}
4242
}

src/Omnipay/Buckaroo/Message/PurchaseRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ public function generateSignature($data)
6363
);
6464
}
6565

66-
public function send()
66+
public function sendData($data)
6767
{
68-
return $this->response = new PurchaseResponse($this, $this->getData());
68+
return $this->response = new PurchaseResponse($this, $data);
6969
}
7070

7171
public function getEndpoint()

src/Omnipay/CardSave/Message/PurchaseRequest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,8 @@ public function getData()
7777
return $data;
7878
}
7979

80-
public function send()
80+
public function sendData($data)
8181
{
82-
$data = $this->getData();
83-
8482
// the PHP SOAP library sucks, and SimpleXML can't append element trees
8583
// TODO: find PSR-0 SOAP library
8684
$document = new DOMDocument('1.0', 'utf-8');

src/Omnipay/Common/Message/AbstractRequest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,13 @@ public function setNotifyUrl($value)
321321
return $this->setParameter('notifyUrl', $value);
322322
}
323323

324+
public function send()
325+
{
326+
$data = $this->getData();
327+
328+
return $this->sendData($data);
329+
}
330+
324331
public function getResponse()
325332
{
326333
if (null === $this->response) {

src/Omnipay/Common/Message/RequestInterface.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,12 @@ public function getResponse();
3232
* @return ResponseInterface
3333
*/
3434
public function send();
35+
36+
/**
37+
* Send the request with specified data
38+
*
39+
* @param mixed $data The data to send
40+
* @return ResponseInterface
41+
*/
42+
public function sendData($data);
3543
}

src/Omnipay/Dummy/Message/AuthorizeRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ public function getData()
1818
return array('amount' => $this->getAmount());
1919
}
2020

21-
public function send()
21+
public function sendData($data)
2222
{
23-
$data = $this->getData();
2423
$data['reference'] = uniqid();
2524
$data['success'] = 0 === substr($this->getCard()->getNumber(), -1, 1) % 2;
2625
$data['message'] = $data['success'] ? 'Success' : 'Failure';

src/Omnipay/Eway/Message/RapidPurchaseRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ public function getData()
5757
return $data;
5858
}
5959

60-
public function send()
60+
public function sendData($data)
6161
{
62-
$httpResponse = $this->httpClient->post($this->getEndpoint(), null, json_encode($this->getData()))
62+
$httpResponse = $this->httpClient->post($this->getEndpoint(), null, json_encode($data))
6363
->setAuth($this->getApiKey(), $this->getPassword())
6464
->send();
6565

0 commit comments

Comments
 (0)