Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUPESC-162: Removed using deprecated constant. #41

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/SprykerEco/Shared/Adyen/AdyenConstants.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ interface AdyenConstants
* - URL to Adyen Checkout security fields SDK JS file.
*
* @api
*
* @var string
*/
public const SDK_CHECKOUT_SECURED_FIELDS_URL = 'ADYEN:SDK_CHECKOUT_SECURED_FIELDS_URL';
Expand Down Expand Up @@ -93,6 +94,7 @@ interface AdyenConstants
* - Return URL for Klarna payment method.
*
* @api
*
* @var string
*/
public const KLARNA_RETURN_URL = 'ADYEN:KLARNA_RETURN_URL';
Expand All @@ -102,6 +104,7 @@ interface AdyenConstants
* - URL to Adyen Checkout shopper SDK JS file.
*
* @api
*
* @var string
*/
public const SDK_CHECKOUT_SHOPPER_JS_URL = 'ADYEN:SDK_CHECKOUT_SHOPPER_JS_URL';
Expand All @@ -111,6 +114,7 @@ interface AdyenConstants
* - URL to Adyen Checkout shopper SDK CSS file.
*
* @api
*
* @var string
*/
public const SDK_CHECKOUT_SHOPPER_CSS_URL = 'ADYEN:SDK_CHECKOUT_SHOPPER_CSS_URL';
Expand All @@ -120,6 +124,7 @@ interface AdyenConstants
* - Subresource Integrity (SRI) hash for Checkout shopper SDK JS file.
*
* @api
*
* @var string
*/
public const SDK_CHECKOUT_SHOPPER_JS_INTEGRITY_HASH = 'ADYEN:SDK_CHECKOUT_SHOPPER_JS_INTEGRITY_HASH';
Expand All @@ -129,6 +134,7 @@ interface AdyenConstants
* - Subresource Integrity (SRI) hash for Checkout shopper SDK CSS file.
*
* @api
*
* @var string
*/
public const SDK_CHECKOUT_SHOPPER_CSS_INTEGRITY_HASH = 'ADYEN:SDK_CHECKOUT_SHOPPER_CSS_INTEGRITY_HASH';
Expand All @@ -138,6 +144,7 @@ interface AdyenConstants
* - Adyen Environment name for SDK.
*
* @api
*
* @var string
*/
public const SDK_ENVIRONMENT = 'ADYEN:SDK_ENVIRONMENT';
Expand Down
4 changes: 2 additions & 2 deletions src/SprykerEco/Yves/Adyen/AdyenConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class AdyenConfig extends AbstractBundleConfig
/**
* @api
*
* @return string[]
* @return array<string>
*/
public function getSocialSecurityNumberCountriesMandatory(): array
{
Expand All @@ -25,7 +25,7 @@ public function getSocialSecurityNumberCountriesMandatory(): array
/**
* @api
*
* @return string[]
* @return array<string>
*/
public function getIdealIssuersList(): array
{
Expand Down
5 changes: 4 additions & 1 deletion src/SprykerEco/Yves/Adyen/AdyenDependencyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
use SprykerEco\Yves\Adyen\Dependency\Service\AdyenToUtilEncodingServiceBridge;
use SprykerEco\Yves\Adyen\Plugin\Payment\KlarnaInvoicePaymentMapperPlugin;

/**
* @method \SprykerEco\Zed\Adyen\AdyenConfig getConfig()
*/
class AdyenDependencyProvider extends AbstractBundleDependencyProvider
{
/**
Expand Down Expand Up @@ -128,7 +131,7 @@ protected function addAdyenPaymentPlugins(Container $container): Container
}

/**
* @return \SprykerEco\Yves\Adyen\Plugin\Payment\AdyenPaymentMapperPluginInterface[]
* @return array<\SprykerEco\Yves\Adyen\Plugin\Payment\AdyenPaymentMapperPluginInterface>
*/
protected function getAdyenPaymentPlugins(): array
{
Expand Down
16 changes: 8 additions & 8 deletions src/SprykerEco/Yves/Adyen/AdyenFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function createAdyenPaymentHandler(): AdyenPaymentHandlerInterface
{
return new AdyenPaymentHandler(
$this->getAdyenService(),
$this->getAdyenPaymentPlugins()
$this->getAdyenPaymentPlugins(),
);
}

Expand Down Expand Up @@ -139,7 +139,7 @@ public function createCreditCardFormDataProvider(): StepEngineFormDataProviderIn
$this->getQuoteClient(),
$this->getConfig(),
$this->getAdyenClient(),
$this->getUtilEncodingService()
$this->getUtilEncodingService(),
);
}

Expand All @@ -166,7 +166,7 @@ public function createKlarnaInvoiceFormDataProvider(): StepEngineFormDataProvide
{
return new KlarnaInvoiceFormDataProvider(
$this->getQuoteClient(),
$this->getConfig()
$this->getConfig(),
);
}

Expand All @@ -185,7 +185,7 @@ public function createIdealFormDataProvider(): StepEngineFormDataProviderInterfa
{
return new IdealFormDataProvider(
$this->getQuoteClient(),
$this->getConfig()
$this->getConfig(),
);
}

Expand Down Expand Up @@ -220,7 +220,7 @@ public function createOnlineTransferRedirectHandler(): AdyenRedirectHandlerInter
{
return new OnlineTransferRedirectHandler(
$this->getQuoteClient(),
$this->getAdyenClient()
$this->getAdyenClient(),
);
}

Expand All @@ -231,7 +231,7 @@ public function createCreditCard3dRedirectHandler(): AdyenRedirectHandlerInterfa
{
return new CreditCard3dRedirectHandler(
$this->getQuoteClient(),
$this->getAdyenClient()
$this->getAdyenClient(),
);
}

Expand All @@ -242,7 +242,7 @@ public function createNotificationHandler(): AdyenNotificationHandlerInterface
{
return new AdyenNotificationHandler(
$this->getAdyenClient(),
$this->createNotificationMapper()
$this->createNotificationMapper(),
);
}

Expand All @@ -255,7 +255,7 @@ public function createNotificationMapper(): AdyenNotificationMapperInterface
}

/**
* @return \SprykerEco\Yves\Adyen\Plugin\Payment\AdyenPaymentMapperPluginInterface[]
* @return array<\SprykerEco\Yves\Adyen\Plugin\Payment\AdyenPaymentMapperPluginInterface>
*/
public function getAdyenPaymentPlugins(): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected function createAcceptedResponse(): Response
return new Response(
$this->getFactory()->getUtilEncodingService()->encodeJson(static::NOTIFICATION_ACCEPTED_RESPONSE_BODY),
Response::HTTP_OK,
static::NOTIFICATION_ACCEPTED_RESPONSE_HEADER
static::NOTIFICATION_ACCEPTED_RESPONSE_HEADER,
);
}
}
4 changes: 2 additions & 2 deletions src/SprykerEco/Yves/Adyen/Form/AbstractSubForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ protected function createNotBlankConstraint(array $options = []): Constraint
return new NotBlank(
array_merge(
['groups' => $this->getPropertyPath()],
$options
)
$options,
),
);
}
}
11 changes: 6 additions & 5 deletions src/SprykerEco/Yves/Adyen/Form/CreditCardSubForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
class CreditCardSubForm extends AbstractSubForm
{
/**
* @deprecated Will be removed without replacement. BC-reason only.
*
* @var string
*/
public const SDK_CHECKOUT_SECURED_FIELDS_URL = 'sdkUrl';
Expand Down Expand Up @@ -144,7 +146,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
'message' => static::GLOSSARY_KEY_CONSTRAINT_MESSAGE_INVALID_CARD_NUMBER,
]),
],
]
],
);

