Skip to content

Commit

Permalink
Qa: spaces/tabs, indent
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Feb 26, 2017
1 parent 3709040 commit 9bbaf2d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 30 deletions.
8 changes: 4 additions & 4 deletions src/Api/Entity/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function getAmount()
*/
public function getAmountInCents()
{
return Money::toCents($this->getAmount());
return Money::toCents($this->getAmount());
}

/**
Expand Down Expand Up @@ -353,9 +353,9 @@ public function toArray()
}

$eet = $this->getEet();
if ($eet) {
$data['eet'] = $eet->toArray();
}
if ($eet) {
$data['eet'] = $eet->toArray();
}

return $data;
}
Expand Down
15 changes: 10 additions & 5 deletions src/Api/Entity/PaymentFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static function create($data, $validators = [])
'default_payment_instrument' => 'defaultPaymentInstrument',
'allowed_swifts' => 'allowedSwifts',
'default_swift' => 'defaultSwift',
], $data['payer']);
], $data['payer']);
$payment->setPayer($payer);

if (isset($data['payer']['contact'])) {
Expand All @@ -98,7 +98,7 @@ public static function create($data, $validators = [])
'street' => 'street',
'postal_code' => 'zip',
'country_code' => 'country',
], $data['payer']['contact']);
], $data['payer']['contact']);
$payer->contact = $contact;
}
}
Expand Down Expand Up @@ -130,7 +130,7 @@ public static function create($data, $validators = [])
'name' => 'name',
'amount' => 'amount',
'count' => 'count',
], $param);
], $param);
$payment->addItem($item);
}

Expand Down Expand Up @@ -172,10 +172,15 @@ public static function create($data, $validators = [])
'dan2' => 'taxReducedRateFirst',
'zakl_dan3' => 'taxBaseReducedRateSecond',
'dan3' => 'taxReducedRateSecond',
], $data['eet']);
], $data['eet']);

$eetSum = $eet->getSum();
$eetTaxSum = $eet->getTax() + $eet->getTaxBase() + $eet->getTaxReducedRateFirst() + $eet->getTaxBaseReducedRateFirst() + $eet->getTaxReducedRateSecond() + $eet->getTaxBaseReducedRateSecond();
$eetTaxSum = $eet->getTax()
+ $eet->getTaxBase()
+ $eet->getTaxBaseReducedRateFirst()
+ $eet->getTaxReducedRateFirst()
+ $eet->getTaxBaseReducedRateSecond()
+ $eet->getTaxReducedRateSecond();

if ($validators[self::V_PRICES] === TRUE) {
if ($eetSum !== $eetTaxSum) {
Expand Down
16 changes: 8 additions & 8 deletions src/Service/PaymentsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ public function refundPayment($id, $amount)
}

/**
* @param string $currency
* @return Response
*/
public function getPaymentInstruments($currency)
{
// Make request
return $this->makeRequest('GET', 'eshops/eshop/' . $this->client->getGoId() . '/payment-instruments/' . $currency, NULL, NULL);
}
* @param string $currency
* @return Response
*/
public function getPaymentInstruments($currency)
{
// Make request
return $this->makeRequest('GET', 'eshops/eshop/' . $this->client->getGoId() . '/payment-instruments/' . $currency, NULL, NULL);
}

}
26 changes: 13 additions & 13 deletions tests/cases/unit/Api/Entity/PaymentFactory.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ test(function () {
'order_number' => '001',
'order_description' => 'pojisteni01',
'items' => [
['name' => 'item01', 'amount' => 50, 'count' => 2],
['name' => 'item02', 'amount' => 100],
['name' => 'item01', 'amount' => 50, 'count' => 2],
['name' => 'item02', 'amount' => 100],
],
'additional_params' => [
['name' => 'invoicenumber', 'value' => '2015001003'],
['name' => 'invoicenumber', 'value' => '2015001003'],
],
'return_url' => 'http://www.eshop.cz/return',
'notify_url' => 'http://www.eshop.cz/notify',
Expand All @@ -89,8 +89,8 @@ test(function () {
'order_number' => 3,
'order_description' => 4,
'items' => [
['name' => 'Item 01', 'amount' => 50, 'count' => 2],
['name' => 'Item 01', 'amount' => 50],
['name' => 'Item 01', 'amount' => 50, 'count' => 2],
['name' => 'Item 01', 'amount' => 50],
],
'return_url' => 6,
'notify_url' => 7,
Expand All @@ -109,7 +109,7 @@ test(function () {
'order_number' => 3,
'order_description' => 4,
'items' => [
['amount' => 50],
['amount' => 50],
],
'return_url' => 6,
'notify_url' => 7,
Expand All @@ -129,8 +129,8 @@ test(function () {
'order_number' => 3,
'order_description' => 4,
'items' => [
['name' => 'Item 01', 'amount' => 50],
['name' => 'Item 02', 'amount' => 50],
['name' => 'Item 01', 'amount' => 50],
['name' => 'Item 02', 'amount' => 50],
],
'return_url' => 6,
'notify_url' => 7,
Expand All @@ -149,8 +149,8 @@ test(function () {
'order_number' => 3,
'order_description' => 4,
'items' => [
['amount' => 50],
['amount' => 50],
['amount' => 50],
['amount' => 50],
],
'return_url' => 6,
'notify_url' => 7,
Expand All @@ -173,8 +173,8 @@ test(function () {
'order_number' => 3,
'order_description' => 4,
'items' => [
['name' => 'Item 01', 'amount' => 50, 'count' => 3],
['name' => 'Item 01', 'amount' => 50],
['name' => 'Item 01', 'amount' => 50, 'count' => 3],
['name' => 'Item 01', 'amount' => 50],
],
'return_url' => 6,
'notify_url' => 7,
Expand All @@ -200,7 +200,7 @@ test(function () {
'order_number' => 3,
'order_description' => 4,
'items' => [
['name' => 'Item 01', 'amount' => 50, 'count' => 2],
['name' => 'Item 01', 'amount' => 50, 'count' => 2],
],
'return_url' => 6,
'notify_url' => 7,
Expand Down

0 comments on commit 9bbaf2d

Please sign in to comment.