1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

38 lines
958 B
PHP

<?php
namespace Omnipay\Inforbank\Message;
class CompletePurchaseRequest extends AbstractRequest
{
protected $endpoint = "http://sgni.nl/~113004/index.php/api/statusRequest";
protected function generateSignature()
{
return hash("sha256",
$this->getTransactionReference() . $this->getClientSecret()
);
}
public function getTransactionReference()
{
return $this->httpRequest->query->get('trxid');
}
public function getData()
{
$data = array(
"clientId" => $this->getClientId(),
"transactionId" => $this->getTransactionReference(),
"hash" => $this->generateSignature()
);
return $data;
}
public function sendData($data)
{
$httpResponse = $this->httpClient->post($this->endpoint, null, $data)->send();
return $this->response = new CompletePurchaseResponse($this, $httpResponse->json());
}
}