$builder->add(
Expand All @@ -156,7 +158,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
'message' => static::GLOSSARY_KEY_CONSTRAINT_MESSAGE_INVALID_EXPIRY_YEAR,
]),
],
]
],
);

$builder->add(
Expand All @@ -168,7 +170,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
'message' => static::GLOSSARY_KEY_CONSTRAINT_MESSAGE_INVALID_EXPIRY_MONTH,
]),
],
]
],
);

$builder->add(
Expand All @@ -180,7 +182,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
'message' => static::GLOSSARY_KEY_CONSTRAINT_MESSAGE_INVALID_SECURITY_CODE,
]),
],
]
],
);
}

Expand Down Expand Up @@ -208,7 +210,6 @@ public function buildView(FormView $view, FormInterface $form, array $options):
parent::buildView($view, $form, $options);

$selectedOptions = $options[static::OPTIONS_FIELD_NAME];
$view->vars[static::SDK_CHECKOUT_SECURED_FIELDS_URL] = $selectedOptions[static::SDK_CHECKOUT_SECURED_FIELDS_URL];
$view->vars[static::SDK_CHECKOUT_ORIGIN_KEY] = $selectedOptions[static::SDK_CHECKOUT_ORIGIN_KEY];
$view->vars[static::SDK_CHECKOUT_SHOPPER_JS_URL] = $selectedOptions[static::SDK_CHECKOUT_SHOPPER_JS_URL];
$view->vars[static::SDK_CHECKOUT_SHOPPER_CSS_URL] = $selectedOptions[static::SDK_CHECKOUT_SHOPPER_CSS_URL];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public function getOptions(AbstractTransfer $quoteTransfer): array
$availablePaymentMethodsData = $this->getAvailablePaymentMethodsData($quoteTransfer);

