Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
CaptureResponse example
$this
->preparedPaymentService->
handlePreOrderPayment
(
$cart
,
new
RequestDataBag
(
)
,
$salesChannelContext
)
;
}
public
function
testCapture
(
)
: void
{
$paymentMethodId
=
$this
->
getPaymentMethodId
(
'prepared'
)
;
$orderId
=
$this
->
createOrder
(
$paymentMethodId
)
;
$transactionId
=
$this
->
createTransaction
(
$orderId
,
$paymentMethodId
)
;
$salesChannelContext
=
$this
->
getSalesChannelContext
(
$paymentMethodId
)
;
$order
=
$this
->
loadOrder
(
$orderId
,
$salesChannelContext
)
;
$response
=
new
CaptureResponse
(
)
;
$this
->
appendNewResponse
(
$this
->
signResponse
(
$response
->
jsonSerialize
(
)
)
)
;
$this
->preparedPaymentService->
handlePostOrderPayment
(
$order
,
new
RequestDataBag
(
)
,
$salesChannelContext
,
new
ArrayStruct
(
[
'test' => 'test'
]
)
)
;
/** @var Request $request */
$request
=
$this
->
getLastRequest
(
)
;
$body
=
$request
->
getBody
(
)
->
getContents
(
)
;
$appSecret
=
$this
->app->
getAppSecret
(
)
;
static
::
assertNotNull
(
$appSecret
)
;