Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
addCapture example
$this
->orderRepository =
$this
->
getContainer
(
)
->
get
(
'order.repository'
)
;
$this
->paymentRefundProcessor =
$this
->
getContainer
(
)
->
get
(
PaymentRefundProcessor::
class
)
;
}
public
function
testItThrowsIfRefundNotFound
(
)
: void
{
// capture has no refund
$capture
=
(
new
OrderTransactionCaptureBuilder
(
$this
->ids, 'capture',
$this
->ids->
get
(
'transaction'
)
)
)
->
build
(
)
;
$transaction
=
(
new
OrderTransactionBuilder
(
$this
->ids, 'transaction'
)
)
->
addCapture
(
'capture',
$capture
)
->
build
(
)
;
$order
=
(
new
OrderBuilder
(
$this
->ids, '10000'
)
)
->
addTransaction
(
'transaction',
$transaction
)
->
build
(
)
;
$this
->orderRepository->
upsert
(
[
$order
]
, Context::
createDefaultContext
(
)
)
;
if
(
!Feature::
isActive
(
'v6.6.0.0'
)
)
{
static
::
expectException
(
UnknownRefundException::
class
)
;
}