return [
CreditCardSubForm::SDK_CHECKOUT_SECURED_FIELDS_URL => $this->config->getSdkCheckoutSecuredFieldsUrl(),
CreditCardSubForm::SDK_CHECKOUT_ORIGIN_KEY => $this->config->getSdkCheckoutOriginKey(),
CreditCardSubForm::SDK_CHECKOUT_SHOPPER_JS_URL => $this->config->getSdkCheckoutShopperJsUrl(),
CreditCardSubForm::SDK_CHECKOUT_SHOPPER_CSS_URL => $this->config->getSdkCheckoutShopperCssUrl(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected function isSocialSecurityNumberRequired(QuoteTransfer $quoteTransfer):
{
return in_array(
$quoteTransfer->getBillingAddressOrFail()->getIso2Code(),
$this->config->getSocialSecurityNumberCountriesMandatory()
$this->config->getSocialSecurityNumberCountriesMandatory(),
);
}
}
4 changes: 2 additions & 2 deletions src/SprykerEco/Yves/Adyen/Form/DirectDebitSubForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ protected function addOwnerName(FormBuilderInterface $builder): SubFormInterface
'constraints' => [
$this->createNotBlankConstraint([static::GLOSSARY_KEY_CONSTRAINT_MESSAGE_INVALID_OWNER_NAME]),
],
]
],
);

return $this;
Expand All @@ -139,7 +139,7 @@ protected function addIbanNumber(FormBuilderInterface $builder): SubFormInterfac
'constraints' => [
$this->createNotBlankConstraint([static::GLOSSARY_KEY_CONSTRAINT_MESSAGE_INVALID_IBAN_NUMBER]),
],
]
],
);

return $this;
Expand Down
2 changes: 1 addition & 1 deletion src/SprykerEco/Yves/Adyen/Form/IdealSubForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ protected function addIdealIssuerField(FormBuilderInterface $builder, array $cho
'placeholder' => false,
'choices' => array_flip($choices),
'constraints' => [],
]
],
);

