Skip to content
Prev Previous commit
Extract endpoint action to method
  • Loading branch information
lukeholder committed Aug 18, 2016
commit 36adf99d2ffcc7e462fb713a8bf04b22b744d70c
7 changes: 6 additions & 1 deletion src/Message/HostedPurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,14 @@ public function getData()

public function sendData($data)
{
$httpResponse = $this->sendRequest('/orders', $data, 'POST');
$httpResponse = $this->sendRequest($this->getEndpointAction(), $data, 'POST');
$responseData = json_decode($httpResponse->getBody(true), true);

return $this->response = new HostedPurchaseResponse($this, $responseData);
}

public function getEndpointAction()
{
return '/orders';
}
}