Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
relatedTo example
else
{
$expires
=
$expires
->
modify
(
sprintf
(
'-%d seconds',
abs
(
$tokenStruct
->
getExpires
(
)
)
)
)
;
}
$jwtToken
=
$this
->configuration->
builder
(
)
->
identifiedBy
(
Uuid::
randomHex
(
)
)
->
issuedAt
(
new
\
DateTimeImmutable
(
'@' .
time
(
)
)
)
->
canOnlyBeUsedAfter
(
new
\
DateTimeImmutable
(
'@' .
time
(
)
)
)
->
expiresAt
(
$expires
)
->
relatedTo
(
$tokenStruct
->
getTransactionId
(
)
?? ''
)
->
withClaim
(
'pmi',
$tokenStruct
->
getPaymentMethodId
(
)
)
->
withClaim
(
'ful',
$tokenStruct
->
getFinishUrl
(
)
)
->
withClaim
(
'eul',
$tokenStruct
->
getErrorUrl
(
)
)
->
getToken
(
$this
->configuration->
signer
(
)
,
$this
->configuration->
signingKey
(
)
)
;
$this
->
write
(
$jwtToken
->
toString
(
)
,
$expires
)
;
return
$jwtToken
->
toString
(
)
;
}
public
function
parseToken
(
string
$token
)
: TokenStruct
{