diff --git a/modules/ppcp-api-client/src/Repository/PartnerReferralsData.php b/modules/ppcp-api-client/src/Repository/PartnerReferralsData.php index fd93e57be..af8bae174 100644 --- a/modules/ppcp-api-client/src/Repository/PartnerReferralsData.php +++ b/modules/ppcp-api-client/src/Repository/PartnerReferralsData.php @@ -136,9 +136,8 @@ class PartnerReferralsData { * @return array */ public function append_onboarding_token( array $data, string $token ): array { - $separator = strpos( $data['partner_config_override']['return_url'], '?' ) === false ? '?' : '&'; - - $data['partner_config_override']['return_url'] .= $separator . 'ppcpToken=' . $token; + $data['partner_config_override']['return_url'] = + add_query_arg( 'ppcpToken', $token, $data['partner_config_override']['return_url'] ); return $data; } } diff --git a/modules/ppcp-onboarding/src/Exception/RuntimeException.php b/modules/ppcp-onboarding/src/Exception/RuntimeException.php deleted file mode 100644 index fc14fc94f..000000000 --- a/modules/ppcp-onboarding/src/Exception/RuntimeException.php +++ /dev/null @@ -1,18 +0,0 @@ -is_valid_site_request() ) { return; } diff --git a/tests/PHPUnit/Onboarding/Helper/OnboardingUrlTest.php b/tests/PHPUnit/Onboarding/Helper/OnboardingUrlTest.php index 63b495792..5dadd2c79 100644 --- a/tests/PHPUnit/Onboarding/Helper/OnboardingUrlTest.php +++ b/tests/PHPUnit/Onboarding/Helper/OnboardingUrlTest.php @@ -5,7 +5,7 @@ namespace WooCommerce\PayPalCommerce\Onboarding\Helper; use PHPUnit\Framework\TestCase; use WooCommerce\PayPalCommerce\ApiClient\Helper\Cache; -use WooCommerce\PayPalCommerce\Onboarding\Exception\RuntimeException; +use RuntimeException; use function Brain\Monkey\Functions\when; class OnboardingUrlTest extends TestCase