Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Can Sözeri committed Nov 27, 2020
1 parent 1b07c4a commit 0adab41
Show file tree
Hide file tree
Showing 15 changed files with 7 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/Messages/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ public function getVoidParams(): array
}
return $data;
}

/**
* Get HTTP Method.
*
Expand Down Expand Up @@ -214,7 +215,6 @@ protected function updateValue(&$data, $key): void
if (in_array($key, $sensitiveData, true)) {
$data = Mask::mask($data);
}

}

/**
Expand Down
2 changes: 0 additions & 2 deletions src/Messages/BaseParametersTrait.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php


namespace Omnipay\PosNet\Messages;


trait BaseParametersTrait
{
public $xmlServiceUrls = [
Expand Down
4 changes: 1 addition & 3 deletions src/Messages/CompletePurchaseRequest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?php
/*
* PosNet Complete Purchase Request
*/

namespace Omnipay\PosNet\Messages;

Expand Down Expand Up @@ -29,6 +26,7 @@ public function getData()
/**
* @param $data
* @return CompletePurchaseResponse
* @throws \JsonException
*/
protected function createResponse($data): CompletePurchaseResponse
{
Expand Down
4 changes: 0 additions & 4 deletions src/Messages/CompletePurchaseResponse.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<?php
/**
* PosNet Complete Purchase Response
*/

namespace Omnipay\PosNet\Messages;


class CompletePurchaseResponse extends Response
{

Expand Down
2 changes: 0 additions & 2 deletions src/Messages/MacValidationException.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php


namespace Omnipay\PosNet\Messages;


use Exception;

class MacValidationException extends Exception
Expand Down
5 changes: 1 addition & 4 deletions src/Messages/MacValidationRequest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?php
/**
* PosNet Mac Validation Request
*/

namespace Omnipay\PosNet\Messages;

Expand All @@ -28,6 +25,7 @@ public function getData()
/**
* @param $data
* @return MacValidationResponse
* @throws \JsonException
*/
protected function createResponse($data): MacValidationResponse
{
Expand All @@ -38,7 +36,6 @@ protected function createResponse($data): MacValidationResponse
return $response;
}


/**
* @return string
*/
Expand Down
3 changes: 0 additions & 3 deletions src/Messages/MacValidationResponse.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?php
/**
* PosNet Mac Validation Response
*/

namespace Omnipay\PosNet\Messages;

Expand Down
4 changes: 0 additions & 4 deletions src/Messages/Purchase3DResponse.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<?php
/**
* PosNet Authorize Response
*/

namespace Omnipay\PosNet\Messages;


use DOMDocument;

class Purchase3DResponse extends Response
Expand Down
3 changes: 0 additions & 3 deletions src/Messages/PurchaseRequest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?php
/**
* PosNet Purchase Request
*/

namespace Omnipay\PosNet\Messages;

Expand Down
3 changes: 0 additions & 3 deletions src/Messages/PurchaseResponse.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?php
/**
* PosNet Purchase Response
*/

namespace Omnipay\PosNet\Messages;

Expand Down
4 changes: 1 addition & 3 deletions src/Messages/RefundRequest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?php
/**
* PosNet Refund Request
*/

namespace Omnipay\PosNet\Messages;

Expand All @@ -26,6 +23,7 @@ public function getData()
/**
* @param $data
* @return RefundResponse
* @throws \JsonException
*/
protected function createResponse($data): RefundResponse
{
Expand Down
3 changes: 0 additions & 3 deletions src/Messages/RefundResponse.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?php
/**
* PosNet Refund Response
*/

namespace Omnipay\PosNet\Messages;

Expand Down
3 changes: 2 additions & 1 deletion src/Messages/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ class Response extends AbstractResponse implements RedirectResponseInterface
* Response constructor.
* @param RequestInterface $request
* @param $data
* @throws \JsonException
*/
public function __construct(RequestInterface $request, $data)
{
parent::__construct($request, $data);
$parsedXML = @simplexml_load_string($this->data);
$content = json_decode(json_encode((array)$parsedXML), true);
$content = json_decode(json_encode((array)$parsedXML, JSON_THROW_ON_ERROR), true, 512, JSON_THROW_ON_ERROR);
if (json_last_error() !== JSON_ERROR_NONE) {
throw new RuntimeException('Could not resolve xml response to array');
}
Expand Down
5 changes: 1 addition & 4 deletions src/Messages/VoidRequest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?php
/**
* PosNet Void Request
*/

namespace Omnipay\PosNet\Messages;

Expand All @@ -26,6 +23,7 @@ public function getData()
/**
* @param $data
* @return VoidResponse
* @throws \JsonException
*/
protected function createResponse($data): VoidResponse
{
Expand All @@ -36,7 +34,6 @@ protected function createResponse($data): VoidResponse
return $response;
}


/**
* @return string
*/
Expand Down
3 changes: 0 additions & 3 deletions src/Messages/VoidResponse.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?php
/**
* PosNet Void Response
*/

namespace Omnipay\PosNet\Messages;

Expand Down

0 comments on commit 0adab41

Please sign in to comment.