Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Omnipay/AuthorizeNet/Message/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ protected function getBillingData()
return $data;
}

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

return $this->response = new AIMResponse($this, $httpResponse->getBody());
}
Expand Down
4 changes: 2 additions & 2 deletions src/Omnipay/AuthorizeNet/Message/SIMAuthorizeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public function getHash($data)
return hash_hmac('md5', $fingerprint, $this->getTransactionKey());
}

public function send()
public function sendData($data)
{
return $this->response = new SIMAuthorizeResponse($this, $this->getData(), $this->getEndpoint());
return $this->response = new SIMAuthorizeResponse($this, $data, $this->getEndpoint());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function getHash()
return md5($this->getHashSecret().$this->getApiLoginId().$this->getTransactionId().$this->getAmount());
}

public function send()
public function sendData($data)
{
return $this->response = new SIMCompleteAuthorizeResponse($this, $this->getData());
return $this->response = new SIMCompleteAuthorizeResponse($this, $data);
}
}
4 changes: 2 additions & 2 deletions src/Omnipay/Buckaroo/Message/CompletePurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public function generateResponseSignature()
);
}

public function send()
public function sendData($data)
{
return $this->response = new CompletePurchaseResponse($this, $this->getData());
return $this->response = new CompletePurchaseResponse($this, $data);
}
}
4 changes: 2 additions & 2 deletions src/Omnipay/Buckaroo/Message/PurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ public function generateSignature($data)
);
}

public function send()
public function sendData($data)
{
return $this->response = new PurchaseResponse($this, $this->getData());
return $this->response = new PurchaseResponse($this, $data);
}

public function getEndpoint()
Expand Down
4 changes: 1 addition & 3 deletions src/Omnipay/CardSave/Message/PurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,8 @@ public function getData()
return $data;
}

public function send()
public function sendData($data)
{
$data = $this->getData();

// the PHP SOAP library sucks, and SimpleXML can't append element trees
// TODO: find PSR-0 SOAP library
$document = new DOMDocument('1.0', 'utf-8');
Expand Down
7 changes: 7 additions & 0 deletions src/Omnipay/Common/Message/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,13 @@ public function setNotifyUrl($value)
return $this->setParameter('notifyUrl', $value);
}

public function send()
{
$data = $this->getData();

return $this->sendData($data);
}

public function getResponse()
{
if (null === $this->response) {
Expand Down
8 changes: 8 additions & 0 deletions src/Omnipay/Common/Message/RequestInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,12 @@ public function getResponse();
* @return ResponseInterface
*/
public function send();

/**
* Send the request with specified data
*
* @param mixed $data The data to send
* @return ResponseInterface
*/
public function sendData($data);
}
3 changes: 1 addition & 2 deletions src/Omnipay/Dummy/Message/AuthorizeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ public function getData()
return array('amount' => $this->getAmount());
}

public function send()
public function sendData($data)
{
$data = $this->getData();
$data['reference'] = uniqid();
$data['success'] = 0 === substr($this->getCard()->getNumber(), -1, 1) % 2;
$data['message'] = $data['success'] ? 'Success' : 'Failure';
Expand Down
4 changes: 2 additions & 2 deletions src/Omnipay/Eway/Message/RapidPurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public function getData()
return $data;
}

public function send()
public function sendData($data)
{
$httpResponse = $this->httpClient->post($this->getEndpoint(), null, json_encode($this->getData()))
$httpResponse = $this->httpClient->post($this->getEndpoint(), null, json_encode($data))
->setAuth($this->getApiKey(), $this->getPassword())
->send();

Expand Down
4 changes: 2 additions & 2 deletions src/Omnipay/FirstData/Message/CompletePurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public function getData()
return $this->httpRequest->request->all();
}

public function send()
public function sendData($data)
{
return $this->response = new CompletePurchaseResponse($this, $this->getData());
return $this->response = new CompletePurchaseResponse($this, $data);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Omnipay/FirstData/Message/PurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ public function createHash($dateTime, $amount)
return sha1($ascii);
}

