mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Refactor WooCommerce\PayPalCommerce\Onboarding\Exception\RuntimeException to \RuntimeException
Refactor to use add_query_arg in append_onboarding_token
This commit is contained in:
parent
96eae6c690
commit
35fbe42733
5 changed files with 5 additions and 24 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* The modules Runtime Exception.
|
||||
*
|
||||
* @package WooCommerce\PayPalCommerce\Onboarding\Exception
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace WooCommerce\PayPalCommerce\Onboarding\Exception;
|
||||
|
||||
/**
|
||||
* Class RuntimeException
|
||||
*/
|
||||
class RuntimeException extends \RuntimeException {
|
||||
|
||||
|
||||
}
|
|
@ -10,7 +10,7 @@ declare(strict_types=1);
|
|||
namespace WooCommerce\PayPalCommerce\Onboarding\Helper;
|
||||
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Helper\Cache;
|
||||
use WooCommerce\PayPalCommerce\Onboarding\Exception\RuntimeException;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* Class OnboardingUrl
|
||||
|
|
|
@ -170,7 +170,7 @@ class SettingsListener {
|
|||
/**
|
||||
* Listens if the merchant ID should be updated.
|
||||
*/
|
||||
public function listen_for_merchant_id() {
|
||||
public function listen_for_merchant_id(): void {
|
||||
if ( ! $this->is_valid_site_request() ) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue