feat: voucher purchase flow
This commit is contained in:
1 parent
a628e96d06
commit
f3dd122678
70 files changed
+3672
-122
No files matched your search
@@ -126,16 +126,21 @@ class BookingSessionManager
|
||||
*/
|
||||
public function storeReturnUrl(Request $request, ?string $returnUrl): void
|
||||
{
|
||||
$url = self::DEFAULT_RETURN_URL;
|
||||
$request->getSession()->set(self::RETURN_URL_KEY, self::normalizeReturnUrl($returnUrl));
|
||||
}
|
||||
|
||||
if (null !== $returnUrl && '' !== trim($returnUrl)) {
|
||||
if (false !== filter_var($returnUrl, \FILTER_VALIDATE_URL)
|
||||
&& 1 === preg_match('#^https?://#i', $returnUrl)) {
|
||||
$url = $returnUrl;
|
||||
}
|
||||
/**
|
||||
* Accepts an absolute http(s) URL and falls back to the default for anything else.
|
||||
*/
|
||||
public static function normalizeReturnUrl(?string $returnUrl): string
|
||||
{
|
||||
if (null !== $returnUrl && '' !== trim($returnUrl)
|
||||
&& false !== filter_var($returnUrl, \FILTER_VALIDATE_URL)
|
||||
&& 1 === preg_match('#^https?://#i', $returnUrl)) {
|
||||
return $returnUrl;
|
||||
}
|
||||
|
||||
$request->getSession()->set(self::RETURN_URL_KEY, $url);
|
||||
return self::DEFAULT_RETURN_URL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user