mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
do not show general enable checkbox on credit card
This commit is contained in:
parent
2eea01effe
commit
f9e64abe14
1 changed files with 12 additions and 3 deletions
|
@ -161,6 +161,9 @@ class PayPalGateway extends \WC_Payment_Gateway {
|
|||
'type' => 'ppcp',
|
||||
),
|
||||
);
|
||||
if ( $this->is_credit_card_tab() ) {
|
||||
unset( $this->form_fields['enabled'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -298,14 +301,13 @@ class PayPalGateway extends \WC_Payment_Gateway {
|
|||
return $content;
|
||||
}
|
||||
|
||||
// phpcs:disable WordPress.Security.NonceVerification.Recommended
|
||||
/**
|
||||
* Defines the method title. If we are on the credit card tab in the settings, we want to change this.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function define_method_title(): string {
|
||||
if ( is_admin() && isset( $_GET[ SectionsRenderer::KEY ] ) && CreditCardGateway::ID === sanitize_text_field( wp_unslash( $_GET[ SectionsRenderer::KEY ] ) ) ) {
|
||||
if ( $this->is_credit_card_tab() ) {
|
||||
return __( 'PayPal Card Processing', 'paypal-for-woocommerce' );
|
||||
}
|
||||
return __( 'PayPal Checkout', 'paypal-for-woocommerce' );
|
||||
|
@ -317,7 +319,7 @@ class PayPalGateway extends \WC_Payment_Gateway {
|
|||
* @return string
|
||||
*/
|
||||
private function define_method_description(): string {
|
||||
if ( is_admin() && isset( $_GET[ SectionsRenderer::KEY ] ) && CreditCardGateway::ID === sanitize_text_field( wp_unslash( $_GET[ SectionsRenderer::KEY ] ) ) ) {
|
||||
if ( $this->is_credit_card_tab() ) {
|
||||
return __(
|
||||
'Accept debit and credit cards, and local payment methods with PayPal’s latest solution.',
|
||||
'paypal-for-woocommerce'
|
||||
|
@ -329,5 +331,12 @@ class PayPalGateway extends \WC_Payment_Gateway {
|
|||
'paypal-for-woocommerce'
|
||||
);
|
||||
}
|
||||
|
||||
// phpcs:disable WordPress.Security.NonceVerification.Recommended
|
||||
private function is_credit_card_tab() : bool
|
||||
{
|
||||
return is_admin() && isset( $_GET[ SectionsRenderer::KEY ] ) && CreditCardGateway::ID === sanitize_text_field( wp_unslash( $_GET[ SectionsRenderer::KEY ] ) );
|
||||
|
||||
}
|
||||
// phpcs:enable WordPress.Security.NonceVerification.Recommended
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue