Skip to content

Commit

Permalink
add binInq request
Browse files Browse the repository at this point in the history
  • Loading branch information
sportakal committed May 29, 2022
1 parent 826ebd7 commit 9f21a86
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
9 changes: 5 additions & 4 deletions samples/threeDSecurePay.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
try {
$result = new \Sportakal\Garantipos\Results\ThreeDSecurePayResult($options);
// ddd($result->getOrder(), $result->getTransaction());
ddd($result->getMdStatus(), $result->getResponseMessage(), $result->getErrorMessage());
ddd($result->getMdStatus(), $result->getMdStatusCode(), $result->getResponseMessage(), $result->getErrorMessage());
} catch (Exception $e) {
ddd($e->getMessage());
}
}


$card = new Card();
$card->setNumber('5549608789641500'); //5406697543211173 //5549608789641500
$card->setNumber('5549608789641501'); //5406697543211173 //5549608789641500
$card->setExpireDate('0323'); //0323 //0323
$card->setCVV2('712'); //465 //712

Expand Down Expand Up @@ -83,9 +83,10 @@
$request->setErrorurl((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");

$response = new ThreeDSecurePay($request);
$response = $response->getResult();
$result = $response->getResult();

echo $response->getHtml();

echo $result->getHtml();
//echo '<pre>';
//dd($response->getRawBody());
//echo '</pre>';
Expand Down
12 changes: 6 additions & 6 deletions src/Results/Constructors/PostResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ public function __construct(Options $options, array $postFields = [])
$this->options = $options;

$this->setMdStatus(in_array((int)$this->postResultModel->mdstatus, [1, 2, 3, 4], true));
$this->setMdStatusCode((int)$this->postResultModel->mdstatus);
$this->setMdErrorMessage($this->postResultModel->mderrormessage);
$this->setResponseMessage($this->postResultModel->response);
$this->setErrorMessage($this->postResultModel->errmsg);
$this->setHostMessage($this->postResultModel->hostmsg);
$this->setReferenceNumber($this->postResultModel->hostrefnum);
$this->setMdStatusCode((int)($this->postResultModel->mdstatus ?? 0));
$this->setMdErrorMessage($this->postResultModel->mderrormessage ?? '');
$this->setResponseMessage($this->postResultModel->response ?? '');
$this->setErrorMessage($this->postResultModel->errmsg ?? '');
$this->setHostMessage($this->postResultModel->hostmsg ?? '');
$this->setReferenceNumber($this->postResultModel->hostrefnum ?? '');

$this->setRequest();
if ($this->getHashData() !== $this->postResultModel->secure3dhash) {
Expand Down
5 changes: 5 additions & 0 deletions src/Results/InitializeThreeDSecureResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,9 @@ public function getHtml(): string
{
return $this->response->getRawBody();
}

public function getData(): array
{
return [$this->response->getRawBody()];
}
}

0 comments on commit 9f21a86

Please sign in to comment.