minor changes

This commit is contained in:
David Remer 2020-04-28 15:03:39 +03:00
parent c9d5417435
commit 389a19ac06
3 changed files with 8 additions and 8 deletions

View file

@ -18,7 +18,7 @@ use Inpsyde\PayPalCommerce\WcGateway\Settings\SettingsFields;
//phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
//phpcs:disable Inpsyde.CodeQuality.ArgumentTypeDeclaration.NoArgumentType
class WcGateway extends WcGatewayBase implements WcGatewayInterface
class WcGateway extends WcGatewayBase
{
public const CAPTURED_META_KEY = '_ppcp_paypal_captured';

View file

@ -57,13 +57,13 @@ class AuthorizedPaymentsProcessor
return self::SUCCESSFUL;
}
protected function payPalOrderFromWcOrder(\WC_Order $wcOrder): Order
private function payPalOrderFromWcOrder(\WC_Order $wcOrder): Order
{
$orderId = $wcOrder->get_meta(WcGateway::ORDER_ID_META_KEY);
return $this->orderEndpoint->order($orderId);
}
protected function allAuthorizations(Order $order): array
private function allAuthorizations(Order $order): array
{
$authorizations = [];
foreach ($order->purchaseUnits() as $purchaseUnit) {
@ -75,14 +75,14 @@ class AuthorizedPaymentsProcessor
return $authorizations;
}
protected function areAuthorizationToCapture(Authorization ...$authorizations): bool
private function areAuthorizationToCapture(Authorization ...$authorizations): bool
{
$alreadyCapturedAuthorizations = $this->authorizationsWithCapturedStatus(...$authorizations);
return count($alreadyCapturedAuthorizations) !== count($authorizations);
}
protected function captureAuthorizations(Authorization ...$authorizations)
private function captureAuthorizations(Authorization ...$authorizations)
{
$uncapturedAuthorizations = $this->authorizationsWithCreatedStatus(...$authorizations);
@ -94,7 +94,7 @@ class AuthorizedPaymentsProcessor
/**
* @return Authorization[]
*/
protected function authorizationsWithCreatedStatus(Authorization ...$authorizations): array
private function authorizationsWithCreatedStatus(Authorization ...$authorizations): array
{
return array_filter(
$authorizations,
@ -107,7 +107,7 @@ class AuthorizedPaymentsProcessor
/**
* @return Authorization[]
*/
protected function authorizationsWithCapturedStatus(Authorization ...$authorizations): array
private function authorizationsWithCapturedStatus(Authorization ...$authorizations): array
{
return array_filter(
$authorizations,

View file

@ -34,7 +34,7 @@ use Inpsyde\PayPalCommerce\ApiClient\Factory\PurchaseUnitFactory;
{
static $initialized;
if (!$initialized) {
$modules = [new PluginModule(__DIR__)];
$modules = [new PluginModule()];
foreach (glob(plugin_dir_path(__FILE__).'modules/*/module.php') as $moduleFile) {
$modules[] = (@require $moduleFile)();
}