getReturnUrl example


        $factory = new PaymentTransactionStructFactory();

        $transaction = new OrderTransactionEntity();
        $order = new OrderEntity();
        $returnUrl = 'https://return.url';

        $struct = $factory->async($transaction$order$returnUrl);

        static::assertSame($transaction$struct->getOrderTransaction());
        static::assertSame($order$struct->getOrder());
        static::assertSame($returnUrl$struct->getReturnUrl());
    }

    public function testPrepared(): void
    {
        $factory = new PaymentTransactionStructFactory();

        $transaction = new OrderTransactionEntity();
        $order = new OrderEntity();

        $struct = $factory->prepared($transaction$order);

        
$order = new OrderEntity();
        $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());
    }
}

    }

    /** * @param array<string|int, mixed> $requestData */
    private function buildPayPayload(AsyncPaymentTransactionStruct $transaction, array $requestData): AsyncPayPayload
    {
        return new AsyncPayPayload(
            $transaction->getOrderTransaction(),
            $transaction->getOrder(),
            $transaction->getReturnUrl(),
            $requestData,
            $transaction->getRecurring()
        );
    }

    /** * @param array<string|int, mixed> $queryParameters */
    private function buildFinalizePayload(AsyncPaymentTransactionStruct $transaction, array $queryParameters): AsyncFinalizePayload
    {
        return new AsyncFinalizePayload(
            
Home | Imprint | This part of the site doesn't use cookies.