Skip to content

Commit

Permalink
Merge pull request #26 from nuryagdym/master
Browse files Browse the repository at this point in the history
hata duzeltmeler
  • Loading branch information
mewebstudio authored May 17, 2021
2 parents 4983708 + 9704ed5 commit 4e9def2
Show file tree
Hide file tree
Showing 14 changed files with 1,816 additions and 1,566 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ $ mkdir pos-test && cd pos-test
$ composer require mews/pos
```

### Unit testler çalıştırma
Projenin root klasoründe bu satırı çalıştırmanız gerekiyor
```sh
$ ./vendor/bin/phpunit tests
```


**config.php (Ayar dosyası)**
```php
<?php
Expand Down
29 changes: 17 additions & 12 deletions src/Gateways/AbstractGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@

namespace Mews\Pos\Gateways;

use GuzzleHttp\Exception\GuzzleException;
use Mews\Pos\Entity\Account\AbstractPosAccount;
use Mews\Pos\Entity\Card\AbstractCreditCard;
use Mews\Pos\Exceptions\UnsupportedPaymentModelException;
use Mews\Pos\Exceptions\UnsupportedTransactionTypeException;
use Mews\Pos\PosInterface;
use Mews\Pos\PosNet;
use Symfony\Component\Serializer\Encoder\XmlEncoder;
use function Sodium\library_version_major;

/**
* Class AbstractGateway
Expand Down Expand Up @@ -83,9 +80,10 @@ abstract class AbstractGateway implements PosInterface

/**
* AbstractGateway constructor.
* @param $config
*
* @param $config
* @param AbstractPosAccount $account
* @param array $currencies
* @param array $currencies
*/
public function __construct($config, $account, ?array $currencies)
{
Expand Down Expand Up @@ -163,6 +161,11 @@ abstract public function getAccount();
*/
abstract public function getCard();

/**
* @param AbstractCreditCard|null $card
*/
abstract public function setCard($card);

/**
* @return mixed
*/
Expand All @@ -186,7 +189,7 @@ public function createXML(array $nodes, $encoding = 'UTF-8')

return $encoder->encode($nodes[$rootNodeName], 'xml', [
XmlEncoder::ROOT_NODE_NAME => $rootNodeName,
XmlEncoder::ENCODING => $encoding,
XmlEncoder::ENCODING => $encoding,
]);
}

Expand Down Expand Up @@ -292,12 +295,7 @@ public function setTxType(string $txType)
}

/**
* @param AbstractCreditCard|null $card
*
* @return $this
*
* @throws GuzzleException
* @throws UnsupportedPaymentModelException
* @inheritDoc
*/
public function payment($card = null)
{
Expand Down Expand Up @@ -458,6 +456,7 @@ abstract public function createRefundXML();

/**
* Creates 3D Payment XML
*
* @param $responseData
*
* @return string
Expand All @@ -473,6 +472,7 @@ abstract public function get3DFormData();

/**
* prepares order for payment request
*
* @param array $order
*
* @return object
Expand All @@ -481,6 +481,7 @@ abstract protected function preparePaymentOrder(array $order);

/**
* prepares order for TX_POST_PAY type request
*
* @param array $order
*
* @return object
Expand All @@ -489,6 +490,7 @@ abstract protected function preparePostPaymentOrder(array $order);

/**
* prepares order for order status request
*
* @param array $order
*
* @return object
Expand All @@ -497,6 +499,7 @@ abstract protected function prepareStatusOrder(array $order);

/**
* prepares order for history request
*
* @param array $order
*
* @return object
Expand All @@ -505,6 +508,7 @@ abstract protected function prepareHistoryOrder(array $order);

/**
* prepares order for cancel request
*
* @param array $order
*
* @return object
Expand All @@ -513,6 +517,7 @@ abstract protected function prepareCancelOrder(array $order);

/**
* prepares order for refund request
*
* @param array $order
*
* @return object
Expand Down
Loading

0 comments on commit 4e9def2

Please sign in to comment.