From 703656bec2a991a7db6c460894569676b1a8c94e Mon Sep 17 00:00:00 2001 From: Alex P Date: Sat, 12 Mar 2022 22:06:38 +0200 Subject: [PATCH] Use full URL for return endpoint --- .../src/Repository/ApplicationContextRepository.php | 2 +- .../WcGateway/Repository/ApplicationContextRepositoryTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ppcp-api-client/src/Repository/ApplicationContextRepository.php b/modules/ppcp-api-client/src/Repository/ApplicationContextRepository.php index abd3dd3ba..08650d088 100644 --- a/modules/ppcp-api-client/src/Repository/ApplicationContextRepository.php +++ b/modules/ppcp-api-client/src/Repository/ApplicationContextRepository.php @@ -50,7 +50,7 @@ class ApplicationContextRepository { $landingpage = $this->settings->has( 'landing_page' ) ? $this->settings->get( 'landing_page' ) : ApplicationContext::LANDING_PAGE_NO_PREFERENCE; $context = new ApplicationContext( - \WC_AJAX::get_endpoint( ReturnUrlEndpoint::ENDPOINT ), + network_home_url( \WC_AJAX::get_endpoint( ReturnUrlEndpoint::ENDPOINT ) ), (string) wc_get_checkout_url(), (string) $brand_name, $locale, diff --git a/tests/PHPUnit/WcGateway/Repository/ApplicationContextRepositoryTest.php b/tests/PHPUnit/WcGateway/Repository/ApplicationContextRepositoryTest.php index 7b8d1800e..a7bc0dd87 100644 --- a/tests/PHPUnit/WcGateway/Repository/ApplicationContextRepositoryTest.php +++ b/tests/PHPUnit/WcGateway/Repository/ApplicationContextRepositoryTest.php @@ -36,7 +36,7 @@ class ApplicationContextRepositoryTest extends TestCase ->andReturn($value); } - expect('home_url') + expect('network_home_url') ->andReturn('https://example.com/'); expect('wc_get_checkout_url') ->andReturn('https://example.com/checkout/');