Skip to content

Commit

Permalink
Fixed return values.
Browse files Browse the repository at this point in the history
Fixed last of the return values.
  • Loading branch information
addgod committed Aug 28, 2020
1 parent cf68734 commit 198262b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Message/CompleteRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ class CompleteRequest extends AbstractRequest
{
public function getData()
{
return $this->httpRequest->request->all();
return $this->httpRequest->request->all() ?? $this->httpRequest->query->all();
}

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

public function setMerchantId($value)
{
$this->setParameter('merchantId', $value);
}
}
14 changes: 14 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,18 @@ public function testCompletePurchase()
$this->assertSame('payment_Instrument', $response->getTransactionId());
$this->assertSame(500, $response->getTransactionReference());
}

public function testCompleteResponse()
{
$this->getHttpRequest()->request->replace([
'paymentInstrumentId' => '',
'transactionId' => 1,
]);
$request = $this->gateway->completePurchase();
$this->assertInstanceOf(CompleteRequest::class, $request);

$response = $request->send();
$this->assertTrue($response->isSuccessful());
$this->assertSame('250525', $response->getTransactionReference());
}
}

0 comments on commit 198262b

Please sign in to comment.