return new ArrayStruct($response->
getPreOrderPayment());
} public function capture(PreparedPaymentTransactionStruct
$transaction, RequestDataBag
$requestDataBag, SalesChannelContext
$context, Struct
$preOrderPaymentStruct): void
{ $captureUrl =
$this->
getAppPaymentMethod($transaction->
getOrderTransaction())->
getCaptureUrl();
if (empty($captureUrl)) { return;
} $payload =
$this->
buildCapturePayload($transaction,
$preOrderPaymentStruct);
$app =
$this->
getAppPaymentMethod($transaction->
getOrderTransaction())->
getApp();
if ($app === null
) { throw PaymentException::
capturePreparedException($transaction->
getOrderTransaction()->
getId(), 'App not defined'
);
} try { $response =
$this->payloadService->
request($captureUrl,
$payload,
$app, CaptureResponse::
class,
$context->
getContext());
} catch (ClientExceptionInterface
$exception) { throw PaymentException::
capturePreparedException($transaction->
getOrderTransaction()->
getId(),
sprintf('App error: %s',
$exception->
getMessage()));
}