Skip to content

Commit

Permalink
Merge pull request #3 from Spell6inder/patch-1
Browse files Browse the repository at this point in the history
fix TransactionService
  • Loading branch information
vladdnepr authored Oct 1, 2019
2 parents 9c4ce83 + f37e4bf commit 19ea0e3
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions src/Domain/TransactionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@

class TransactionService extends TransactionBase
{
/**
* @var string
*/
private $merchantAccount;

/**
* @var CardToken
*/
Expand Down Expand Up @@ -67,7 +72,6 @@ public static function fromArray(array $data)
$data = array_merge($default, $data);

return new self(
$data['merchantTransactionType'],
$data['orderReference'],
new DateTime('@' . $data['createdDate']),
$data['amount'],
Expand All @@ -86,14 +90,14 @@ public static function fromArray(array $data)
isset($data['fee']) ? $data['fee'] : null,
isset($data['baseAmount']) ? $data['baseAmount'] : null,
isset($data['baseCurrency']) ? $data['baseCurrency'] : null,
isset($data['authCode']) ? $data['authCode'] : null,
isset($data['merchantAccount']) ? $data['merchantAccount'] : null,
isset($data['recToken']) ? $data['recToken'] : null,
isset($data['authCode']) ? $data['authCode'] : null,
isset($data['repayUrl']) ? $data['repayUrl'] : null
);
}

public function __construct(
$merchantTransactionType,
$orderReference,
DateTime $createdDate,
$amount, $currency,
Expand All @@ -111,8 +115,9 @@ public function __construct(
$fee = null,
$baseAmount = null,
$baseCurrency = null,
$authCode = null,
$merchantAccount = null,
$recToken = null,
$authCode = null,
$repayUrl = null
) {
parent::__construct(
Expand All @@ -136,9 +141,18 @@ public function __construct(
$baseCurrency
);

$this->repayUrl = strval($repayUrl);
$this->authCode = strval($authCode);
$this->merchantAccount = strval($merchantAccount);
$this->recToken = $recToken ? new CardToken($recToken) : null;
$this->authCode = strval($authCode);
$this->repayUrl = strval($repayUrl);
}

/**
* @return string
*/
public function getMerchantAccount()
{
return $this->merchantAccount;
}

/**
Expand All @@ -164,4 +178,4 @@ public function getRepayUrl()
{
return $this->repayUrl;
}
}
}

0 comments on commit 19ea0e3

Please sign in to comment.