diff --git a/README.md b/README.md index 37c7cee..fdf2033 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ We have a 70-person team of experts: business analysts and consultants, eCommerc # Installation -The installation process for the Imoje Paywall Plugin can be found [here](doc/installation.md). +The installation process for the ING Pay Paywall Plugin can be found [here](doc/installation.md). ## Requirements: @@ -73,11 +73,11 @@ We work on stable, supported and up-to-date versions of packages. We recommend y # Usage -This plugin allows you to use the payment solution delivered by Imoje. +This plugin allows you to use the payment solution delivered by ING Pay. # Configuration -The configuration process for the Imoje Paywall Plugin can be found [here](doc/configuration.md). +The configuration process for the ING Pay Paywall Plugin can be found [here](doc/configuration.md). # Functionalities diff --git a/behat.yml.dist b/behat.yml.dist index 27012e3..8ac2dfe 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -28,7 +28,7 @@ default: FriendsOfBehat\SymfonyExtension: bootstrap: tests/Application/config/bootstrap.php kernel: - class: Tests\BitBag\SyliusImojePlugin\Application\Kernel + class: Tests\BitBag\SyliusIngPayPlugin\Application\Kernel FriendsOfBehat\VariadicExtension: ~ diff --git a/composer.json b/composer.json index 603d23d..5da14d8 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { - "name": "bitbag/imoje-paywall-plugin", + "name": "bitbag/ing-pay-paywall-plugin", "type": "sylius-plugin", - "description": "Imoje plugin for Sylius.", + "description": "ING Pay plugin for Sylius.", "keywords": [ "sylius", "sylius-plugin" @@ -57,12 +57,12 @@ }, "autoload": { "psr-4": { - "BitBag\\SyliusImojePlugin\\": "src/" + "BitBag\\SyliusIngPayPlugin\\": "src/" } }, "autoload-dev": { "psr-4": { - "Tests\\BitBag\\SyliusImojePlugin\\": [ + "Tests\\BitBag\\SyliusIngPayPlugin\\": [ "tests/", "tests/Application/src" ] diff --git a/config/packages/nyholm_psr7.yaml b/config/packages/nyholm_psr7.yaml new file mode 100644 index 0000000..ade8312 --- /dev/null +++ b/config/packages/nyholm_psr7.yaml @@ -0,0 +1,11 @@ +services: + # Register nyholm/psr7 services for autowiring with PSR-17 (HTTP factories) + Psr\Http\Message\RequestFactoryInterface: '@nyholm.psr7.psr17_factory' + Psr\Http\Message\ResponseFactoryInterface: '@nyholm.psr7.psr17_factory' + Psr\Http\Message\ServerRequestFactoryInterface: '@nyholm.psr7.psr17_factory' + Psr\Http\Message\StreamFactoryInterface: '@nyholm.psr7.psr17_factory' + Psr\Http\Message\UploadedFileFactoryInterface: '@nyholm.psr7.psr17_factory' + Psr\Http\Message\UriFactoryInterface: '@nyholm.psr7.psr17_factory' + + nyholm.psr7.psr17_factory: + class: Nyholm\Psr7\Factory\Psr17Factory diff --git a/config/packages/property_info.yaml b/config/packages/property_info.yaml new file mode 100644 index 0000000..dd31b9d --- /dev/null +++ b/config/packages/property_info.yaml @@ -0,0 +1,3 @@ +framework: + property_info: + with_constructor_extractor: true diff --git a/config/packages/workflow.yaml b/config/packages/workflow.yaml new file mode 100644 index 0000000..855df59 --- /dev/null +++ b/config/packages/workflow.yaml @@ -0,0 +1,2 @@ +framework: + workflows: null diff --git a/config/routes.yaml b/config/routes.yaml index d6227f2..ec0dfed 100644 --- a/config/routes.yaml +++ b/config/routes.yaml @@ -1,5 +1,5 @@ -bitbag_sylius_imoje_payment_notify: - path: /payment/imoje/notify +bitbag_sylius_ing_pay_payment_notify: + path: /payment/ing_pay/notify methods: [POST] defaults: - _controller: bitbag.sylius_imoje_plugin.controller.notify_controller::verifyImojeNotification + _controller: bitbag.sylius_ing_pay_plugin.controller.notify_controller::verifyIngPayNotification diff --git a/config/services/command_handlers.yaml b/config/services/command_handlers.yaml index 98c5d92..672bed5 100644 --- a/config/services/command_handlers.yaml +++ b/config/services/command_handlers.yaml @@ -1,32 +1,32 @@ services: - bitbag.sylius.command_handlers.imoje_paywall.capture: - class: BitBag\SyliusImojePlugin\CommandHandler\CapturePaymentRequestHandler + bitbag.sylius.command_handlers.ing_pay_paywall.capture: + class: BitBag\SyliusIngPayPlugin\CommandHandler\CapturePaymentRequestHandler arguments: - '@sylius.provider.payment_request' - '@sylius_abstraction.state_machine' - - '@bitbag.imoje_plugin.resolver.signature_resolver' + - '@bitbag.ing_pay_plugin.resolver.signature_resolver' - '@sylius_shop.provider.order_pay.payment_request_pay_url' tags: - name: messenger.message_handler bus: sylius.payment_request.command_bus - bitbag.sylius.command_handlers.imoje_paywall.capture_end: - class: BitBag\SyliusImojePlugin\CommandHandler\CaptureEndPaymentRequestHandler + bitbag.sylius.command_handlers.ing_pay_paywall.capture_end: + class: BitBag\SyliusIngPayPlugin\CommandHandler\CaptureEndPaymentRequestHandler arguments: - '@sylius.provider.payment_request' - '@sylius_abstraction.state_machine' - - '@bitbag.sylius_imoje_plugin.processor.payment_transition' + - '@bitbag.sylius_ing_pay_plugin.processor.payment_transition' tags: - name: messenger.message_handler bus: sylius.payment_request.command_bus - bitbag.sylius.command_handlers.imoje_paywall.status: - class: BitBag\SyliusImojePlugin\CommandHandler\StatusPaymentRequestHandler + bitbag.sylius.command_handlers.ing_pay_paywall.status: + class: BitBag\SyliusIngPayPlugin\CommandHandler\StatusPaymentRequestHandler arguments: - '@sylius.provider.payment_request' - '@sylius_abstraction.state_machine' - - '@bitbag.sylius_imoje_plugin.processor.payment_transition' + - '@bitbag.sylius_ing_pay_plugin.processor.payment_transition' tags: - name: messenger.message_handler bus: sylius.payment_request.command_bus - handles: BitBag\SyliusImojePlugin\Command\StatusPaymentRequest + handles: BitBag\SyliusIngPayPlugin\Command\StatusPaymentRequest diff --git a/config/services/command_providers.yaml b/config/services/command_providers.yaml index abc198f..157df54 100644 --- a/config/services/command_providers.yaml +++ b/config/services/command_providers.yaml @@ -1,22 +1,22 @@ services: - bitbag.sylius.command_provider.imoje_paywall: + bitbag.sylius.command_provider.ing_pay_paywall: class: Sylius\Bundle\PaymentBundle\CommandProvider\ActionsCommandProvider arguments: - !tagged_locator - tag: bitbag.sylius.command_provider.imoje_paywall + tag: bitbag.sylius.command_provider.ing_pay_paywall index_by: 'action' tags: - name: sylius.payment_request.command_provider - gateway_factory: 'imoje_paywall' + gateway_factory: 'ing_pay_paywall' - bitbag.sylius.command_provider.imoje_paywall.capture: - class: BitBag\SyliusImojePlugin\CommandProvider\CapturePaymentRequestCommandProvider + bitbag.sylius.command_provider.ing_pay_paywall.capture: + class: BitBag\SyliusIngPayPlugin\CommandProvider\CapturePaymentRequestCommandProvider tags: - - name: bitbag.sylius.command_provider.imoje_paywall + - name: bitbag.sylius.command_provider.ing_pay_paywall action: !php/const Sylius\Component\Payment\Model\PaymentRequestInterface::ACTION_CAPTURE - bitbag.sylius.command_provider.imoje_paywall.status: - class: BitBag\SyliusImojePlugin\CommandProvider\StatusPaymentRequestCommandProvider + bitbag.sylius.command_provider.ing_pay_paywall.status: + class: BitBag\SyliusIngPayPlugin\CommandProvider\StatusPaymentRequestCommandProvider tags: - - name: bitbag.sylius.command_provider.imoje_paywall + - name: bitbag.sylius.command_provider.ing_pay_paywall action: !php/const Sylius\Component\Payment\Model\PaymentRequestInterface::ACTION_STATUS diff --git a/config/services/controller.yaml b/config/services/controller.yaml index 784d538..6686761 100644 --- a/config/services/controller.yaml +++ b/config/services/controller.yaml @@ -2,10 +2,10 @@ services: _defaults: public: true - bitbag.sylius_imoje_plugin.controller.notify_controller: - class: BitBag\SyliusImojePlugin\Controller\NotifyController + bitbag.sylius_ing_pay_plugin.controller.notify_controller: + class: BitBag\SyliusIngPayPlugin\Controller\NotifyController arguments: - '@sylius.repository.order' - '@sylius.repository.payment' - '@doctrine.orm.entity_manager' - - '@bitbag.imoje_plugin.resolver.signature_resolver' + - '@bitbag.ing_pay_plugin.resolver.signature_resolver' diff --git a/config/services/form.yaml b/config/services/form.yaml index 1d77e25..510e2ad 100644 --- a/config/services/form.yaml +++ b/config/services/form.yaml @@ -1,8 +1,8 @@ services: - bitbag.imoje_plugin.form.type.gateway_configuration.imoje_paywall: - class: BitBag\SyliusImojePlugin\Form\Type\ImojeGatewayConfigurationType + bitbag.ing_pay_plugin.form.type.gateway_configuration.ing_pay_paywall: + class: BitBag\SyliusIngPayPlugin\Form\Type\IngPayGatewayConfigurationType tags: - name: sylius.gateway_configuration_type - type: imoje_paywall - label: 'bitbag.imoje_plugin.paywall' + type: ing_pay_paywall + label: 'bitbag.ing_pay_plugin.paywall' - name: form.type diff --git a/config/services/http_response_provider.yaml b/config/services/http_response_provider.yaml index 60de9cf..924b0e7 100644 --- a/config/services/http_response_provider.yaml +++ b/config/services/http_response_provider.yaml @@ -1,16 +1,16 @@ services: - bitbag.sylius.provider.order_pay.http_response.imoje_paywall: + bitbag.sylius.provider.order_pay.http_response.ing_pay_paywall: class: Sylius\Bundle\PaymentBundle\Provider\ActionsHttpResponseProvider arguments: - !tagged_locator - tag: bitbag.sylius.provider.order_pay.http_response.imoje_paywall + tag: bitbag.sylius.provider.order_pay.http_response.ing_pay_paywall index_by: action tags: - name: sylius.payment_request.provider.http_response - gateway_factory: 'imoje_paywall' + gateway_factory: 'ing_pay_paywall' - bitbag.sylius.provider.order_pay.http_response.imoje_paywall.capture: - class: BitBag\SyliusImojePlugin\OrderPay\Provider\CaptureHttpResponseProvider + bitbag.sylius.provider.order_pay.http_response.ing_pay_paywall.capture: + class: BitBag\SyliusIngPayPlugin\OrderPay\Provider\CaptureHttpResponseProvider tags: - - name: bitbag.sylius.provider.order_pay.http_response.imoje_paywall + - name: bitbag.sylius.provider.order_pay.http_response.ing_pay_paywall action: !php/const Sylius\Component\Payment\Model\PaymentRequestInterface::ACTION_CAPTURE diff --git a/config/services/processor.yaml b/config/services/processor.yaml index 05e2412..c150da5 100644 --- a/config/services/processor.yaml +++ b/config/services/processor.yaml @@ -1,5 +1,5 @@ services: - bitbag.sylius_imoje_plugin.processor.payment_transition: - class: BitBag\SyliusImojePlugin\Processor\PaymentTransitionProcessor + bitbag.sylius_ing_pay_plugin.processor.payment_transition: + class: BitBag\SyliusIngPayPlugin\Processor\PaymentTransitionProcessor arguments: - '@sylius_abstraction.state_machine' diff --git a/config/services/resolver.yaml b/config/services/resolver.yaml index 3a9f043..860b3ce 100644 --- a/config/services/resolver.yaml +++ b/config/services/resolver.yaml @@ -1,3 +1,3 @@ services: - bitbag.imoje_plugin.resolver.signature_resolver: - class: BitBag\SyliusImojePlugin\Resolver\SignatureResolver + bitbag.ing_pay_plugin.resolver.signature_resolver: + class: BitBag\SyliusIngPayPlugin\Resolver\SignatureResolver diff --git a/config/twig_hooks/payment_method/admin/create.yaml b/config/twig_hooks/payment_method/admin/create.yaml index 755ed64..f626a06 100644 --- a/config/twig_hooks/payment_method/admin/create.yaml +++ b/config/twig_hooks/payment_method/admin/create.yaml @@ -1,18 +1,18 @@ sylius_twig_hooks: hooks: - 'sylius_admin.payment_method.create.content.form.sections.gateway_configuration.imoje_paywall': + 'sylius_admin.payment_method.create.content.form.sections.gateway_configuration.ing_pay_paywall': environment: - template: '@BitBagSyliusImojePlugin/admin/payment_method/form/environment.html.twig' + template: '@BitBagSyliusIngPayPlugin/admin/payment_method/form/environment.html.twig' priority: 400 merchant_id: - template: '@BitBagSyliusImojePlugin/admin/payment_method/form/merchant_id.html.twig' + template: '@BitBagSyliusIngPayPlugin/admin/payment_method/form/merchant_id.html.twig' priority: 300 service_id: - template: '@BitBagSyliusImojePlugin/admin/payment_method/form/service_id.html.twig' + template: '@BitBagSyliusIngPayPlugin/admin/payment_method/form/service_id.html.twig' priority: 200 service_key: - template: '@BitBagSyliusImojePlugin/admin/payment_method/form/service_key.html.twig' + template: '@BitBagSyliusIngPayPlugin/admin/payment_method/form/service_key.html.twig' priority: 100 authorization_token: - template: '@BitBagSyliusImojePlugin/admin/payment_method/form/authorization_token.html.twig' + template: '@BitBagSyliusIngPayPlugin/admin/payment_method/form/authorization_token.html.twig' priority: 0 diff --git a/config/twig_hooks/payment_method/admin/update.yaml b/config/twig_hooks/payment_method/admin/update.yaml index db9cbd6..2dca04e 100644 --- a/config/twig_hooks/payment_method/admin/update.yaml +++ b/config/twig_hooks/payment_method/admin/update.yaml @@ -1,18 +1,18 @@ sylius_twig_hooks: hooks: - 'sylius_admin.payment_method.update.content.form.sections.gateway_configuration.imoje_paywall': + 'sylius_admin.payment_method.update.content.form.sections.gateway_configuration.ing_pay_paywall': environment: - template: '@BitBagSyliusImojePlugin/admin/payment_method/form/environment.html.twig' + template: '@BitBagSyliusIngPayPlugin/admin/payment_method/form/environment.html.twig' priority: 400 merchant_id: - template: '@BitBagSyliusImojePlugin/admin/payment_method/form/merchant_id.html.twig' + template: '@BitBagSyliusIngPayPlugin/admin/payment_method/form/merchant_id.html.twig' priority: 300 service_id: - template: '@BitBagSyliusImojePlugin/admin/payment_method/form/service_id.html.twig' + template: '@BitBagSyliusIngPayPlugin/admin/payment_method/form/service_id.html.twig' priority: 200 service_key: - template: '@BitBagSyliusImojePlugin/admin/payment_method/form/service_key.html.twig' + template: '@BitBagSyliusIngPayPlugin/admin/payment_method/form/service_key.html.twig' priority: 100 authorization_token: - template: '@BitBagSyliusImojePlugin/admin/payment_method/form/authorization_token.html.twig' + template: '@BitBagSyliusIngPayPlugin/admin/payment_method/form/authorization_token.html.twig' priority: 0 diff --git a/doc/configuration.md b/doc/configuration.md index d1c556c..f780269 100644 --- a/doc/configuration.md +++ b/doc/configuration.md @@ -6,14 +6,14 @@ To create an ING-based payment method, go to Payment methods in the Sylius admin panel. After that, you need to add an ING payment: -![Screenshot showing payment method config in admin](./create_imoje_payment_method.png) +![Screenshot showing payment method config in admin](./create_ing_pay_payment_method.png) And now, you can configure your payment method in the admin panel: ![Screenshot showing payment method config in admin](./payment_method_config.png) ## ING admin panel: -To configure the imoje gateway, log in to ING the admin panel. +To configure the ING Pay gateway, log in to ING the admin panel. - [Sandbox ING admin panel](https://sandbox.imoje.ing.pl) - [Production ING admin panel](https://imoje.ing.pl) @@ -25,12 +25,12 @@ From `Shops` -> `Your shop` -> `Details` -> `Integration data` you can acquire n - Service key, Also, here in the integration data page you need to configure the path to your webhook, -just type in your shop URL followed by: `/payment/imoje/notify` +just type in your shop URL followed by: `/payment/ing_pay/notify` In sandbox mode, you can use Ngrok or another tunneling program to expose your localhost. -![Screenshot showing integration data in ING admin panel](./imoje_integration_data.png) +![Screenshot showing integration data in ING admin panel](./ing_pay_integration_data.png) The authorization token can be obtained from `Your profile` → `API keys` → `Details` -![Screenshot showing Authorization key in ING admin panel](./imoje_api_key.png) +![Screenshot showing Authorization key in ING admin panel](./ing_pay_api_key.png) diff --git a/doc/create_imoje_payment_method.png b/doc/create_ing_pay_payment_method.png similarity index 100% rename from doc/create_imoje_payment_method.png rename to doc/create_ing_pay_payment_method.png diff --git a/doc/functionalities.md b/doc/functionalities.md index 3795a02..655943e 100644 --- a/doc/functionalities.md +++ b/doc/functionalities.md @@ -2,16 +2,16 @@ --- -The plugin integrates iMoje payments with Sylius based applications. +The plugin integrates ING Pay payments with Sylius based applications. ->iMoje is an online payment platform created by ING Bank Śląski, which enables online shops and service providers to accept payments from customers in Poland. +>ING Pay is an online payment platform created by ING Bank Śląski, which enables online shops and service providers to accept payments from customers in Poland. It is a comprehensive payment gateway service, offering various payment methods such as payment cards, fast online transfers (so-called pay-by-links), BLIK, mobile payments and deferred payments. ->In contrast to iMojePlugin, payment and selection of the payment type is carried out after redirection to a dedicated payment gateway. +>In contrast to the ING Pay Plugin, payment and selection of the payment type is carried out after redirection to a dedicated payment gateway. -- After an installation, user should be able to create new `Imoje gateway` payment method in the `Payment methods` section in the admin panel. +- After an installation, user should be able to create new `ING Pay gateway` payment method in the `Payment methods` section in the admin panel. -![Screenshot showing payment method config in admin](./create_imoje_payment_method.png) +![Screenshot showing payment method config in admin](./create_ing_pay_payment_method.png) - And now, you can configure your payment method in the admin panel: diff --git a/doc/imoje_api_key.png b/doc/ing_pay_api_key.png similarity index 100% rename from doc/imoje_api_key.png rename to doc/ing_pay_api_key.png diff --git a/doc/imoje_integration_data.png b/doc/ing_pay_integration_data.png similarity index 100% rename from doc/imoje_integration_data.png rename to doc/ing_pay_integration_data.png diff --git a/doc/installation.md b/doc/installation.md index f704b1e..ed6229a 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -12,7 +12,7 @@ ADDITIONAL ## Composer: ```bash -composer require bitbag/imoje-paywall-plugin --with-all-dependencies +composer require bitbag/ing-pay-paywall-plugin --with-all-dependencies ``` ## Basic configuration: @@ -23,21 +23,21 @@ Add plugin dependencies to your `config/bundles.php` file: return [ ... - BitBag\SyliusImojePlugin\BitBagSyliusImojePlugin::class => ['all' => true], + BitBag\SyliusIngPayPlugin\BitBagSyliusIngPayPlugin::class => ['all' => true], ]; ``` Add routing to your `config/routes.yaml` file: ```yaml -bitbag_sylius_imoje_plugin: - resource: "@BitBagSyliusImojePlugin/config/routes.yaml" +bitbag_sylius_ing_pay_plugin: + resource: "@BitBagSyliusIngPayPlugin/config/routes.yaml" ``` Import plugin configuration in `config/packages/_sylius.yaml` file: ```yaml imports: # ... - - { resource: "@BitBagSyliusImojePlugin/config/config.yaml" } + - { resource: "@BitBagSyliusIngPayPlugin/config/config.yaml" } ``` ## Known issues diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2854038..130095f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -5,7 +5,7 @@ colors="true" bootstrap="tests/Application/config/bootstrap.php"> - + tests diff --git a/src/BitBagSyliusImojePlugin.php b/src/BitBagSyliusIngPayPlugin.php similarity index 84% rename from src/BitBagSyliusImojePlugin.php rename to src/BitBagSyliusIngPayPlugin.php index f96ac2b..7ef2a7f 100644 --- a/src/BitBagSyliusImojePlugin.php +++ b/src/BitBagSyliusIngPayPlugin.php @@ -9,12 +9,12 @@ declare(strict_types=1); -namespace BitBag\SyliusImojePlugin; +namespace BitBag\SyliusIngPayPlugin; use Sylius\Bundle\CoreBundle\Application\SyliusPluginTrait; use Symfony\Component\HttpKernel\Bundle\Bundle; -final class BitBagSyliusImojePlugin extends Bundle +final class BitBagSyliusIngPayPlugin extends Bundle { use SyliusPluginTrait; diff --git a/src/Command/CaptureEndPaymentRequest.php b/src/Command/CaptureEndPaymentRequest.php index 19c81a3..527290f 100644 --- a/src/Command/CaptureEndPaymentRequest.php +++ b/src/Command/CaptureEndPaymentRequest.php @@ -9,7 +9,7 @@ declare(strict_types=1); -namespace BitBag\SyliusImojePlugin\Command; +namespace BitBag\SyliusIngPayPlugin\Command; use Sylius\Bundle\PaymentBundle\Command\PaymentRequestHashAwareInterface; use Sylius\Bundle\PaymentBundle\Command\PaymentRequestHashAwareTrait; diff --git a/src/Command/CapturePaymentRequest.php b/src/Command/CapturePaymentRequest.php index ebde54a..11c14bc 100644 --- a/src/Command/CapturePaymentRequest.php +++ b/src/Command/CapturePaymentRequest.php @@ -9,7 +9,7 @@ declare(strict_types=1); -namespace BitBag\SyliusImojePlugin\Command; +namespace BitBag\SyliusIngPayPlugin\Command; use Sylius\Bundle\PaymentBundle\Command\PaymentRequestHashAwareInterface; use Sylius\Bundle\PaymentBundle\Command\PaymentRequestHashAwareTrait; diff --git a/src/Command/StatusPaymentRequest.php b/src/Command/StatusPaymentRequest.php index fad2e8a..acbab22 100644 --- a/src/Command/StatusPaymentRequest.php +++ b/src/Command/StatusPaymentRequest.php @@ -9,7 +9,7 @@ declare(strict_types=1); -namespace BitBag\SyliusImojePlugin\Command; +namespace BitBag\SyliusIngPayPlugin\Command; use Sylius\Bundle\PaymentBundle\Command\PaymentRequestHashAwareInterface; use Sylius\Bundle\PaymentBundle\Command\PaymentRequestHashAwareTrait; diff --git a/src/CommandHandler/CaptureEndPaymentRequestHandler.php b/src/CommandHandler/CaptureEndPaymentRequestHandler.php index 5bcef78..1ec2f13 100644 --- a/src/CommandHandler/CaptureEndPaymentRequestHandler.php +++ b/src/CommandHandler/CaptureEndPaymentRequestHandler.php @@ -9,10 +9,10 @@ declare(strict_types=1); -namespace BitBag\SyliusImojePlugin\CommandHandler; +namespace BitBag\SyliusIngPayPlugin\CommandHandler; -use BitBag\SyliusImojePlugin\Command\CaptureEndPaymentRequest; -use BitBag\SyliusImojePlugin\Processor\PaymentTransitionProcessorInterface; +use BitBag\SyliusIngPayPlugin\Command\CaptureEndPaymentRequest; +use BitBag\SyliusIngPayPlugin\Processor\PaymentTransitionProcessorInterface; use Sylius\Abstraction\StateMachine\StateMachineInterface; use Sylius\Bundle\PaymentBundle\Provider\PaymentRequestProviderInterface; use Sylius\Component\Payment\Model\PaymentRequestInterface; diff --git a/src/CommandHandler/CapturePaymentRequestHandler.php b/src/CommandHandler/CapturePaymentRequestHandler.php index f2b6b36..1bc38cc 100644 --- a/src/CommandHandler/CapturePaymentRequestHandler.php +++ b/src/CommandHandler/CapturePaymentRequestHandler.php @@ -9,11 +9,11 @@ declare(strict_types=1); -namespace BitBag\SyliusImojePlugin\CommandHandler; +namespace BitBag\SyliusIngPayPlugin\CommandHandler; -use BitBag\SyliusImojePlugin\Command\CapturePaymentRequest; -use BitBag\SyliusImojePlugin\Enum\ImojeEnvironment; -use BitBag\SyliusImojePlugin\Resolver\SignatureResolverInterface; +use BitBag\SyliusIngPayPlugin\Command\CapturePaymentRequest; +use BitBag\SyliusIngPayPlugin\Enum\IngPayEnvironment; +use BitBag\SyliusIngPayPlugin\Resolver\SignatureResolverInterface; use Sylius\Abstraction\StateMachine\StateMachineInterface; use Sylius\Bundle\CoreBundle\OrderPay\Provider\UrlProviderInterface; use Sylius\Bundle\PaymentBundle\Provider\PaymentRequestProviderInterface; @@ -99,6 +99,6 @@ private function prepareOrderData( private function getPaymentUrl(string $environment): string { - return $environment === ImojeEnvironment::PRODUCTION_ENVIRONMENT->value ? ImojeEnvironment::PRODUCTION_URL->value : ImojeEnvironment::SANDBOX_URL->value; + return $environment === IngPayEnvironment::PRODUCTION_ENVIRONMENT->value ? IngPayEnvironment::PRODUCTION_URL->value : IngPayEnvironment::SANDBOX_URL->value; } } diff --git a/src/CommandHandler/StatusPaymentRequestHandler.php b/src/CommandHandler/StatusPaymentRequestHandler.php index 70406d9..1342453 100644 --- a/src/CommandHandler/StatusPaymentRequestHandler.php +++ b/src/CommandHandler/StatusPaymentRequestHandler.php @@ -9,10 +9,10 @@ declare(strict_types=1); -namespace BitBag\SyliusImojePlugin\CommandHandler; +namespace BitBag\SyliusIngPayPlugin\CommandHandler; -use BitBag\SyliusImojePlugin\Command\StatusPaymentRequest; -use BitBag\SyliusImojePlugin\Processor\PaymentTransitionProcessorInterface; +use BitBag\SyliusIngPayPlugin\Command\StatusPaymentRequest; +use BitBag\SyliusIngPayPlugin\Processor\PaymentTransitionProcessorInterface; use Sylius\Abstraction\StateMachine\StateMachineInterface; use Sylius\Bundle\PaymentBundle\Provider\PaymentRequestProviderInterface; use Sylius\Component\Payment\PaymentRequestTransitions; diff --git a/src/CommandProvider/CapturePaymentRequestCommandProvider.php b/src/CommandProvider/CapturePaymentRequestCommandProvider.php index fedd684..0a89a0f 100644 --- a/src/CommandProvider/CapturePaymentRequestCommandProvider.php +++ b/src/CommandProvider/CapturePaymentRequestCommandProvider.php @@ -9,10 +9,10 @@ declare(strict_types=1); -namespace BitBag\SyliusImojePlugin\CommandProvider; +namespace BitBag\SyliusIngPayPlugin\CommandProvider; -use BitBag\SyliusImojePlugin\Command\CaptureEndPaymentRequest; -use BitBag\SyliusImojePlugin\Command\CapturePaymentRequest; +use BitBag\SyliusIngPayPlugin\Command\CaptureEndPaymentRequest; +use BitBag\SyliusIngPayPlugin\Command\CapturePaymentRequest; use Sylius\Bundle\PaymentBundle\CommandProvider\PaymentRequestCommandProviderInterface; use Sylius\Component\Payment\Model\PaymentRequestInterface; diff --git a/src/CommandProvider/StatusPaymentRequestCommandProvider.php b/src/CommandProvider/StatusPaymentRequestCommandProvider.php index f1547e8..3c68524 100644 --- a/src/CommandProvider/StatusPaymentRequestCommandProvider.php +++ b/src/CommandProvider/StatusPaymentRequestCommandProvider.php @@ -9,9 +9,9 @@ declare(strict_types=1); -namespace BitBag\SyliusImojePlugin\CommandProvider; +namespace BitBag\SyliusIngPayPlugin\CommandProvider; -use BitBag\SyliusImojePlugin\Command\StatusPaymentRequest; +use BitBag\SyliusIngPayPlugin\Command\StatusPaymentRequest; use Sylius\Bundle\PaymentBundle\CommandProvider\PaymentRequestCommandProviderInterface; use Sylius\Component\Payment\Model\PaymentRequestInterface; diff --git a/src/Controller/NotifyController.php b/src/Controller/NotifyController.php index e6e55ed..6123cc1 100644 --- a/src/Controller/NotifyController.php +++ b/src/Controller/NotifyController.php @@ -9,9 +9,9 @@ declare(strict_types=1); -namespace BitBag\SyliusImojePlugin\Controller; +namespace BitBag\SyliusIngPayPlugin\Controller; -use BitBag\SyliusImojePlugin\Resolver\SignatureResolverInterface; +use BitBag\SyliusIngPayPlugin\Resolver\SignatureResolverInterface; use Doctrine\ORM\EntityManagerInterface; use Sylius\Component\Core\Model\PaymentInterface; use Sylius\Component\Core\Repository\OrderRepositoryInterface; @@ -31,7 +31,7 @@ public function __construct( ) { } - public function verifyImojeNotification(Request $request): Response + public function verifyIngPayNotification(Request $request): Response { $content = $request->getContent(); if ('' === $content) { @@ -81,13 +81,13 @@ public function verifyImojeNotification(Request $request): Response return new Response('Signature verification failed', Response::HTTP_FORBIDDEN); } - $imojePaymentStatus = (string) $data['payment']['status']; - $payment->setDetails(['status' => $imojePaymentStatus]); + $ingPayPaymentStatus = (string) $data['payment']['status']; + $payment->setDetails(['status' => $ingPayPaymentStatus]); $this->entityManager->persist($payment); $this->entityManager->flush(); return new JsonResponse([ - 'status' => $imojePaymentStatus, + 'status' => $ingPayPaymentStatus, ]); } } diff --git a/src/DependencyInjection/BitBagSyliusImojeExtension.php b/src/DependencyInjection/BitBagSyliusIngPayExtension.php similarity index 86% rename from src/DependencyInjection/BitBagSyliusImojeExtension.php rename to src/DependencyInjection/BitBagSyliusIngPayExtension.php index 934c419..beaaedb 100644 --- a/src/DependencyInjection/BitBagSyliusImojeExtension.php +++ b/src/DependencyInjection/BitBagSyliusIngPayExtension.php @@ -9,7 +9,7 @@ declare(strict_types=1); -namespace BitBag\SyliusImojePlugin\DependencyInjection; +namespace BitBag\SyliusIngPayPlugin\DependencyInjection; use Sylius\Bundle\CoreBundle\DependencyInjection\PrependDoctrineMigrationsTrait; use Sylius\Bundle\ResourceBundle\DependencyInjection\Extension\AbstractResourceExtension; @@ -18,7 +18,7 @@ use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; -final class BitBagSyliusImojeExtension extends AbstractResourceExtension implements PrependExtensionInterface +final class BitBagSyliusIngPayExtension extends AbstractResourceExtension implements PrependExtensionInterface { use PrependDoctrineMigrationsTrait; @@ -42,7 +42,7 @@ protected function getMigrationsNamespace(): string protected function getMigrationsDirectory(): string { - return '@BitBagSyliusImojePlugin/migrations'; + return '@BitBagSyliusIngPayPlugin/migrations'; } protected function getNamespacesOfMigrationsExecutedBefore(): array diff --git a/src/Enum/ImojeEnvironment.php b/src/Enum/IngPayEnvironment.php similarity index 88% rename from src/Enum/ImojeEnvironment.php rename to src/Enum/IngPayEnvironment.php index 02f9213..c4e52ca 100644 --- a/src/Enum/ImojeEnvironment.php +++ b/src/Enum/IngPayEnvironment.php @@ -9,9 +9,9 @@ declare(strict_types=1); -namespace BitBag\SyliusImojePlugin\Enum; +namespace BitBag\SyliusIngPayPlugin\Enum; -enum ImojeEnvironment: string +enum IngPayEnvironment: string { case PRODUCTION_ENVIRONMENT = 'production'; case SANDBOX_ENVIRONMENT = 'sandbox'; diff --git a/src/Form/Type/ImojeGatewayConfigurationType.php b/src/Form/Type/IngPayGatewayConfigurationType.php similarity index 62% rename from src/Form/Type/ImojeGatewayConfigurationType.php rename to src/Form/Type/IngPayGatewayConfigurationType.php index f57f1f1..1d85072 100644 --- a/src/Form/Type/ImojeGatewayConfigurationType.php +++ b/src/Form/Type/IngPayGatewayConfigurationType.php @@ -9,16 +9,16 @@ declare(strict_types=1); -namespace BitBag\SyliusImojePlugin\Form\Type; +namespace BitBag\SyliusIngPayPlugin\Form\Type; -use BitBag\SyliusImojePlugin\Enum\ImojeEnvironment; +use BitBag\SyliusIngPayPlugin\Enum\IngPayEnvironment; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Validator\Constraints\NotBlank; -final class ImojeGatewayConfigurationType extends AbstractType +final class IngPayGatewayConfigurationType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options): void { @@ -28,51 +28,51 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ChoiceType::class, [ 'choices' => [ - 'bitbag.imoje_plugin.configuration.production' => ImojeEnvironment::PRODUCTION_ENVIRONMENT, - 'bitbag.imoje_plugin.configuration.sandbox' => ImojeEnvironment::SANDBOX_ENVIRONMENT, + 'bitbag.ing_pay_plugin.configuration.production' => IngPayEnvironment::PRODUCTION_ENVIRONMENT, + 'bitbag.ing_pay_plugin.configuration.sandbox' => IngPayEnvironment::SANDBOX_ENVIRONMENT, ], - 'label' => 'bitbag.imoje_plugin.configuration.environment', + 'label' => 'bitbag.ing_pay_plugin.configuration.environment', ], ) ->add('merchant_id', TextType::class, [ - 'label' => 'bitbag.imoje_plugin.configuration.merchant_id', + 'label' => 'bitbag.ing_pay_plugin.configuration.merchant_id', 'constraints' => [ new NotBlank( [ - 'message' => 'bitbag.imoje_plugin.configuration.merchant_id.not_blank', + 'message' => 'bitbag.ing_pay_plugin.configuration.merchant_id.not_blank', 'groups' => ['sylius'], ], ), ], ]) ->add('service_id', TextType::class, [ - 'label' => 'bitbag.imoje_plugin.configuration.service_id', + 'label' => 'bitbag.ing_pay_plugin.configuration.service_id', 'constraints' => [ new NotBlank( [ - 'message' => 'bitbag.imoje_plugin.configuration.service_id.not_blank', + 'message' => 'bitbag.ing_pay_plugin.configuration.service_id.not_blank', 'groups' => ['sylius'], ], ), ], ]) ->add('service_key', TextType::class, [ - 'label' => 'bitbag.imoje_plugin.configuration.service_key', + 'label' => 'bitbag.ing_pay_plugin.configuration.service_key', 'constraints' => [ new NotBlank( [ - 'message' => 'bitbag.imoje_plugin.configuration.service_key.not_blank', + 'message' => 'bitbag.ing_pay_plugin.configuration.service_key.not_blank', 'groups' => ['sylius'], ], ), ], ]) ->add('authorization_token', TextType::class, [ - 'label' => 'bitbag.imoje_plugin.configuration.authorization_token', + 'label' => 'bitbag.ing_pay_plugin.configuration.authorization_token', 'constraints' => [ new NotBlank( [ - 'message' => 'bitbag.imoje_plugin.configuration.authorization_token.not_blank', + 'message' => 'bitbag.ing_pay_plugin.configuration.authorization_token.not_blank', 'groups' => ['sylius'], ], ), diff --git a/src/OrderPay/Provider/CaptureHttpResponseProvider.php b/src/OrderPay/Provider/CaptureHttpResponseProvider.php index 0028962..8a532c3 100644 --- a/src/OrderPay/Provider/CaptureHttpResponseProvider.php +++ b/src/OrderPay/Provider/CaptureHttpResponseProvider.php @@ -9,7 +9,7 @@ declare(strict_types=1); -namespace BitBag\SyliusImojePlugin\OrderPay\Provider; +namespace BitBag\SyliusIngPayPlugin\OrderPay\Provider; use Sylius\Bundle\PaymentBundle\Provider\HttpResponseProviderInterface; use Sylius\Bundle\ResourceBundle\Controller\RequestConfiguration; diff --git a/src/Processor/PaymentTransitionProcessor.php b/src/Processor/PaymentTransitionProcessor.php index 796337c..43bc90c 100644 --- a/src/Processor/PaymentTransitionProcessor.php +++ b/src/Processor/PaymentTransitionProcessor.php @@ -9,7 +9,7 @@ declare(strict_types=1); -namespace BitBag\SyliusImojePlugin\Processor; +namespace BitBag\SyliusIngPayPlugin\Processor; use Sylius\Abstraction\StateMachine\StateMachineInterface; use Sylius\Component\Payment\Model\PaymentInterface; diff --git a/src/Processor/PaymentTransitionProcessorInterface.php b/src/Processor/PaymentTransitionProcessorInterface.php index 7af7b17..38406c9 100644 --- a/src/Processor/PaymentTransitionProcessorInterface.php +++ b/src/Processor/PaymentTransitionProcessorInterface.php @@ -9,7 +9,7 @@ declare(strict_types=1); -namespace BitBag\SyliusImojePlugin\Processor; +namespace BitBag\SyliusIngPayPlugin\Processor; use Sylius\Component\Payment\Model\PaymentRequestInterface; diff --git a/src/Resolver/SignatureResolver.php b/src/Resolver/SignatureResolver.php index b535532..b71e44c 100644 --- a/src/Resolver/SignatureResolver.php +++ b/src/Resolver/SignatureResolver.php @@ -9,9 +9,9 @@ declare(strict_types=1); -namespace BitBag\SyliusImojePlugin\Resolver; +namespace BitBag\SyliusIngPayPlugin\Resolver; -use BitBag\SyliusImojePlugin\Enum\ImojeEnvironment; +use BitBag\SyliusIngPayPlugin\Enum\IngPayEnvironment; use Symfony\Component\HttpFoundation\Request; use Webmozart\Assert\Assert; @@ -32,7 +32,7 @@ public function createSignature(array $fields, string $serviceKey): string $dataString = implode('&', $data); - return hash(ImojeEnvironment::HASHING_ALGORITHM->value, $dataString . $serviceKey) . ';' . ImojeEnvironment::HASHING_ALGORITHM->value; + return hash(IngPayEnvironment::HASHING_ALGORITHM->value, $dataString . $serviceKey) . ';' . IngPayEnvironment::HASHING_ALGORITHM->value; } public function verifySignature(Request $request, string $serviceKey): bool diff --git a/src/Resolver/SignatureResolverInterface.php b/src/Resolver/SignatureResolverInterface.php index 3b2249d..4da3b59 100644 --- a/src/Resolver/SignatureResolverInterface.php +++ b/src/Resolver/SignatureResolverInterface.php @@ -9,7 +9,7 @@ declare(strict_types=1); -namespace BitBag\SyliusImojePlugin\Resolver; +namespace BitBag\SyliusIngPayPlugin\Resolver; use Symfony\Component\HttpFoundation\Request; diff --git a/tests/Application/.env b/tests/Application/.env index a3e5589..a943f5a 100644 --- a/tests/Application/.env +++ b/tests/Application/.env @@ -12,7 +12,7 @@ APP_SECRET=EDITME # Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url # For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db" # Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls -DATABASE_URL=mysql://root@127.0.0.1/bitbag_sylius_imoje_plugin%kernel.environment%?serverVersion=5.7 +DATABASE_URL=mysql://root@127.0.0.1/bitbag_sylius_ing_pay_plugin%kernel.environment%?serverVersion=5.7 ###< doctrine/doctrine-bundle ### ###> lexik/jwt-authentication-bundle ### diff --git a/tests/Application/.env.test b/tests/Application/.env.test index 44fee52..4a2e645 100644 --- a/tests/Application/.env.test +++ b/tests/Application/.env.test @@ -1,6 +1,6 @@ APP_SECRET='ch4mb3r0f5ecr3ts' -KERNEL_CLASS='Tests\BitBag\SyliusImojePlugin\Application\Kernel' +KERNEL_CLASS='Tests\BitBag\SyliusIngPayPlugin\Application\Kernel' ###> symfony/messenger ### # Sync transport turned for testing env for the ease of testing diff --git a/tests/Application/Kernel.php b/tests/Application/Kernel.php index 6f2cfa2..8fb479b 100644 --- a/tests/Application/Kernel.php +++ b/tests/Application/Kernel.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Tests\BitBag\SyliusImojePlugin\Application; +namespace Tests\BitBag\SyliusIngPayPlugin\Application; use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; diff --git a/tests/Application/bin/console b/tests/Application/bin/console index fcb88a1..a940488 100755 --- a/tests/Application/bin/console +++ b/tests/Application/bin/console @@ -1,7 +1,7 @@ #!/usr/bin/env php ['all' => true], Sylius\TwigExtra\Symfony\SyliusTwigExtraBundle::class => ['all' => true], Symfony\UX\Icons\UXIconsBundle::class => ['all' => true], - BitBag\SyliusImojePlugin\BitBagSyliusImojePlugin::class => ['all' => true], + BitBag\SyliusIngPayPlugin\BitBagSyliusIngPayPlugin::class => ['all' => true], ]; diff --git a/tests/Application/config/packages/bitbag_sylius_imoje_plugin.yaml b/tests/Application/config/packages/bitbag_sylius_imoje_plugin.yaml deleted file mode 100644 index 394d4fd..0000000 --- a/tests/Application/config/packages/bitbag_sylius_imoje_plugin.yaml +++ /dev/null @@ -1,2 +0,0 @@ -imports: - - { resource: "@BitBagSyliusImojePlugin/config/config.yaml" } diff --git a/tests/Application/config/packages/bitbag_sylius_ing_pay_plugin.yaml b/tests/Application/config/packages/bitbag_sylius_ing_pay_plugin.yaml new file mode 100644 index 0000000..1540263 --- /dev/null +++ b/tests/Application/config/packages/bitbag_sylius_ing_pay_plugin.yaml @@ -0,0 +1,2 @@ +imports: + - { resource: "@BitBagSyliusIngPayPlugin/config/config.yaml" } diff --git a/tests/Application/config/routes.yaml b/tests/Application/config/routes.yaml index cb7b696..1312e6c 100644 --- a/tests/Application/config/routes.yaml +++ b/tests/Application/config/routes.yaml @@ -1,2 +1,2 @@ -bitbag_sylius_imoje_plugin: - resource: "@BitBagSyliusImojePlugin/config/routes.yaml" +bitbag_sylius_ing_pay_plugin: + resource: "@BitBagSyliusIngPayPlugin/config/routes.yaml" diff --git a/tests/Application/public/index.php b/tests/Application/public/index.php index 5591370..14bbab9 100644 --- a/tests/Application/public/index.php +++ b/tests/Application/public/index.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use Tests\BitBag\SyliusImojePlugin\Application\Kernel; +use Tests\BitBag\SyliusIngPayPlugin\Application\Kernel; use Symfony\Component\ErrorHandler\Debug; use Symfony\Component\HttpFoundation\Request; diff --git a/tests/Unit/CommandHandler/CapturePaymentRequestHandlerTest.php b/tests/Unit/CommandHandler/CapturePaymentRequestHandlerTest.php index 9b41164..937e2da 100644 --- a/tests/Unit/CommandHandler/CapturePaymentRequestHandlerTest.php +++ b/tests/Unit/CommandHandler/CapturePaymentRequestHandlerTest.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Tests\BitBag\SyliusImojePlugin\Unit\CommandHandler; +namespace Tests\BitBag\SyliusIngPayPlugin\Unit\CommandHandler; -use BitBag\SyliusImojePlugin\Command\CapturePaymentRequest; -use BitBag\SyliusImojePlugin\CommandHandler\CapturePaymentRequestHandler; -use BitBag\SyliusImojePlugin\Enum\ImojeEnvironment; -use BitBag\SyliusImojePlugin\Resolver\SignatureResolverInterface; +use BitBag\SyliusIngPayPlugin\Command\CapturePaymentRequest; +use BitBag\SyliusIngPayPlugin\CommandHandler\CapturePaymentRequestHandler; +use BitBag\SyliusIngPayPlugin\Enum\IngPayEnvironment; +use BitBag\SyliusIngPayPlugin\Resolver\SignatureResolverInterface; use PHPUnit\Framework\TestCase; use Sylius\Abstraction\StateMachine\StateMachineInterface; use Sylius\Bundle\CoreBundle\OrderPay\Provider\UrlProviderInterface; @@ -63,7 +63,7 @@ public function testItProcessesCapturePaymentRequest(): void $paymentMethod->method('getGatewayConfig')->willReturn($gatewayConfig); $gatewayConfig->method('getConfig')->willReturn([ - 'environment' => ImojeEnvironment::SANDBOX_ENVIRONMENT, + 'environment' => IngPayEnvironment::SANDBOX_ENVIRONMENT, 'service_key' => 'test_key', 'service_id' => 'test_service', 'merchant_id' => 'test_merchant', @@ -96,7 +96,7 @@ public function testItProcessesCapturePaymentRequest(): void $paymentRequest->expects(self::once()) ->method('setResponseData') ->with([ - 'url' => ImojeEnvironment::SANDBOX_URL->value, + 'url' => IngPayEnvironment::SANDBOX_URL->value, 'orderData' => [ 'serviceId' => 'test_service', 'merchantId' => 'test_merchant', diff --git a/tests/Unit/Processor/PaymentTransitionProcessorTest.php b/tests/Unit/Processor/PaymentTransitionProcessorTest.php index 9a2f5c5..0bff58f 100644 --- a/tests/Unit/Processor/PaymentTransitionProcessorTest.php +++ b/tests/Unit/Processor/PaymentTransitionProcessorTest.php @@ -9,10 +9,10 @@ declare(strict_types=1); -namespace Tests\BitBag\SyliusImojePlugin\Unit\Processor; +namespace Tests\BitBag\SyliusIngPayPlugin\Unit\Processor; -use BitBag\SyliusImojePlugin\Processor\PaymentTransitionProcessor; -use BitBag\SyliusImojePlugin\Processor\PaymentTransitionProcessorInterface; +use BitBag\SyliusIngPayPlugin\Processor\PaymentTransitionProcessor; +use BitBag\SyliusIngPayPlugin\Processor\PaymentTransitionProcessorInterface; use PHPUnit\Framework\TestCase; use Sylius\Component\Payment\Model\PaymentInterface; use Sylius\Component\Payment\Model\PaymentRequestInterface; diff --git a/tests/Unit/Resolver/SignatureResolverTest.php b/tests/Unit/Resolver/SignatureResolverTest.php index c76eef5..5563795 100644 --- a/tests/Unit/Resolver/SignatureResolverTest.php +++ b/tests/Unit/Resolver/SignatureResolverTest.php @@ -9,10 +9,10 @@ declare(strict_types=1); -namespace Tests\BitBag\SyliusImojePlugin\Unit\Resolver; +namespace Tests\BitBag\SyliusIngPayPlugin\Unit\Resolver; -use BitBag\SyliusImojePlugin\Enum\ImojeEnvironment; -use BitBag\SyliusImojePlugin\Resolver\SignatureResolver; +use BitBag\SyliusIngPayPlugin\Enum\IngPayEnvironment; +use BitBag\SyliusIngPayPlugin\Resolver\SignatureResolver; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\HeaderBag; use Symfony\Component\HttpFoundation\Request; @@ -39,7 +39,7 @@ public function testItShouldSortFieldsAndBuildDataString(): void ]; $serviceKey = 'adasvcx3412'; $expectedDataString = 'field1=value1&field2=value2'; - $expectedHash = hash(ImojeEnvironment::HASHING_ALGORITHM->value, $expectedDataString . $serviceKey) . ';' . ImojeEnvironment::HASHING_ALGORITHM->value; + $expectedHash = hash(IngPayEnvironment::HASHING_ALGORITHM->value, $expectedDataString . $serviceKey) . ';' . IngPayEnvironment::HASHING_ALGORITHM->value; $this->assertSame($expectedHash, $this->signatureResolver->createSignature($fields, $serviceKey)); } @@ -48,7 +48,7 @@ public function testItShouldReturnHashWithServiceKeyOnlyWhenFieldsAreEmpty(): vo { $fields = []; $serviceKey = 'adasvcx3412'; - $expectedHash = hash(ImojeEnvironment::HASHING_ALGORITHM->value, $serviceKey) . ';' . ImojeEnvironment::HASHING_ALGORITHM->value; + $expectedHash = hash(IngPayEnvironment::HASHING_ALGORITHM->value, $serviceKey) . ';' . IngPayEnvironment::HASHING_ALGORITHM->value; $this->assertSame($expectedHash, $this->signatureResolver->createSignature($fields, $serviceKey)); } @@ -61,7 +61,7 @@ public function testItShouldReturnHashWithoutServiceKeyWhenServiceKeyIsEmpty(): ]; $serviceKey = ''; $expectedDataString = 'field1=value1&field2=value2'; - $expectedHash = hash(ImojeEnvironment::HASHING_ALGORITHM->value, $expectedDataString) . ';' . ImojeEnvironment::HASHING_ALGORITHM->value; + $expectedHash = hash(IngPayEnvironment::HASHING_ALGORITHM->value, $expectedDataString) . ';' . IngPayEnvironment::HASHING_ALGORITHM->value; $this->assertSame($expectedHash, $this->signatureResolver->createSignature($fields, $serviceKey)); } diff --git a/translations/messages.en.yml b/translations/messages.en.yml index eed3d24..d0ed268 100644 --- a/translations/messages.en.yml +++ b/translations/messages.en.yml @@ -1,5 +1,5 @@ bitbag: - imoje_plugin: + ing_pay_plugin: configuration: production: Production sandbox: Sandbox @@ -8,4 +8,4 @@ bitbag: service_key: Service key authorization_token: Authorization token environment: Envrionment - paywall: Imoje (Paywall) + paywall: ING Pay (Paywall) diff --git a/translations/validators.en.yaml b/translations/validators.en.yaml index 6659cdf..b4a0402 100644 --- a/translations/validators.en.yaml +++ b/translations/validators.en.yaml @@ -1,5 +1,5 @@ bitbag: - imoje_plugin: + ing_pay_plugin: configuration: merchant_id: not_blank: Please enter a merchant ID.