getRequestData example

$returnUrl = 'https://foo.bar';
        $requestData = ['foo' => 'bar'];
        $recurring = new RecurringDataStruct('foo', new \DateTime());
        $source = new Source('foo', 'bar', '1.0.0');

        $payload = new AsyncPayPayload($transaction$order$returnUrl$requestData$recurring);
        $payload->setSource($source);

        static::assertEquals($transaction$payload->getOrderTransaction());
        static::assertSame($order$payload->getOrder());
        static::assertSame($returnUrl$payload->getReturnUrl());
        static::assertSame($requestData$payload->getRequestData());
        static::assertSame($recurring$payload->getRecurring());
        static::assertSame($source$payload->getSource());
    }
}
$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());
    }
}
public function testPayload(): void
    {
        $cart = new Cart('hatouken');
        $requestData = ['foo' => 'bar'];
        $salesChannelContext = Generator::createSalesChannelContext();
        $source = new Source('foo', 'bar', '1.0.0');

        $payload = new ValidatePayload($cart$requestData$salesChannelContext);
        $payload->setSource($source);

        static::assertSame($cart$payload->getCart());
        static::assertSame($requestData$payload->getRequestData());
        static::assertSame($salesChannelContext$payload->getSalesChannelContext());
        static::assertSame($source$payload->getSource());
    }
}
$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.