Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
buildFinalizePayload example
}
return
new
RedirectResponse
(
$response
->
getRedirectUrl
(
)
)
;
}
public
function
finalize
(
AsyncPaymentTransactionStruct
$transaction
, Request
$request
, SalesChannelContext
$salesChannelContext
)
: void
{
$queryParameters
=
$request
->query->
all
(
)
;
unset
(
$queryParameters
[
'_sw_payment_token'
]
)
;
$payload
=
$this
->
buildFinalizePayload
(
$transaction
,
$queryParameters
)
;
$app
=
$this
->
getAppPaymentMethod
(
$transaction
->
getOrderTransaction
(
)
)
->
getApp
(
)
;
if
(
$app
=== null
)
{
throw
PaymentException::
asyncFinalizeInterrupted
(
$transaction
->
getOrderTransaction
(
)
->
getId
(
)
, 'App not defined'
)
;
}
$url
=
$this
->
getAppPaymentMethod
(
$transaction
->
getOrderTransaction
(
)
)
->
getFinalizeUrl
(
)
;
if
(
$url
=== null
)
{
throw
PaymentException::
asyncFinalizeInterrupted
(
$transaction
->
getOrderTransaction
(
)
->
getId
(
)
, 'Finalize URL not defined'
)
;
}
try
{