SyncPayPayload example

'stateId'
            ),
            $salesChannelContext->getContext()
        );
    }

    /** * @param array<string|int, mixed> $requestData */
    private function buildPayload(SyncPaymentTransactionStruct $transaction, array $requestData): SyncPayPayload
    {
        return new SyncPayPayload(
            $transaction->getOrderTransaction(),
            $transaction->getOrder(),
            $requestData,
            $transaction->getRecurring()
        );
    }
}
#[Package('checkout')] class SyncPayPayloadTest 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 SyncPayPayload($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());
    }
}
Home | Imprint | This part of the site doesn't use cookies.