getRefundUrl example


        $manifest = Manifest::createFromXmlFile(__DIR__ . '/../_fixtures/test/manifest.xml');

        static::assertNotNull($manifest->getPayments());
        static::assertCount(2, $manifest->getPayments()->getPaymentMethods());

        $firstWebhook = $manifest->getPayments()->getPaymentMethods()[0];
        static::assertNotNull($firstWebhook);
        static::assertSame('myMethod', $firstWebhook->getIdentifier());
        static::assertSame('https://payment.app/payment/process', $firstWebhook->getPayUrl());
        static::assertSame('https://payment.app/payment/finalize', $firstWebhook->getFinalizeUrl());
        static::assertSame('https://payment.app/payment/refund', $firstWebhook->getRefundUrl());
        static::assertSame('https://payment.app/payment/recurring', $firstWebhook->getRecurringUrl());
        static::assertSame('Resources/payment.png', $firstWebhook->getIcon());
        static::assertSame([
            'en-GB' => 'The app payment method',
            'de-DE' => 'Die App Zahlungsmethode',
        ]$firstWebhook->getName());
        static::assertSame([
            'en-GB' => 'This is a description',
            'de-DE' => 'Die Zahlungsmethoden-Beschreibung',
        ]$firstWebhook->getDescription());

        

        $manifest = Manifest::createFromXmlFile(__DIR__ . '/../_fixtures/test-manifest.xml');

        static::assertNotNull($manifest->getPayments());
        static::assertCount(2, $manifest->getPayments()->getPaymentMethods());

        $firstWebhook = $manifest->getPayments()->getPaymentMethods()[0];
        static::assertNotNull($firstWebhook);
        static::assertSame('myMethod', $firstWebhook->getIdentifier());
        static::assertSame('https://payment.app/payment/process', $firstWebhook->getPayUrl());
        static::assertSame('https://payment.app/payment/finalize', $firstWebhook->getFinalizeUrl());
        static::assertSame('https://payment.app/payment/refund', $firstWebhook->getRefundUrl());
        static::assertSame('https://payment.app/payment/recurring', $firstWebhook->getRecurringUrl());
        static::assertSame('Resources/payment.png', $firstWebhook->getIcon());
        static::assertSame([
            'en-GB' => 'The app payment method',
            'de-DE' => 'Die App Zahlungsmethode',
        ]$firstWebhook->getName());
        static::assertSame([
            'en-GB' => 'This is a description',
            'de-DE' => 'Die Zahlungsmethoden-Beschreibung',
        ]$firstWebhook->getDescription());

        


        if (!$refund->getTransactionCapture()
            || !$refund->getTransactionCapture()->getTransaction()
            || !$refund->getTransactionCapture()->getTransaction()->getOrder()
        ) {
            return;
        }

        $transaction = $refund->getTransactionCapture()->getTransaction();
        $paymentMethod = $this->getAppPaymentMethod($transaction);
        $refundUrl = $paymentMethod->getRefundUrl();

        if (!$refundUrl) {
            return;
        }

        $app = $paymentMethod->getApp();

        if (!$app) {
            throw PaymentException::refundInterrupted($refund->getId(), 'App not defined');
        }

        
Home | Imprint | This part of the site doesn't use cookies.