diff --git a/modules/ppcp-wc-gateway/src/Gateway/class-creditcardgateway.php b/modules/ppcp-wc-gateway/src/Gateway/class-creditcardgateway.php
index 9d8e735f6..9a0ecd293 100644
--- a/modules/ppcp-wc-gateway/src/Gateway/class-creditcardgateway.php
+++ b/modules/ppcp-wc-gateway/src/Gateway/class-creditcardgateway.php
@@ -80,11 +80,11 @@ class CreditCardGateway extends PayPalGateway {
}
$this->method_title = __(
- 'PayPal Credit Card Processing',
+ 'PayPal Card Processing',
'paypal-for-woocommerce'
);
$this->method_description = __(
- 'Provide your customers with the option to pay with credit card.',
+ 'Accept debit and credit cards, and local payment methods with PayPal’s latest solution.',
'paypal-for-woocommerce'
);
$this->title = $this->config->has( 'dcc_gateway_title' ) ?
diff --git a/modules/ppcp-wc-gateway/src/Settings/class-sectionsrenderer.php b/modules/ppcp-wc-gateway/src/Settings/class-sectionsrenderer.php
index b0c1e64b4..145e49042 100644
--- a/modules/ppcp-wc-gateway/src/Settings/class-sectionsrenderer.php
+++ b/modules/ppcp-wc-gateway/src/Settings/class-sectionsrenderer.php
@@ -9,6 +9,7 @@ declare( strict_types=1 );
namespace Inpsyde\PayPalCommerce\WcGateway\Settings;
+use Inpsyde\PayPalCommerce\WcGateway\Gateway\CreditCardGateway;
use Inpsyde\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
/**
@@ -38,10 +39,10 @@ class SectionsRenderer {
}
//phpcs:ignore WordPress.Security.NonceVerification.Recommended
- $current = ! isset( $_GET[ self::KEY ] ) ? 'paypal' : sanitize_text_field( wp_unslash( $_GET[ self::KEY ] ) );
+ $current = ! isset( $_GET[ self::KEY ] ) ? PayPalGateway::ID : sanitize_text_field( wp_unslash( $_GET[ self::KEY ] ) );
$sections = array(
- 'paypal' => __( 'PayPal', 'paypal-for-woocommerce' ),
- 'dcc' => __( 'Credit Card', 'paypal-for-woocommerce' ),
+ PayPalGateway::ID => __( 'PayPal', 'paypal-for-woocommerce' ),
+ CreditCardGateway::ID => __( 'Credit Card', 'paypal-for-woocommerce' ),
);
echo '
';
diff --git a/modules/ppcp-wc-gateway/src/Settings/class-settingslistener.php b/modules/ppcp-wc-gateway/src/Settings/class-settingslistener.php
index 09dc562cf..b86288077 100644
--- a/modules/ppcp-wc-gateway/src/Settings/class-settingslistener.php
+++ b/modules/ppcp-wc-gateway/src/Settings/class-settingslistener.php
@@ -119,11 +119,11 @@ class SettingsListener {
$raw_data = ( isset( $_POST['ppcp'] ) ) ? (array) wp_unslash( $_POST['ppcp'] ) : array();
// phpcs:enable phpcs:disable WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$settings = $this->retrieve_settings_from_raw_data( $raw_data );
- if ( isset( $_GET['section'] ) && PayPalGateway::ID === $_GET['section'] ) {
+ if ( ! isset( $_GET[SectionsRenderer::KEY] ) || PayPalGateway::ID === $_GET[SectionsRenderer::KEY] ) {
$settings['enabled'] = isset( $_POST['woocommerce_ppcp-gateway_enabled'] )
&& 1 === absint( $_POST['woocommerce_ppcp-gateway_enabled'] );
}
- if ( isset( $_GET['section'] ) && CreditCardGateway::ID === $_GET['section'] ) {
+ if ( isset( $_GET[SectionsRenderer::KEY] ) && CreditCardGateway::ID === $_GET[SectionsRenderer::KEY] ) {
$dcc_enabled_post_key = 'woocommerce_ppcp-credit-card-gateway_enabled';
$settings['dcc_gateway_enabled'] = isset( $_POST[ $dcc_enabled_post_key ] )
&& 1 === absint( $_POST[ $dcc_enabled_post_key ] );
diff --git a/modules/ppcp-wc-gateway/src/Settings/class-settingsrenderer.php b/modules/ppcp-wc-gateway/src/Settings/class-settingsrenderer.php
index fb0654a3c..c7f76e112 100644
--- a/modules/ppcp-wc-gateway/src/Settings/class-settingsrenderer.php
+++ b/modules/ppcp-wc-gateway/src/Settings/class-settingsrenderer.php
@@ -12,6 +12,7 @@ namespace Inpsyde\PayPalCommerce\WcGateway\Settings;
use Inpsyde\PayPalCommerce\ApiClient\Helper\DccApplies;
use Inpsyde\PayPalCommerce\Button\Helper\MessagesApply;
use Inpsyde\PayPalCommerce\Onboarding\State;
+use Inpsyde\PayPalCommerce\WcGateway\Gateway\CreditCardGateway;
use Psr\Container\ContainerInterface;
/**
@@ -213,7 +214,7 @@ class SettingsRenderer {
public function render() {
//phpcs:ignore WordPress.Security.NonceVerification.Recommended
- $is_dcc = isset( $_GET[ SectionsRenderer::KEY ] ) && 'dcc' === sanitize_text_field( wp_unslash( $_GET[ SectionsRenderer::KEY ] ) );
+ $is_dcc = isset( $_GET[ SectionsRenderer::KEY ] ) && CreditCardGateway::ID === sanitize_text_field( wp_unslash( $_GET[ SectionsRenderer::KEY ] ) );
$nonce = wp_create_nonce( SettingsListener::NONCE );
?>