public function send()
public function sendData($data)
{
return $this->response = new PurchaseResponse($this, $this->getData());
return $this->response = new PurchaseResponse($this, $data);
}

public function getEndpoint()
Expand Down
4 changes: 2 additions & 2 deletions src/Omnipay/GoCardless/Message/CompletePurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ public function getData()
return $data;
}

public function send()
public function sendData($data)
{
$httpRequest = $this->httpClient->post(
$this->getEndpoint().'/api/v1/confirm',
array('Accept' => 'application/json'),
Gateway::generateQueryString($this->getData())
Gateway::generateQueryString($data)
);
$httpResponse = $httpRequest->setAuth($this->getAppId(), $this->getAppSecret())->send();

Expand Down
4 changes: 2 additions & 2 deletions src/Omnipay/GoCardless/Message/PurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public function getData()
return $data;
}

public function send()
public function sendData($data)
{
return $this->response = new PurchaseResponse($this, $this->getData());
return $this->response = new PurchaseResponse($this, $data);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Omnipay/Manual/Message/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public function getData()
return $this->getParameters();
}

public function send()
public function sendData($data)
{
return $this->response = new Response($this, $this->getData());
return $this->response = new Response($this, $data);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public function getData()
return $data;
}

public function send()
public function sendData($data)
{
return $this->response = new Response($this, $this->getData());
return $this->response = new Response($this, $data);
}

public function getEndpoint()
Expand Down
6 changes: 3 additions & 3 deletions src/Omnipay/Migs/Message/ThreePartyPurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ public function getData()
return $data;
}

public function send()
public function sendData($data)
{
$redirectUrl = $this->getEndpoint().'?'.http_build_query($this->getData());
$redirectUrl = $this->getEndpoint().'?'.http_build_query($data);

return $this->response = new ThreePartyPurchaseResponse($this, $this->getData(), $redirectUrl);
return $this->response = new ThreePartyPurchaseResponse($this, $data, $redirectUrl);
}

public function getEndpoint()
Expand Down
4 changes: 2 additions & 2 deletions src/Omnipay/Migs/Message/TwoPartyPurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public function getData()
return $data;
}

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

return $this->response = new Response($this, $httpResponse->getBody());
}
Expand Down
4 changes: 2 additions & 2 deletions src/Omnipay/Mollie/Message/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ protected function getBaseData()
return $data;
}