return $this;
Expand Down
2 changes: 1 addition & 1 deletion src/SprykerEco/Yves/Adyen/Form/KlarnaInvoiceSubForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected function addSocialSecurityNumber(FormBuilderInterface $builder): SubFo
'label' => static::SOCIAL_SECURITY_NUMBER_LABEL,
'required' => true,
'constraints' => [],
]
],
);

return $this;
Expand Down
4 changes: 2 additions & 2 deletions src/SprykerEco/Yves/Adyen/Handler/AdyenPaymentHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ class AdyenPaymentHandler implements AdyenPaymentHandlerInterface
protected $service;

/**
* @var array|\SprykerEco\Yves\Adyen\Plugin\Payment\AdyenPaymentMapperPluginInterface[]
* @var array<\SprykerEco\Yves\Adyen\Plugin\Payment\AdyenPaymentMapperPluginInterface>
*/
protected $paymentPlugins;

/**
* @param \SprykerEco\Service\Adyen\AdyenServiceInterface $service
* @param \SprykerEco\Yves\Adyen\Plugin\Payment\AdyenPaymentMapperPluginInterface[] $paymentPlugins
* @param array<\SprykerEco\Yves\Adyen\Plugin\Payment\AdyenPaymentMapperPluginInterface> $paymentPlugins
*/
public function __construct(
AdyenServiceInterface $service,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function mapRequestToNotificationsTransfer(Request $request): AdyenNotifi
}

/**
* @param string[] $response
* @param array<string> $response
*
* @return \Generated\Shared\Transfer\AdyenNotificationsTransfer
*/
Expand All @@ -71,7 +71,7 @@ protected function createNotificationsTransfer(array $response): AdyenNotificati
/**
* @param array $response
*
* @return \Generated\Shared\Transfer\AdyenNotificationRequestItemTransfer[]
* @return array<\Generated\Shared\Transfer\AdyenNotificationRequestItemTransfer>
*/
protected function getNotificationItemTransfers(array $response): array
{
Expand All @@ -81,7 +81,7 @@ function ($notification) {

return (new AdyenNotificationRequestItemTransfer())->fromArray($item, true);
},
$response[static::NOTIFICATIONS_KEY]
$response[static::NOTIFICATIONS_KEY],
);

return $notificationItems;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,55 +42,55 @@ protected function defineControllers(Application $app)
'adyen-notification',
static::BUNDLE_NAME,
static::NOTIFICATION_CONTROLLER_NAME,
'index'
'index',
);

$this->createController(
'/adyen/callback/redirect-sofort',
'adyen-redirect-sofort',
static::BUNDLE_NAME,
static::CALLBACK_CONTROLLER_NAME,
'redirectSofort'
'redirectSofort',
);

$this->createController(
'/adyen/callback/redirect-credit-card-3d',
'adyen-redirect-credit-card-3d',
static::BUNDLE_NAME,
static::CALLBACK_CONTROLLER_NAME,
'redirectCreditCard3d'
'redirectCreditCard3d',
);

$this->createController(
'/adyen/callback/redirect-ideal',
'adyen-redirect-ideal',
static::BUNDLE_NAME,
static::CALLBACK_CONTROLLER_NAME,
'redirectIdeal'
'redirectIdeal',
);

$this->createController(
'/adyen/callback/redirect-paypal',
'adyen-redirect-paypal',
static::BUNDLE_NAME,
static::CALLBACK_CONTROLLER_NAME,
'redirectPayPal'
'redirectPayPal',
);

$this->createController(
'/adyen/callback/redirect-alipay',
'adyen-redirect-alipay',
static::BUNDLE_NAME,
static::CALLBACK_CONTROLLER_NAME,
'redirectAliPay'
'redirectAliPay',
);

$this->createController(
'/adyen/callback/redirect-wechatpay',
'adyen-redirect-wechatpay',
static::BUNDLE_NAME,
static::CALLBACK_CONTROLLER_NAME,
'redirectWeChatPay'
'redirectWeChatPay',
);
}
}
Loading