Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
RecurringPayPayload example
#[Package('checkout')]
class
RecurringPayPayloadTest
extends
TestCase
{
public
function
testPayload
(
)
: void
{
$transaction
=
new
OrderTransactionEntity
(
)
;
$order
=
new
OrderEntity
(
)
;
$requestData
=
[
'foo' => 'bar'
]
;
$recurring
=
new
RecurringDataStruct
(
'foo',
new
\
DateTime
(
)
)
;
$source
=
new
Source
(
'foo', 'bar', '1.0.0'
)
;
$payload
=
new
RecurringPayPayload
(
$transaction
,
$order
,
$requestData
,
$recurring
)
;
$payload
->
setSource
(
$source
)
;
static
::
assertEquals
(
$transaction
,
$payload
->
getOrderTransaction
(
)
)
;
static
::
assertSame
(
$order
,
$payload
->
getOrder
(
)
)
;
static
::
assertSame
(
$requestData
,
$payload
->
getRequestData
(
)
)
;
static
::
assertSame
(
$recurring
,
$payload
->
getRecurring
(
)
)
;
static
::
assertSame
(
$source
,
$payload
->
getSource
(
)
)
;
}
}
return
new
CapturePayload
(
$transaction
->
getOrderTransaction
(
)
,
$transaction
->
getOrder
(
)
,
$preOrderPaymentStruct
,
$transaction
->
getRecurring
(
)
)
;
}
protected
function
buildRecurringPayload
(
RecurringPaymentTransactionStruct
$transaction
)
: RecurringPayPayload
{
return
new
RecurringPayPayload
(
$transaction
->
getOrderTransaction
(
)
,
$transaction
->
getOrder
(
)
,
[
]
,
$transaction
->
getRecurring
(
)
)
;
}
}