Added base plugin, in preperation for the API
This commit is contained in:
38
src/Message/CompletePurchaseRequest.php
Normal file
38
src/Message/CompletePurchaseRequest.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Omnipay\Inforbank\Message;
|
||||
|
||||
class CompletePurchaseRequest extends AbstractRequest
|
||||
{
|
||||
protected $endpoint = "https://inforbank.nl/api/statusRequest";
|
||||
|
||||
protected function generateSignature()
|
||||
{
|
||||
return sha1(
|
||||
$this->getTransactionReference() . $this->getClientId() . $this->getClientSecret()
|
||||
);
|
||||
}
|
||||
|
||||
public function getTransactionReference()
|
||||
{
|
||||
return $this->httpRequest->query->get('trxid');
|
||||
}
|
||||
|
||||
public function getData()
|
||||
{
|
||||
$this->validate('merchantId', 'merchantKey');
|
||||
|
||||
$data = array(
|
||||
"clientId" => $this->getClientId(),
|
||||
"clientSecret" => $this->getClientSecret(),
|
||||
"transactionId" => $this->getTransactionReference(),
|
||||
"sha1" => $this->generateSignature()
|
||||
);
|
||||
}
|
||||
|
||||
public function sendData($data)
|
||||
{
|
||||
$httpResponse = $this->httpClient->post($this->endpoint, null, $data)->send();
|
||||
return $this->response = new CompletePurchaseResponse($this, $httpResponse->json());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user