Skip to content

Commit

Permalink
CHANGE method parameter rearranged so the parameter with default valu…
Browse files Browse the repository at this point in the history
…es are the last
  • Loading branch information
estafilarakis committed Feb 17, 2020
1 parent f37d1ed commit 712beb9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
30 changes: 15 additions & 15 deletions src/Methods/InvoicePaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ public function isActive( BasketRepositoryContract $basketRepositoryContract):bo


return $helper->respectsAllLimitations(
pluginApp(SettingsHelper::class, [$this->settings, $this->systemService->getPlentyId()]),
$isGuest,
$this->checkout->getCustomerInvoiceAddressId(),
$this->checkout->getCustomerShippingAddressId(),
pluginApp(SettingsHelper::class, [$this->settings, $this->systemService->getPlentyId()]),
$isGuest,
$amount,
$this->checkout->getShippingCountryId(),
$amount,
$this->checkout->getCustomerInvoiceAddressId(),
$this->checkout->getCustomerShippingAddressId(),
$contact
);
}
Expand Down Expand Up @@ -223,12 +223,12 @@ public function isSwitchableTo(int $orderId = null):bool
$contact = $order->contactReceiver;

return $helper->respectsAllLimitations(
pluginApp(SettingsHelper::class, [$this->settings, $order->plentyId]),
$contact === null,
$order->billingAddress->id,
$order->deliveryAddress->id,
pluginApp(SettingsHelper::class, [$this->settings, $order->plentyId]),
$contact === null,
$order->amount,
$order->deliveryAddress->countryId,
$order->amount,
$order->billingAddress->id,
$order->deliveryAddress->id,
$contact
);
} catch(\Exception $e) {
Expand All @@ -255,12 +255,12 @@ public function isSwitchableTo(int $orderId = null):bool
$amount->invoiceTotal = $basket->basketAmount;

return $helper->respectsAllLimitations(
pluginApp(SettingsHelper::class, [$this->settings, $this->systemService->getPlentyId()]),
$isGuest,
$this->checkout->getCustomerInvoiceAddressId(),
$this->checkout->getCustomerShippingAddressId(),
pluginApp(SettingsHelper::class, [$this->settings, $this->systemService->getPlentyId()]),
$isGuest,
$amount,
$this->checkout->getShippingCountryId(),
$amount,
$this->checkout->getCustomerInvoiceAddressId(),
$this->checkout->getCustomerShippingAddressId(),
$contact
);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Services/InvoiceLimitationsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ class InvoiceLimitationsService
*
* @param SettingsHelper $settingsHelper The setting helper
* @param bool $isGuest Whether or not the current customer is a guest or not
* @param OrderAmount $amount The total amount
* @param int $shippingCountryId The ID of the shipping country
* @param int $billingAddressId The ID of the billing address
* @param int $deliveryAddressId The ID of the delivery address
* @param int $shippingCountryId The ID of the shipping country
* @param OrderAmount $amount The total amount
* @param Contact|null $contact The contact instance, if customer is not a quest
*
* @return bool
*/
public function respectsAllLimitations(
SettingsHelper $settingsHelper,
bool $isGuest,
OrderAmount $amount,
int $shippingCountryId,
int $billingAddressId = null,
int $deliveryAddressId = null,
int $shippingCountryId,
OrderAmount $amount,
Contact $contact = null
): bool
{
Expand Down

0 comments on commit 712beb9

Please sign in to comment.