diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0e6a38..a63664e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -88,7 +88,7 @@ jobs: - name: Run ECS - run: vendor/bin/ecs check src + run: vendor/bin/ecs check if: always() && steps.end-of-setup.outcome == 'success' - diff --git a/ecs.php b/ecs.php index cd3d17f..98fbfe6 100644 --- a/ecs.php +++ b/ecs.php @@ -8,6 +8,11 @@ return static function (ECSConfig $ecsConfig): void { $ecsConfig->import(__DIR__ . '/vendor/sylius-labs/coding-standard/ecs.php'); + $ecsConfig->paths([ + 'src', + 'tests/Behat', + ]); + $services = $ecsConfig->services(); // PHP 7 compatibility diff --git a/features/shop/stripe_checkout_session/api.feature b/features/shop/stripe_checkout_session/api.feature new file mode 100644 index 0000000..757eead --- /dev/null +++ b/features/shop/stripe_checkout_session/api.feature @@ -0,0 +1,33 @@ +@stripe_checkout_session_payment_configuration +Feature: Paying with Stripe Checkout Session during checkout + In order to buy products + As a Customer + I want to be able to pay with "Stripe Checkout Session" payment gateway + I want to be able to use the payment configuration endpoint + + Background: + Given the store operates on a single channel in "United States" + And there is a user "john@example.com" identified by "password123" + And the store has a product "PHP T-Shirt" priced at "€19.99" + And the store ships everywhere for free + And I am logged in as "john@example.com" + + @api + Scenario: Getting payment configuration + Given the store has a payment method "Stripe" with a code "stripe" and Stripe Checkout Session payment gateway without using authorize + And I added product "PHP T-Shirt" to the cart + And I have proceeded selecting "Stripe" payment method + When I see the payment configuration + Then I should be able to get "publishable_key" with value "pk_test_publishablekey" + And I should be able to get "use_authorize" with a boolean value 0 + And I should be able to get "stripe_checkout_session_url" with value "https://checkout.stripe.com/c/pay/cs_1" + + @api + Scenario: Getting payment configuration using authorize + Given the store has a payment method "Stripe authorize" with a code "stripe_authorize" and Stripe Checkout Session payment gateway using authorize + And I added product "PHP T-Shirt" to the cart + And I have proceeded selecting "Stripe authorize" payment method + When I see the payment configuration + Then I should be able to get "publishable_key" with value "pk_test_publishablekey" + And I should be able to get "use_authorize" with a boolean value 1 + And I should be able to get "stripe_checkout_session_url" with value "https://checkout.stripe.com/c/pay/cs_1" diff --git a/features/shop/stripe_js/api.feature b/features/shop/stripe_js/api.feature new file mode 100644 index 0000000..3f07335 --- /dev/null +++ b/features/shop/stripe_js/api.feature @@ -0,0 +1,33 @@ +@stripe_js_payment_configuration +Feature: Paying with Stripe JS during checkout + In order to buy products + As a Customer + I want to be able to pay with "Stripe JS" payment gateway + I want to be able to use the payment configuration endpoint + + Background: + Given the store operates on a single channel in "United States" + And there is a user "john@example.com" identified by "password123" + And the store has a product "PHP T-Shirt" priced at "€19.99" + And the store ships everywhere for free + And I am logged in as "john@example.com" + + @api + Scenario: Getting payment configuration + Given the store has a payment method "Stripe" with a code "stripe" and Stripe JS payment gateway without using authorize + And I added product "PHP T-Shirt" to the cart + And I have proceeded selecting "Stripe" payment method + When I see the payment configuration for Stripe JS + Then I should be able to get "publishable_key" with value "pk_test_publishablekey" + And I should be able to get "use_authorize" with a boolean value 0 + And I should be able to get "stripe_payment_intent_client_secret" with value "1234567890" + + @api + Scenario: Getting payment configuration using authorize + Given the store has a payment method "Stripe authorize" with a code "stripe_authorize" and Stripe JS payment gateway using authorize + And I added product "PHP T-Shirt" to the cart + And I have proceeded selecting "Stripe authorize" payment method + When I see the payment configuration for Stripe JS + Then I should be able to get "publishable_key" with value "pk_test_publishablekey" + And I should be able to get "use_authorize" with a boolean value 1 + And I should be able to get "stripe_payment_intent_client_secret" with value "1234567890" diff --git a/src/Api/PaymentConfiguration/StripeCheckoutSessionPaymentConfigProvider.php b/src/Api/PaymentConfiguration/StripeCheckoutSessionPaymentConfigProvider.php index 3431a67..b9a33d0 100644 --- a/src/Api/PaymentConfiguration/StripeCheckoutSessionPaymentConfigProvider.php +++ b/src/Api/PaymentConfiguration/StripeCheckoutSessionPaymentConfigProvider.php @@ -4,8 +4,8 @@ namespace FluxSE\SyliusPayumStripePlugin\Api\PaymentConfiguration; -use FluxSE\SyliusPayumStripePlugin\Api\Payum\CaptureProcessorInterface; -use Stripe\Checkout\Session; +use FluxSE\SyliusPayumStripePlugin\Api\Payum\ProcessorInterface; +use Payum\Core\Reply\HttpRedirect; use Sylius\Bundle\ApiBundle\Payment\PaymentConfigurationProviderInterface; use Sylius\Component\Core\Model\PaymentInterface; @@ -15,10 +15,10 @@ final class StripeCheckoutSessionPaymentConfigProvider implements PaymentConfigu StripePaymentConfigProviderTrait::__construct as private __stripePaymentConfigProviderConstruct; } - private CaptureProcessorInterface $captureProcessor; + private ProcessorInterface $captureProcessor; public function __construct( - CaptureProcessorInterface $captureProcessor, + ProcessorInterface $captureProcessor, string $factoryName ) { $this->captureProcessor = $captureProcessor; @@ -29,9 +29,12 @@ public function provideConfiguration(PaymentInterface $payment): array { $config = $this->provideDefaultConfiguration($payment); - $details = $this->captureProcessor->__invoke($payment); - $session = Session::constructFrom($details); - $config['stripe_checkout_session_url'] = $session->url; + $data = $this->captureProcessor->__invoke($payment, $config['use_authorize']); + $reply = $data['reply']; + + if ($reply instanceof HttpRedirect) { + $config['stripe_checkout_session_url'] = $reply->getUrl(); + } return $config; } diff --git a/src/Api/PaymentConfiguration/StripeJsPaymentConfigProvider.php b/src/Api/PaymentConfiguration/StripeJsPaymentConfigProvider.php index d6cf3f9..c1220e8 100644 --- a/src/Api/PaymentConfiguration/StripeJsPaymentConfigProvider.php +++ b/src/Api/PaymentConfiguration/StripeJsPaymentConfigProvider.php @@ -4,7 +4,7 @@ namespace FluxSE\SyliusPayumStripePlugin\Api\PaymentConfiguration; -use FluxSE\SyliusPayumStripePlugin\Api\Payum\CaptureProcessorInterface; +use FluxSE\SyliusPayumStripePlugin\Api\Payum\ProcessorInterface; use Stripe\PaymentIntent; use Sylius\Bundle\ApiBundle\Payment\PaymentConfigurationProviderInterface; use Sylius\Component\Core\Model\PaymentInterface; @@ -15,10 +15,10 @@ final class StripeJsPaymentConfigProvider implements PaymentConfigurationProvide StripePaymentConfigProviderTrait::__construct as private __stripePaymentConfigProviderConstruct; } - private CaptureProcessorInterface $captureProcessor; + private ProcessorInterface $captureProcessor; public function __construct( - CaptureProcessorInterface $captureProcessor, + ProcessorInterface $captureProcessor, string $factoryName ) { $this->captureProcessor = $captureProcessor; @@ -29,8 +29,8 @@ public function provideConfiguration(PaymentInterface $payment): array { $config = $this->provideDefaultConfiguration($payment); - $details = $this->captureProcessor->__invoke($payment); - $paymentIntent = PaymentIntent::constructFrom($details); + $data = $this->captureProcessor->__invoke($payment, $config['use_authorize']); + $paymentIntent = PaymentIntent::constructFrom($data['details']); $config['stripe_payment_intent_client_secret'] = $paymentIntent->client_secret; return $config; diff --git a/src/Api/Payum/CaptureProcessorInterface.php b/src/Api/Payum/CaptureProcessorInterface.php deleted file mode 100644 index 96019cb..0000000 --- a/src/Api/Payum/CaptureProcessorInterface.php +++ /dev/null @@ -1,12 +0,0 @@ -payum = $payum; $this->captureRequestFactory = $captureRequestFactory; + $this->authorizeRequestFactory = $authorizeRequestFactory; $this->afterUrlProvider = $afterUrlProvider; } - public function __invoke(PaymentInterface $payment): array + public function __invoke(PaymentInterface $payment, bool $useAuthorize): array { $tokenFactory = $this->payum->getTokenFactory(); $gatewayName = $this->getGatewayConfig($payment)->getGatewayName(); - $token = $tokenFactory->createCaptureToken( - $gatewayName, - $payment, - $this->afterUrlProvider->getAfterPath($payment), - $this->afterUrlProvider->getAfterParameters($payment) - ); $gateway = $this->payum->getGateway($gatewayName); - $captureRequest = $this->captureRequestFactory->createNewWithToken($token); - $gateway->execute($captureRequest, true); + if ($useAuthorize) { + $token = $tokenFactory->createAuthorizeToken( + $gatewayName, + $payment, + $this->afterUrlProvider->getAfterPath($payment), + $this->afterUrlProvider->getAfterParameters($payment) + ); + $request = $this->authorizeRequestFactory->createNewWithToken($token); + } else { + $token = $tokenFactory->createCaptureToken( + $gatewayName, + $payment, + $this->afterUrlProvider->getAfterPath($payment), + $this->afterUrlProvider->getAfterParameters($payment) + ); + $request = $this->captureRequestFactory->createNewWithToken($token); + } + + $reply = $gateway->execute($request, true); /** @var ArrayObject $details */ - $details = $captureRequest->getModel(); + $details = $request->getModel(); - return $details->getArrayCopy(); + return [ + 'reply' => $reply, + 'details' => $details->getArrayCopy(), + ]; } private function getGatewayConfig(PaymentInterface $payment): GatewayConfigInterface diff --git a/src/Api/Payum/ProcessorInterface.php b/src/Api/Payum/ProcessorInterface.php new file mode 100644 index 0000000..8a473b3 --- /dev/null +++ b/src/Api/Payum/ProcessorInterface.php @@ -0,0 +1,16 @@ + lexik/jwt-authentication-bundle ### -JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem -JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem -JWT_PASSPHRASE=acme_plugin_development +JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private-test.pem +JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public-test.pem +JWT_PASSPHRASE=ALL_THAT_IS_GOLD_DOES_NOT_GLITTER_NOT_ALL_THOSE_WHO_WANDER_ARE_LOST ###< lexik/jwt-authentication-bundle ### ###> symfony/swiftmailer-bundle ### diff --git a/tests/Application/.env.test b/tests/Application/.env.test index 7559af4..6d7d2c8 100644 --- a/tests/Application/.env.test +++ b/tests/Application/.env.test @@ -13,12 +13,6 @@ KERNEL_CLASS='Tests\FluxSE\SyliusPayumStripePlugin\Application\Kernel' MAILER_URL=null://localhost ###< symfony/swiftmailer-bundle ### -###> lexik/jwt-authentication-bundle ### -JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private-test.pem -JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public-test.pem -JWT_PASSPHRASE=ALL_THAT_IS_GOLD_DOES_NOT_GLITTER_NOT_ALL_THOSE_WHO_WANDER_ARE_LOST -###< lexik/jwt-authentication-bundle ### - ###> symfony/messenger ### MESSENGER_TRANSPORT_DSN=sync:// ###< symfony/messenger ### diff --git a/tests/Application/config/jwt/private-test.pem b/tests/Application/config/jwt/private-test.pem new file mode 100644 index 0000000..b5a5246 --- /dev/null +++ b/tests/Application/config/jwt/private-test.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEAxuS1SudSNkjTQcP4H5SjzrdO29upko9KYZgUH6z5n+weDtIo +5tysdm7xY3nNAU9ixo7wrBvttuf7T1fDCVJjhzqX5iewaCZks7q9kYygCbvmrAoc +bx5D9EPZPH0sQQoa9gMuNou2nqWpVdTYCMAjxzVpqa2krioUzkBJzaWGDYiijv9q +KbjWvRUUoYFNOFIFXHFFDrK5ISBC155XiETKyBYhB1wZVWX1tHe1nDW609BHAAsr +1Ve3uiodzYzQ7S9Rw9Q6RCRSRgZRzFV1GTJEuyMpCCD51DA4otYeEPQf+8hvV3aK +bSNydzrQICY95kfB0p9HxorBPh8QHq0qKZOIle1Aglp0UV3OWgXLWncNc0m8e8hT +2I55lYkLio99/4PGfalAdJBPhKtTzbJllaERHOnlMkEvwk7eggkbbXEN/Ay6usi0 +R8mRaxhMkS9i8MxubgQBDsOomtegRqA1EzSGU/FJMS5g/I/gO9bjFu2l2LJwd6B4 +t/FZt/9mAIGYbIj5/Ykd0E1WIKYAIRUoyW1gTrGe70yxdHEPEILnZZMRVJzDbkVY +fgKAFUpAUqbHTtS+YI6p9tjFuxBrc6GZR/kppL/MkEARDX0ZX3n4sPLQf/vdR7+K +s8Yqws1IqsZ3h8iP8WpykbEwnd1w49A1ZBBinIXU3idf41EtQgawbpK5Oy0CAwEA +AQKCAgAEdUnvBOJd3yIFHlxocM9/KbK10OWrKFUVfPAuiZUK1aMS1/kcu6OOAAyf +GzLSLbJcGwYgBXw9llOWwrPXeKZMeK7A9PDKVNn7AVuQcKOBtFmGT6+1eesyBXdQ +GMouJwjVrNqTVGxif/oct2mkQJJMu9DDgeXoFX9j5CMDXgt0MDTcmbMKfl8p29gb +iqdtdME0AkH3A2CM8oktBhqWLlyRQZW58YGL3X41bl1+w+GNL+T3hkiUPqQaoykJ +23cvadkeV5p6vomtkiSxPNUkHHFX9IDN8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3YOOUOPUX6PCfu8BMLRFASAdMbwNBXk= +-----END RSA PRIVATE KEY----- diff --git a/tests/Application/config/jwt/private.pem b/tests/Application/config/jwt/private.pem deleted file mode 100644 index 2bcf023..0000000 --- a/tests/Application/config/jwt/private.pem +++ /dev/null @@ -1,54 +0,0 @@ ------BEGIN ENCRYPTED PRIVATE KEY----- -MIIJrTBXBgkqhkiG9w0BBQ0wSjApBgkqhkiG9w0BBQwwHAQIDbthk+aF5EACAggA -MAwGCCqGSIb3DQIJBQAwHQYJYIZIAWUDBAEqBBA3DYfh2mXByUxFNke/Wf5SBIIJ -UBckIgXeXBWPLQAAq07pN8uNFMUcUirFuEvbmxVe1PupCCAqriNxi1DqeSu/M7c1 -h66y0BqKZu/0G9SVTg63iCKDEiRAM3hLyD2CsjYg8h2LAaqQ9dFYGV0cHRhCXagZ -Sdt9YTfn2rarRbxauMSt0z9zwCaiUrBU4JwSM3g+tD7W0lxAm9TeaqBZek5DIX+j -3Gom5tPYQe8jvfGMGdMPuanoEwH4WbWzGcqypWriy4JwaggwKCQ4ituWfa9kqMMC -8HRmBBDg0gtafmQP910RZh18JL2ewF5Pl7GDsLtOj5gNLNuAiQxDCcYRnD4/Cdsl -bH91btmGX1nUVIFViUTW93eBsjBgdgqOMRVxUKkSSX6CmIZWlE3AazgwSbvOvNrN -JGa8X21UwfuS/JHLmfRmgdti0YxRjJkBYLPpcd3ILsi+MMhSHy0uycAM/dB80Q1B -vkW1UXGbCw/PzA5yHrzULzAl69E3Tt5nTVMIIcBGxw2rf+ej+AVjsuOl7etwecdC -gnA90ViNlGOACLVnhsjd4WVF9Oircosf0UYoblwcT6gw1GSVF9pWuu7k5hy/7Pt/ -o1BvonUgz/4VHG+K58qvtnlto+JE0XWzPvukNUyggtekTLyoQCI3ZKge6ui3qLax -N6whHpzFnFVF3GJAisTk5naHFawHNvH7t85pmc+UnjNUUmyl9RStl9LMYDSBKNlR -LzPlJK27E5SLhhyJCni4+UYjH6PdlJuKXJ0365fufJ+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foBHR+eIARub2itOJ/cI+oKv96d4it4FqQ9Lml8RUFFZj7Hrd6EjDb6Nq4 -P9ti7eku/xZvS0saBNChvv44GhP6FZJS0i/gidVffLna7Wua98tPZEAXp57k+XUL -PzsRJ4a+hFuQjkyXFoz/v8YuUdyCFUSVVr9ArVu0v4+4euFWpQLav5sXv0Gh9X58 -Ek1KIf7Z/tZAJnSjTjFuSbDX/AoTMTxpRBKKnFW6zY0Nw2pjTVMtTVDkv9xkBpBK -wod7FPD5f0T7y9YOARVZnBxVRSkkcYpEJFy5pLNeadg9 ------END ENCRYPTED PRIVATE KEY----- diff --git a/tests/Application/config/jwt/public-test.pem b/tests/Application/config/jwt/public-test.pem new file mode 100644 index 0000000..91710fd --- /dev/null +++ b/tests/Application/config/jwt/public-test.pem @@ -0,0 +1,14 @@ +-----BEGIN PUBLIC KEY----- +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxuS1SudSNkjTQcP4H5Sj +zrdO29upko9KYZgUH6z5n+weDtIo5tysdm7xY3nNAU9ixo7wrBvttuf7T1fDCVJj +hzqX5iewaCZks7q9kYygCbvmrAocbx5D9EPZPH0sQQoa9gMuNou2nqWpVdTYCMAj +xzVpqa2krioUzkBJzaWGDYiijv9qKbjWvRUUoYFNOFIFXHFFDrK5ISBC155XiETK +yBYhB1wZVWX1tHe1nDW609BHAAsr1Ve3uiodzYzQ7S9Rw9Q6RCRSRgZRzFV1GTJE +uyMpCCD51DA4otYeEPQf+8hvV3aKbSNydzrQICY95kfB0p9HxorBPh8QHq0qKZOI +le1Aglp0UV3OWgXLWncNc0m8e8hT2I55lYkLio99/4PGfalAdJBPhKtTzbJllaER +HOnlMkEvwk7eggkbbXEN/Ay6usi0R8mRaxhMkS9i8MxubgQBDsOomtegRqA1EzSG +U/FJMS5g/I/gO9bjFu2l2LJwd6B4t/FZt/9mAIGYbIj5/Ykd0E1WIKYAIRUoyW1g +TrGe70yxdHEPEILnZZMRVJzDbkVYfgKAFUpAUqbHTtS+YI6p9tjFuxBrc6GZR/kp +pL/MkEARDX0ZX3n4sPLQf/vdR7+Ks8Yqws1IqsZ3h8iP8WpykbEwnd1w49A1ZBBi +nIXU3idf41EtQgawbpK5Oy0CAwEAAQ== +-----END PUBLIC KEY----- \ No newline at end of file diff --git a/tests/Application/config/jwt/public.pem b/tests/Application/config/jwt/public.pem deleted file mode 100644 index cb4e13d..0000000 --- a/tests/Application/config/jwt/public.pem +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA6QkmF/Xi5nAYb8Kzr7qC -d63V2K+d/nCXbpDUKKDPJAqOtTlMoQSuJRLNnhhp7z1i/Cp4Bhifr20Pu2dq8JYg -6pRT4ctqvYb/MXxAaPZc3EcBC0S6AhgKO/fDvR3LcqYqGJmQQOXZvxTsgqongdvV -4XbqFBMMgngyayoBk0VKTaI/s+LQhIce+1QaxbAI0+/zbR0hZ1hWT73orJi3do+1 -TBzQol+V7WGa8LlJfmgM56qO3BmVkeTDMBc27pGp6g3+Oufk/l29jEGJlUT9yu7Q -BRhaQTWNVASa2aD+AKjVBzJh53O2zD8slAbjF1M9U7bbWN28Sv+xC/dUz0q9HnPu -RsY2tnwryqTyYn/Hf2xyP3/KvjJ6oslAwemu5JirdJkO7KVQAthWG42gLuhZg3ks -cSZhCLZH7nO2UDsf+2ZZgdbhpYZwR4gDRfNt7GKWXnWZOz9Uw1yVCPgylyZRZwg8 -l0y9aABdj3379I22icrwpMZbAgkyxNSV6UNJuxZksLUoP3i9OvXYgPYU9E4tU/Ul -Dm/T1rGSReGoPkU1YQnI50bq7p1byIoUu2scTflvpTVI5a7zULkS1tg60xk7vBRC -aBc7nr4UEtA235N6uLtcGxH11WBMwsKX69sSU0sQdC4Sk25zXM2gc8R1XV9K3qz2 -wQorQRlCwrkG44VRDgbFH+8CAwEAAQ== ------END PUBLIC KEY----- diff --git a/tests/Application/config/packages/_sylius.yaml b/tests/Application/config/packages/_sylius.yaml index 7532b01..18acdd4 100644 --- a/tests/Application/config/packages/_sylius.yaml +++ b/tests/Application/config/packages/_sylius.yaml @@ -13,3 +13,6 @@ parameters: sylius_shop: product_grid: include_all_descendants: true + +sylius_api: + enabled: true diff --git a/tests/Application/config/symfony/6.4/packages/security.yaml b/tests/Application/config/symfony/6.4/packages/security.yaml index dbc9e1a..2af4d3e 100644 --- a/tests/Application/config/symfony/6.4/packages/security.yaml +++ b/tests/Application/config/symfony/6.4/packages/security.yaml @@ -1,14 +1,3 @@ -parameters: - sylius.security.admin_regex: "^/%sylius_admin.path_name%" - sylius.security.api_regex: "^/api" - sylius.security.shop_regex: "^/(?!%sylius_admin.path_name%|new-api|api/.*|api$|media/.*)[^/]++" - sylius.security.new_api_route: "/new-api" - sylius.security.new_api_regex: "^%sylius.security.new_api_route%" - sylius.security.new_api_admin_route: "%sylius.security.new_api_route%/admin" - sylius.security.new_api_admin_regex: "^%sylius.security.new_api_admin_route%" - sylius.security.new_api_shop_route: "%sylius.security.new_api_route%/shop" - sylius.security.new_api_shop_regex: "^%sylius.security.new_api_shop_route%" - security: enable_authenticator_manager: true providers: @@ -20,10 +9,6 @@ security: id: sylius.shop_user_provider.email_or_name_based sylius_api_shop_user_provider: id: sylius.shop_user_provider.email_or_name_based - sylius_api_chain_provider: - chain: - providers: [ sylius_api_shop_user_provider, sylius_api_admin_user_provider ] - password_hashers: Sylius\Component\User\Model\UserInterface: argon2i @@ -60,7 +45,7 @@ security: stateless: true entry_point: jwt json_login: - check_path: "%sylius.security.new_api_admin_route%/authentication-token" + check_path: "%sylius.security.new_api_admin_route%/administrators/token" username_path: email password_path: password success_handler: lexik_jwt_authentication.handler.authentication_success @@ -73,7 +58,7 @@ security: stateless: true entry_point: jwt json_login: - check_path: "%sylius.security.new_api_shop_route%/authentication-token" + check_path: "%sylius.security.new_api_shop_route%/customers/token" username_path: email password_path: password success_handler: lexik_jwt_authentication.handler.authentication_success @@ -108,6 +93,10 @@ security: target: sylius_shop_homepage invalidate_session: false + image_resolver: + pattern: ^/media/cache/resolve + security: false + dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false @@ -129,9 +118,9 @@ security: - { path: "%sylius.security.admin_regex%", role: ROLE_ADMINISTRATION_ACCESS } - { path: "%sylius.security.shop_regex%/account", role: ROLE_USER } - - { path: "%sylius.security.new_api_admin_route%/reset-password-requests", role: PUBLIC_ACCESS } + - { path: "%sylius.security.new_api_admin_route%/administrators/reset-password", role: PUBLIC_ACCESS } - { path: "%sylius.security.new_api_admin_regex%/.*", role: ROLE_API_ACCESS } - - { path: "%sylius.security.new_api_admin_route%/authentication-token", role: PUBLIC_ACCESS } + - { path: "%sylius.security.new_api_admin_route%/administrators/token", role: PUBLIC_ACCESS } - { path: "%sylius.security.new_api_user_account_regex%/.*", role: ROLE_USER } - - { path: "%sylius.security.new_api_shop_route%/authentication-token", role: PUBLIC_ACCESS } + - { path: "%sylius.security.new_api_shop_route%/customers/token", role: PUBLIC_ACCESS } - { path: "%sylius.security.new_api_shop_regex%/.*", role: PUBLIC_ACCESS } diff --git a/tests/Behat/Context/Api/Shop/CartContext.php b/tests/Behat/Context/Api/Shop/CartContext.php new file mode 100644 index 0000000..79ed3fc --- /dev/null +++ b/tests/Behat/Context/Api/Shop/CartContext.php @@ -0,0 +1,120 @@ +shopClient = $shopClient; + $this->responseChecker = $responseChecker; + $this->sharedStorage = $sharedStorage; + $this->stripeCheckoutSessionMocker = $stripeCheckoutSessionMocker; + $this->stripeJsMocker = $stripeJsMocker; + } + + /** + * @When /^I see the payment configuration$/ + */ + public function iSeeThePaymentConfiguration(): void + { + $this->stripeCheckoutSessionMocker->mockCreatePayment(function () { + $tokenValue = $this->getCartTokenValue(); + + $this->shopClient->show( + Resources::ORDERS, + sprintf( + '%s/%s/%s/configuration', + $tokenValue, + Resources::PAYMENTS, + $this->getCart()['payments'][0]['id'] + ) + ); + + $this->sharedStorage->set('response', $this->shopClient->getLastResponse()); + }); + } + + /** + * @When /^I see the payment configuration for Stripe JS$/ + */ + public function iSeeThePaymentConfigurationForStripeJs(): void + { + $this->stripeJsMocker->mockCreatePayment(function () { + $tokenValue = $this->getCartTokenValue(); + + $this->shopClient->show( + Resources::ORDERS, + sprintf( + '%s/%s/%s/configuration', + $tokenValue, + Resources::PAYMENTS, + $this->getCart()['payments'][0]['id'] + ) + ); + + $this->sharedStorage->set('response', $this->shopClient->getLastResponse()); + }); + } + + /** + * @Then /^I should be able to get "([^"]+)" with value "([^"]+)"$/ + */ + public function iShouldBeAbleToGetWithValue(string $key, string $expectedValue): void + { + $response = $this->sharedStorage->get('response'); + $value = $this->responseChecker->getValue($response, $key); + Assert::eq($value, $expectedValue); + } + + /** + * @Then /^I should be able to get "([^"]+)" with a boolean value (1|0)$/ + */ + public function iShouldBeAbleToGetWithABooleanValue(string $key, bool $expectedValue): void + { + $response = $this->sharedStorage->get('response'); + $value = $this->responseChecker->getValue($response, $key); + Assert::eq($value, $expectedValue); + } + + private function getCart(): array + { + return $this->responseChecker->getResponseContent($this->shopClient->show(Resources::ORDERS, $this->getCartTokenValue())); + } + + private function getCartTokenValue(): string + { + if ($this->sharedStorage->has('cart_token')) { + return $this->sharedStorage->get('cart_token'); + } + + throw new LogicException('Unable to found the cart_token inside the shared storage.'); + } +} diff --git a/tests/Behat/Context/Ui/Admin/ManagingOrdersContext.php b/tests/Behat/Context/Ui/Admin/ManagingOrdersContext.php index b5b5ef2..d0d32f9 100644 --- a/tests/Behat/Context/Ui/Admin/ManagingOrdersContext.php +++ b/tests/Behat/Context/Ui/Admin/ManagingOrdersContext.php @@ -11,11 +11,9 @@ use Stripe\PaymentIntent; use Sylius\Component\Core\Model\OrderInterface; use Sylius\Component\Core\Model\PaymentInterface; -use Sylius\Component\Core\Model\Payment; use Sylius\Component\Payment\PaymentTransitions; use Sylius\Component\Resource\StateMachine\StateMachineInterface; use Tests\FluxSE\SyliusPayumStripePlugin\Behat\Mocker\StripeCheckoutSessionMocker; -use Webmozart\Assert\Assert; class ManagingOrdersContext implements Context { diff --git a/tests/Behat/Context/Ui/Shop/StripeCheckoutSessionShopContext.php b/tests/Behat/Context/Ui/Shop/StripeCheckoutSessionShopContext.php index bfb8790..4a614c9 100644 --- a/tests/Behat/Context/Ui/Shop/StripeCheckoutSessionShopContext.php +++ b/tests/Behat/Context/Ui/Shop/StripeCheckoutSessionShopContext.php @@ -101,7 +101,7 @@ function () { ], ], ]; - $payload = json_encode($jsonEvent,\JSON_THROW_ON_ERROR); + $payload = json_encode($jsonEvent, \JSON_THROW_ON_ERROR); $this->paymentPage->notify($payload); }, diff --git a/tests/Behat/Context/Ui/Shop/StripeJsShopContext.php b/tests/Behat/Context/Ui/Shop/StripeJsShopContext.php index be06841..270c9d5 100644 --- a/tests/Behat/Context/Ui/Shop/StripeJsShopContext.php +++ b/tests/Behat/Context/Ui/Shop/StripeJsShopContext.php @@ -7,7 +7,6 @@ use Behat\Behat\Context\Context; use Behat\MinkExtension\Context\MinkContext; use RuntimeException; -use Stripe\Checkout\Session; use Stripe\Event; use Stripe\PaymentIntent; use Sylius\Behat\Page\Shop\Checkout\CompletePageInterface; @@ -91,7 +90,7 @@ function () { ], ], ]; - $payload = json_encode($jsonEvent,\JSON_THROW_ON_ERROR); + $payload = json_encode($jsonEvent, \JSON_THROW_ON_ERROR); $this->paymentPage->notify($payload); }, diff --git a/tests/Behat/Mocker/Api/CheckoutSessionMocker.php b/tests/Behat/Mocker/Api/CheckoutSessionMocker.php index 0ec81c8..df04f47 100644 --- a/tests/Behat/Mocker/Api/CheckoutSessionMocker.php +++ b/tests/Behat/Mocker/Api/CheckoutSessionMocker.php @@ -56,6 +56,7 @@ public function mockCreateAction(): void 'id' => 'cs_1', 'object' => Session::OBJECT_NAME, 'payment_intent' => 'pi_1', + 'url' => 'https://checkout.stripe.com/c/pay/cs_1', ], $rModel->getArrayCopy())); $request->setApiResource($session); }); @@ -126,7 +127,8 @@ public function mockAllAction(string $status): void 'object' => Session::OBJECT_NAME, 'status' => $status, ], - ]])); + ]]) + ); }); } diff --git a/tests/Behat/Mocker/Api/PaymentIntentMocker.php b/tests/Behat/Mocker/Api/PaymentIntentMocker.php index d0b22ee..c41ca2c 100644 --- a/tests/Behat/Mocker/Api/PaymentIntentMocker.php +++ b/tests/Behat/Mocker/Api/PaymentIntentMocker.php @@ -13,7 +13,6 @@ use FluxSE\PayumStripe\Request\Api\Resource\CreatePaymentIntent; use FluxSE\PayumStripe\Request\Api\Resource\RetrievePaymentIntent; use FluxSE\PayumStripe\Request\Api\Resource\UpdatePaymentIntent; -use Stripe\Checkout\Session; use Stripe\PaymentIntent; use Sylius\Behat\Service\Mocker\MockerInterface; @@ -52,11 +51,12 @@ public function mockCreateAction(): void ->andReturnUsing(function (CreatePaymentIntent $request) { /** @var ArrayObject $rModel */ $rModel = $request->getModel(); - $session = Session::constructFrom(array_merge([ + $paymentIntent = PaymentIntent::constructFrom(array_merge([ 'id' => 'pi_1', 'object' => PaymentIntent::OBJECT_NAME, + 'client_secret' => '1234567890', ], $rModel->getArrayCopy())); - $request->setApiResource($session); + $request->setApiResource($paymentIntent); }); } @@ -88,6 +88,7 @@ public function mockRetrieveAction(string $status): void 'id' => $request->getId(), 'object' => PaymentIntent::OBJECT_NAME, 'status' => $status, + 'client_secret' => '1234567890', ])); }); } diff --git a/tests/Behat/Mocker/StripeCheckoutSessionMocker.php b/tests/Behat/Mocker/StripeCheckoutSessionMocker.php index 1e47375..f98f1d5 100644 --- a/tests/Behat/Mocker/StripeCheckoutSessionMocker.php +++ b/tests/Behat/Mocker/StripeCheckoutSessionMocker.php @@ -6,7 +6,6 @@ use Stripe\Checkout\Session; use Stripe\PaymentIntent; -use Stripe\Refund; use Sylius\Behat\Service\Mocker\MockerInterface; use Tests\FluxSE\SyliusPayumStripePlugin\Behat\Mocker\Api\CheckoutSessionMocker; use Tests\FluxSE\SyliusPayumStripePlugin\Behat\Mocker\Api\PaymentIntentMocker; @@ -99,7 +98,7 @@ public function mockSuccessfulPayment(callable $notifyAction, callable $action): Session::PAYMENT_STATUS_PAID, PaymentIntent::STATUS_SUCCEEDED ); - $this->mockPaymentIntentSync($action,PaymentIntent::STATUS_SUCCEEDED); + $this->mockPaymentIntentSync($action, PaymentIntent::STATUS_SUCCEEDED); } public function mockAuthorizePayment(callable $notifyAction, callable $action): void @@ -113,7 +112,7 @@ public function mockAuthorizePayment(callable $notifyAction, callable $action): $this->mockPaymentIntentSync($action, PaymentIntent::STATUS_REQUIRES_CAPTURE); } - public function mockSuccessfulPaymentWithoutWebhook(callable $action ): void + public function mockSuccessfulPaymentWithoutWebhook(callable $action): void { $this->mockSessionSync( $action, diff --git a/tests/Behat/Mocker/StripeJsMocker.php b/tests/Behat/Mocker/StripeJsMocker.php index 969dd2f..789d8ff 100644 --- a/tests/Behat/Mocker/StripeJsMocker.php +++ b/tests/Behat/Mocker/StripeJsMocker.php @@ -4,11 +4,8 @@ namespace Tests\FluxSE\SyliusPayumStripePlugin\Behat\Mocker; -use Stripe\Checkout\Session; use Stripe\PaymentIntent; -use Stripe\Refund; use Sylius\Behat\Service\Mocker\MockerInterface; -use Tests\FluxSE\SyliusPayumStripePlugin\Behat\Mocker\Api\CheckoutSessionMocker; use Tests\FluxSE\SyliusPayumStripePlugin\Behat\Mocker\Api\PaymentIntentMocker; use Tests\FluxSE\SyliusPayumStripePlugin\Behat\Mocker\Api\RefundMocker; @@ -79,7 +76,7 @@ public function mockSuccessfulPayment(callable $notifyAction, callable $action): $notifyAction, PaymentIntent::STATUS_SUCCEEDED ); - $this->mockPaymentIntentSync($action,PaymentIntent::STATUS_SUCCEEDED); + $this->mockPaymentIntentSync($action, PaymentIntent::STATUS_SUCCEEDED); } public function mockAuthorizePayment(callable $notifyAction, callable $action): void @@ -91,7 +88,7 @@ public function mockAuthorizePayment(callable $notifyAction, callable $action): $this->mockPaymentIntentSync($action, PaymentIntent::STATUS_REQUIRES_CAPTURE); } - public function mockSuccessfulPaymentWithoutWebhook(callable $action ): void + public function mockSuccessfulPaymentWithoutWebhook(callable $action): void { $this->mockPaymentIntentSync( $action, diff --git a/tests/Behat/Page/External/StripePage.php b/tests/Behat/Page/External/StripePage.php index d13f92f..17752ef 100644 --- a/tests/Behat/Page/External/StripePage.php +++ b/tests/Behat/Page/External/StripePage.php @@ -24,6 +24,7 @@ final class StripePage extends Page implements StripePageInterface /** @var string[] */ private array $deadTokens = []; + private string $gatewayName; /** @@ -139,6 +140,7 @@ private function findToken(string $type = 'capture'): TokenInterface if (null === $relatedToken) { $this->deadTokens[] = $foundToken->getHash(); + return $this->findToken($type); } } diff --git a/tests/Behat/Page/Shop/PayumNotifyPage.php b/tests/Behat/Page/Shop/PayumNotifyPage.php index b6e8fad..2f19813 100644 --- a/tests/Behat/Page/Shop/PayumNotifyPage.php +++ b/tests/Behat/Page/Shop/PayumNotifyPage.php @@ -12,9 +12,6 @@ class PayumNotifyPage extends SymfonyPage implements PayumNotifyPageInterface { private string $routeName; - /** - * @param $minkParameters - */ public function __construct( Session $session, $minkParameters, diff --git a/tests/Behat/Resources/services/context.xml b/tests/Behat/Resources/services/context.xml index 157aee9..60226a7 100644 --- a/tests/Behat/Resources/services/context.xml +++ b/tests/Behat/Resources/services/context.xml @@ -40,5 +40,14 @@ + + + + + + + + diff --git a/tests/Behat/Resources/suites/stripe_checkout_session/shop.yaml b/tests/Behat/Resources/suites/stripe_checkout_session/shop.yaml index 831cc65..0f4e9ea 100644 --- a/tests/Behat/Resources/suites/stripe_checkout_session/shop.yaml +++ b/tests/Behat/Resources/suites/stripe_checkout_session/shop.yaml @@ -43,3 +43,40 @@ default: - tests.flux_se.sylius_payum_stripe_plugin.behat.context.ui.shop.stripe_checkout_session filters: tags: "@paying_with_stripe_checkout_session_during_checkout&&@ui" + stripe_checkout_session_payment_configuration: + contexts: + - sylius.behat.context.hook.doctrine_orm + - sylius.behat.context.transform.address + - sylius.behat.context.transform.customer + - sylius.behat.context.transform.lexical + - sylius.behat.context.transform.locale + - sylius.behat.context.transform.order + - sylius.behat.context.transform.payment + - sylius.behat.context.transform.product + - sylius.behat.context.transform.shared_storage + - sylius.behat.context.transform.shipping_method + - sylius.behat.context.transform.tax_category + - sylius.behat.context.transform.tax_rate + - sylius.behat.context.transform.zone + + - sylius.behat.context.setup.channel + - sylius.behat.context.setup.currency + - sylius.behat.context.setup.geographical + - sylius.behat.context.setup.locale + - sylius.behat.context.setup.order + - sylius.behat.context.setup.payment + - sylius.behat.context.setup.product + - sylius.behat.context.setup.shipping + - sylius.behat.context.setup.shop_api_security + - sylius.behat.context.setup.taxation + - sylius.behat.context.setup.user + - sylius.behat.context.setup.cart + + - tests.flux_se.sylius_payum_stripe_plugin.behat.context.setup.stripe + + - sylius.behat.context.api.shop.cart + - sylius.behat.context.api.shop.checkout + + - tests.flux_se.sylius_payum_stripe_plugin.behat.context.api.shop.cart + filters: + tags: "@stripe_checkout_session_payment_configuration&&@api" diff --git a/tests/Behat/Resources/suites/stripe_js/shop.yaml b/tests/Behat/Resources/suites/stripe_js/shop.yaml index d72e9bc..9f530df 100644 --- a/tests/Behat/Resources/suites/stripe_js/shop.yaml +++ b/tests/Behat/Resources/suites/stripe_js/shop.yaml @@ -43,3 +43,40 @@ default: - tests.flux_se.sylius_payum_stripe_plugin.behat.context.ui.shop.stripe_js filters: tags: "@paying_with_stripe_js_during_checkout&&@ui" + stripe_js_payment_configuration: + contexts: + - sylius.behat.context.hook.doctrine_orm + - sylius.behat.context.transform.address + - sylius.behat.context.transform.customer + - sylius.behat.context.transform.lexical + - sylius.behat.context.transform.locale + - sylius.behat.context.transform.order + - sylius.behat.context.transform.payment + - sylius.behat.context.transform.product + - sylius.behat.context.transform.shared_storage + - sylius.behat.context.transform.shipping_method + - sylius.behat.context.transform.tax_category + - sylius.behat.context.transform.tax_rate + - sylius.behat.context.transform.zone + + - sylius.behat.context.setup.channel + - sylius.behat.context.setup.currency + - sylius.behat.context.setup.geographical + - sylius.behat.context.setup.locale + - sylius.behat.context.setup.order + - sylius.behat.context.setup.payment + - sylius.behat.context.setup.product + - sylius.behat.context.setup.shipping + - sylius.behat.context.setup.shop_api_security + - sylius.behat.context.setup.taxation + - sylius.behat.context.setup.user + - sylius.behat.context.setup.cart + + - tests.flux_se.sylius_payum_stripe_plugin.behat.context.setup.stripe + + - sylius.behat.context.api.shop.cart + - sylius.behat.context.api.shop.checkout + + - tests.flux_se.sylius_payum_stripe_plugin.behat.context.api.shop.cart + filters: + tags: "@stripe_js_payment_configuration&&@api"