Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
dsge authored and StyleCIBot committed Dec 21, 2016
1 parent 58c9c2c commit 6be02cc
Show file tree
Hide file tree
Showing 24 changed files with 896 additions and 664 deletions.
16 changes: 10 additions & 6 deletions src/BadResponseException.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
<?php

namespace Clapp\OtpHu;

use Exception;
use Guzzle\Http\Exception\BadResponseException as BaseBadResponseException;
use SimpleXMLElement;
use Exception;

/**
* amikor http 200 a response, de a base64-elt body-ban hibaüzenet van
* amikor http 200 a response, de a base64-elt body-ban hibaüzenet van.
*/
class BadResponseException extends BaseBadResponseException{
public function __construct($message = "", $code = 0, $previous = null){
class BadResponseException extends BaseBadResponseException
{
public function __construct($message = '', $code = 0, $previous = null)
{
try {
/**
* az otp-s response-okban ilyen furán van benne az exception message
* az otp-s response-okban ilyen furán van benne az exception message.
*
* megpróbáljuk kiszedni belőle
*/
$payload = base64_decode((new SimpleXMLElement($message))->xpath('//result')[0]->__toString());
$message = (new SimpleXMLElement($payload))->xpath('//message')[0]->__toString();
}catch(\Exception $e){}
} catch (\Exception $e) {
}

parent::__construct($message, $code, $previous);
}
Expand Down
14 changes: 9 additions & 5 deletions src/Contract/TransactionIdFactoryContract.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
<?php
/**
* Contains Clapp\OtpHu\Contract\TransactionIdFactoryContract
* Contains Clapp\OtpHu\Contract\TransactionIdFactoryContract.
*/

namespace Clapp\OtpHu\Contract;

/**
* A common interface for classes that can generate transactions IDs
* A common interface for classes that can generate transactions IDs.
*/
interface TransactionIdFactoryContract{
interface TransactionIdFactoryContract
{
/**
* Generate a new, unique transaction ID to be used for a new purchase
* Generate a new, unique transaction ID to be used for a new purchase.
*
* The transaction ID should be unique to the shopID
*
* @param array $parameters merged list of gateway purchase parameters
* @param array $parameters merged list of gateway purchase parameters
*
* @return string new, unique transaction ID
*/
public function generateTransactionId($parameters = []);
Expand Down

0 comments on commit 6be02cc

Please sign in to comment.