-
Notifications
You must be signed in to change notification settings - Fork 1
Support checkout session #23
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c101e5c
Support checkout session
BushraAsif 752b7a6
Add SonarQube configuration to ignore specific PHP rule violations
BushraAsif 9def0d5
Refactor PaymentService to improve session handling and update docume…
BushraAsif 81b9866
Support optional Gateway URL for AltaPay integration
BushraAsif 5ba5f78
Enhance Gateway URL configuration and improve session handling in Pay…
BushraAsif 474d178
Update Gateway URL instructions for improved clarity and flexibility
BushraAsif f656bb6
Fix newline issue in sonar-project.properties for proper formatting
BushraAsif 07a3752
Refactor shipping item ID generation in PaymentService for uniqueness
BushraAsif ced4195
Remove unnecessary comments in getUnknownLineItemFormat and streamlin…
BushraAsif ea67a27
Add SystemConfigSubscriber to validate AltaPay gateway URL and ensure…
BushraAsif 361ffe6
Simplify value validation in SystemConfigSubscriber by removing redun…
BushraAsif cf3184f
Remove AltaPayConfigException and update PaymentService to enforce HT…
BushraAsif File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| <?php declare(strict_types=1); | ||
|
|
||
| namespace Wexo\AltaPay\Subscriber; | ||
|
|
||
| use Psr\Log\LoggerInterface; | ||
| use Shopware\Core\System\SystemConfig\Event\BeforeSystemConfigChangedEvent; | ||
| use Symfony\Component\EventDispatcher\EventSubscriberInterface; | ||
| use Wexo\AltaPay\Exception\AltaPayConfigException; | ||
|
|
||
| class SystemConfigSubscriber implements EventSubscriberInterface | ||
| { | ||
| public const GATEWAY_URL_KEY = 'WexoAltaPay.config.gatewayUrl'; | ||
|
|
||
| public function __construct( | ||
| private readonly LoggerInterface $logger | ||
| ) { | ||
| } | ||
|
|
||
| public static function getSubscribedEvents(): array | ||
| { | ||
| return [ | ||
| BeforeSystemConfigChangedEvent::class => 'onBeforeSystemConfigChanged', | ||
| ]; | ||
| } | ||
|
|
||
| public function onBeforeSystemConfigChanged(BeforeSystemConfigChangedEvent $event): void | ||
| { | ||
| if ($event->getKey() !== self::GATEWAY_URL_KEY) { | ||
| return; | ||
| } | ||
|
|
||
| $value = $event->getValue(); | ||
| $trimmed = is_string($value) ? trim($value) : ''; | ||
|
|
||
| if ($trimmed === '') { | ||
| return; | ||
| } | ||
|
|
||
| if (!str_starts_with(strtolower($trimmed), 'https://')) { | ||
| $this->logger->error('Rejected AltaPay gateway URL because it is not HTTPS.', [ | ||
| 'gatewayUrl' => $trimmed, | ||
| 'salesChannelId' => $event->getSalesChannelId(), | ||
| ]); | ||
|
|
||
| throw AltaPayConfigException::gatewayUrlNotHttps(); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.