public function send()
public function sendData($data)
{
$httpResponse = $this->httpClient->post($this->endpoint, null, $this->getData())->send();
$httpResponse = $this->httpClient->post($this->endpoint, null, $data)->send();

return $this->response = new Response($this, $httpResponse->xml());
}
Expand Down
4 changes: 2 additions & 2 deletions src/Omnipay/MultiSafepay/Message/CompletePurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public function getData()
/**
* {@inheritdoc}
*/
public function send()
public function sendData($data)
{
$httpResponse = $this->httpClient->post(
$this->getEndpoint(),
$this->getHeaders(),
$this->getData()->asXML()
$data->asXML()
)->send();

return $this->response = new CompletePurchaseResponse($this, $httpResponse->xml());
Expand Down
4 changes: 2 additions & 2 deletions src/Omnipay/MultiSafepay/Message/FetchIssuersRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ public function getData()
/**
* {@inheritdoc}
*/
public function send()
public function sendData($data)
{
$httpResponse = $this->httpClient->post(
$this->getEndpoint(),
$this->getHeaders(),
$this->getData()->asXML()
$data->asXML()
)->send();

return $this->response = new FetchIssuersResponse($this, $httpResponse->xml());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ public function getData()
/**
* {@inheritdoc}
*/
public function send()
public function sendData($data)
{
$httpResponse = $this->httpClient->post(
$this->getEndpoint(),
$this->getHeaders(),
$this->getData()->asXML()
$data->asXML()
)->send();

return $this->response = new FetchPaymentMethodsResponse($this, $httpResponse->xml());
Expand Down
4 changes: 2 additions & 2 deletions src/Omnipay/MultiSafepay/Message/PurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ public function getData()
/**
* {@inheritdoc}
*/
public function send()
public function sendData($data)
{
$httpResponse = $this->httpClient->post(
$this->getEndpoint(),
$this->getHeaders(),
$this->getData()->asXML()
$data->asXML()
)->send();

return $this->response = new PurchaseResponse($this, $httpResponse->xml());
Expand Down
4 changes: 2 additions & 2 deletions src/Omnipay/NetBanx/Message/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ public function setCustomerId($value)
*
* @return \Omnipay\Common\Message\ResponseInterface|void
*/
public function send()
public function sendData($data)
{
$httpResponse = $this->httpClient->post($this->getEndpoint(), null, $this->getData())->send();
$httpResponse = $this->httpClient->post($this->getEndpoint(), null, $data)->send();

return $this->response = new Response($this, $httpResponse->getBody());
}
Expand Down
6 changes: 2 additions & 4 deletions src/Omnipay/Netaxept/Message/CompletePurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@ public function getData()
return $data;
}

public function send()
public function sendData($data)
{
$data = $this->getData();

if ('OK' !== $data['responseCode']) {
return $this->response = new ErrorResponse($this, $data);
}

$url = $this->getEndpoint().'/Netaxept/Process.aspx?';
$httpResponse = $this->httpClient->get($url.http_build_query($this->getData()))->send();
$httpResponse = $this->httpClient->get($url.http_build_query($data))->send();

return $this->response = new Response($this, $httpResponse->xml());
}
Expand Down
4 changes: 2 additions & 2 deletions src/Omnipay/Netaxept/Message/PurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ public function getData()
return $data;
}

public function send()
public function sendData($data)
{
$url = $this->getEndpoint().'/Netaxept/Register.aspx?';
$httpResponse = $this->httpClient->get($url.http_build_query($this->getData()))->send();
$httpResponse = $this->httpClient->get($url.http_build_query($data))->send();

return $this->response = new Response($this, $httpResponse->xml());
}
Expand Down
3 changes: 1 addition & 2 deletions src/Omnipay/PayFast/Message/CompletePurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ public function getData()
throw new InvalidRequestException('Missing PDT or ITN variables');
}

public function send()
public function sendData($data)
{
$data = $this->getData();
if (isset($data['pt'])) {
// validate PDT
$url = $this->getEndpoint().'/query/fetch';
Expand Down
4 changes: 2 additions & 2 deletions src/Omnipay/PayFast/Message/PurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ protected function generateSignature($data)
return md5(http_build_query($fields));
}

public function send()
public function sendData($data)
{
return $this->response = new PurchaseResponse($this, $this->getData(), $this->getEndpoint().'/process');
return $this->response = new PurchaseResponse($this, $data, $this->getEndpoint().'/process');
}

public function getEndpoint()
Expand Down
4 changes: 2 additions & 2 deletions src/Omnipay/PayPal/Message/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ protected function getBaseData($method)
return $data;
}

public function send()
public function sendData($data)
{
$url = $this->getEndpoint().'?'.http_build_query($this->getData());
$url = $this->getEndpoint().'?'.http_build_query($data);
$httpResponse = $this->httpClient->get($url)->send();

return $this->createResponse($httpResponse->getBody());
Expand Down
4 changes: 2 additions & 2 deletions src/Omnipay/Payflow/Message/AuthorizeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ public function getData()
return $data;
}

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

return $this->response = new Response($this, $httpResponse->getBody());
}
Expand Down
4 changes: 2 additions & 2 deletions src/Omnipay/PaymentExpress/Message/PxPayAuthorizeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public function getData()
return $data;
}

public function send()
public function sendData($data)
{
$httpResponse = $this->httpClient->post($this->endpoint, null, $this->getData()->asXML())->send();
$httpResponse = $this->httpClient->post($this->endpoint, null, $data->asXML())->send();

return $this->createResponse($httpResponse->xml());
}
Expand Down
Loading