rt_heading' => array( 'heading' => __( 'Pay Later on Cart', 'woocommerce-paypal-payments' ), 'type' => 'ppcp-heading', 'screens' => array( State::STATE_START, State::STATE_ONBOARDED, ), 'requirements' => array( 'messages' ), 'gateway' => 'paypal', 'description' => str_replace( '', '', __( 'Displays Pay Later messaging for available offers. Restrictions apply. Click here to learn more. Pay Later button will show for eligible buyers and PayPal determines eligibility.', 'woocommerce-paypal-payments' ) ), 'class' => array( 'ppcp-subheading' ), ), 'message_cart_enabled' => array( 'title' => __( 'Enable message on Cart', 'woocommerce-paypal-payments' ), 'type' => 'checkbox', 'label' => sprintf( $container->get( 'wcgateway.settings.fields.pay-later-label' ), __( 'Enable on Cart', 'woocommerce-paypal-payments' ) ), 'default' => true, 'screens' => array( State::STATE_START, State::STATE_ONBOARDED, ), 'requirements' => array( 'messages' ), 'gateway' => 'paypal', ), 'message_cart_layout' => array( 'title' => __( 'Pay Later Messaging layout', 'woocommerce-paypal-payments' ), 'type' => 'select', 'class' => array(), 'input_class' => array( 'wc-enhanced-select' ), 'default' => 'text', 'desc_tip' => true, 'description' => __( 'The layout of the message.', 'woocommerce-paypal-payments' ), 'options' => array( 'text' => __( 'Text', 'woocommerce-paypal-payments' ), 'flex' => __( 'Flex', 'woocommerce-paypal-payments' ), ), 'screens' => array( State::STATE_START, State::STATE_ONBOARDED, ), 'requirements' => array( 'messages' ), 'gateway' => 'paypal', ), 'message_cart_logo' => array( 'title' => __( 'Pay Later Messaging logo', 'woocommerce-paypal-payments' ), 'type' => 'select', 'class' => array(), 'input_class' => array( 'wc-enhanced-select' ), 'default' => 'primary', 'desc_tip' => true, 'description' => __( 'What logo the text message contains. Only applicable, when the layout style Text is used.', 'woocommerce-paypal-payments' ), 'options' => array( 'primary' => __( 'Primary', 'woocommerce-paypal-payments' ), 'alternative' => __( 'Alternative', 'woocommerce-paypal-payments' ), 'inline' => __( 'Inline', 'woocommerce-paypal-payments' ), 'none' => __( 'None', 'woocommerce-paypal-payments' ), ), 'screens' => array( State::STATE_START, State::STATE_ONBOARDED, ), 'requirements' => array( 'messages' ), 'gateway' => 'paypal', ), 'message_cart_position' => array( 'title' => __( 'Pay Later Messaging logo position', 'woocommerce-paypal-payments' ), 'type' => 'select', 'class' => array(), 'input_class' => array( 'wc-enhanced-select' ), 'default' => 'left', 'desc_tip' => true, 'description' => __( 'The position of the logo. Only applicable, when the layout style Text is used.', 'woocommerce-paypal-payments' ), 'options' => array( 'left' => __( 'Left', 'woocommerce-paypal-payments' ), 'right' => __( 'Right', 'woocommerce-paypal-payments' ), 'top' => __( 'Top', 'woocommerce-paypal-payments' ), ), 'screens' => array( State::STATE_START, State::STATE_ONBOARDED, ), 'requirements' => array( 'messages' ), 'gateway' => 'paypal', ), 'message_cart_color' => array( 'title' => __( 'Pay Later Messaging text color', 'woocommerce-paypal-payments' ), 'type' => 'select', 'class' => array(), 'input_class' => array( 'wc-enhanced-select' ), 'default' => 'black', 'desc_tip' => true, 'description' => __( 'The color of the text. Only applicable, when the layout style Text is used.', 'woocommerce-paypal-payments' ), 'options' => array( 'black' => __( 'Black', 'woocommerce-paypal-payments' ), 'white' => __( 'White', 'woocommerce-paypal-payments' ), 'monochrome' => __( 'Monochrome', 'woocommerce-paypal-payments' ), 'grayscale' => __( 'Grayscale', 'woocommerce-paypal-payments' ), ), 'screens' => array( State::STATE_START, State::STATE_ONBOARDED, ), 'requirements' => array( 'messages' ), 'gateway' => 'paypal', ), 'message_cart_flex_color' => array( 'title' => __( 'Pay Later Messaging color', 'woocommerce-paypal-payments' ), 'type' => 'select', 'class' => array(), 'input_class' => array( 'wc-enhanced-select' ), 'default' => 'blue', 'desc_tip' => true, 'description' => __( 'The color of the text. Only applicable, when the layout style Flex is used.', 'woocommerce-paypal-payments' ), 'options' => array( 'blue' => __( 'Blue', 'woocommerce-paypal-payments' ), 'black' => __( 'Black', 'woocommerce-paypal-payments' ), 'white' => __( 'White', 'woocommerce-paypal-payments' ), 'white-no-border' => __( 'White no border', 'woocommerce-paypal-payments' ), 'gray' => __( 'Gray', 'woocommerce-paypal-payments' ), 'monochrome' => __( 'Monochrome', 'woocommerce-paypal-payments' ), 'grayscale' => __( 'Grayscale', 'woocommerce-paypal-payments' ), ), 'screens' => array( State::STATE_START, State::STATE_ONBOARDED, ), 'requirements' => array( 'messages' ), 'gateway' => 'paypal', ), 'message_cart_flex_ratio' => array( 'title' => __( 'Pay Later Messaging ratio', 'woocommerce-paypal-payments' ), 'type' => 'select', 'class' => array(), 'input_class' => array( 'wc-enhanced-select' ), 'default' => '1x1', 'desc_tip' => true, 'description' => __( 'The width/height ratio of the banner. Only applicable, when the layout style Flex is used.', 'woocommerce-paypal-payments' ), 'options' => array( '1x1' => __( '1x1', 'woocommerce-paypal-payments' ), '1x4' => __( '1x4', 'woocommerce-paypal-payments' ), '8x1' => __( '8x1', 'woocommerce-paypal-payments' ), '20x1' => __( '20x1', 'woocommerce-paypal-payments' ), ), 'screens' => array( State::STATE_START, State::STATE_ONBOARDED, ), 'requirements' => array( 'messages' ), 'gateway' => 'paypal', ), // Mini cart settings. 'button_mini-cart_heading' => array( 'heading' => __( 'Mini Cart', 'woocommerce-paypal-payments' ), 'type' => 'ppcp-heading', 'screens' => array( State::STATE_START, State::STATE_ONBOARDED, ), 'requirements' => array(), 'gateway' => 'paypal', 'description' => __( 'Customize the appearance of PayPal Checkout on the Mini Cart.', 'woocommerce-paypal-payments' ), ), 'button_mini-cart_enabled' => array( 'title' => __( 'Buttons on Mini Cart', 'woocommerce-paypal-payments' ), 'type' => 'checkbox', 'label' => __( 'Enable on Mini Cart', 'woocommerce-paypal-payments' ), 'default' => true, 'screens' => array( State::STATE_START, State::STATE_ONBOARDED, ), 'requirements' => array(), 'gateway' => 'paypal', ), 'button_mini-cart_layout' => array( 'title' => __( 'Button Layout', 'woocommerce-paypal-payments' ), 'type' => 'select', 'class' => array(), 'input_class' => array( 'wc-enhanced-select' ), 'default' => 'vertical', 'desc_tip' => true, 'description' => __( 'If additional funding sources are available to the buyer through PayPal, such as Venmo, then multiple buttons are displayed in the space provided. Choose "vertical" for a dynamic list of alternative and local payment options, or "horizontal" when space is limited.', 'woocommerce-paypal-payments' ), 'options' => array( 'vertical' => __( 'Vertical', 'woocommerce-paypal-payments' ), 'horizontal' => __( 'Horizontal', 'woocommerce-paypal-payments' ), ), 'screens' => array( State::STATE_START, State::STATE_ONBOARDED, ), 'requirements' => array(), 'gateway' => 'paypal', ), 'button_mini-cart_tagline' => array( 'title' => __( 'Tagline', 'woocommerce-paypal-payments' ), 'type' => 'checkbox', 'label' => __( 'Enable tagline', 'woocommerce-paypal-payments' ), 'default' => false, 'desc_tip' => true, 'description' => __( 'Add the tagline. This line will only show up, if you select a horizontal layout.', 'woocommerce-paypal-payments' ), 'screens' => array( State::STATE_START, State::STATE_ONBOARDED, ), 'requirements' => array(), 'gateway' => 'paypal', ), 'button_mini-cart_label' => array( 'title' => __( 'Button Label', 'woocommerce-paypal-payments' ), 'type' => 'select', 'class' => array(), 'input_class' => array( 'wc-enhanced-select' ), /** * Returns default label ID of the PayPal button in mini cart. */ 'default' => apply_filters( 'woocommerce_paypal_payments_button_mini_cart_label_default', 'paypal' ), 'desc_tip' => true, 'description' => __( 'This controls the label on the primary button.', 'woocommerce-paypal-payments' ), 'options' => array( 'paypal' => __( 'PayPal', 'woocommerce-paypal-payments' ), 'checkout' => __( 'PayPal Checkout', 'woocommerce-paypal-payments' ), 'buynow' => __( 'PayPal Buy Now', 'woocommerce-paypal-payments' ), 'pay' => __( 'Pay with PayPal', 'woocommerce-paypal-payments' ), ), 'screens' => array( State::STATE_START, State::STATE_ONBOARDED, ), 'requirements' => array(), 'gateway' => 'paypal', ), 'button_mini-cart_color' => array( 'title' => __( 'Color', 'woocommerce-paypal-payments' ), 'type' => 'select', 'class' => array(), 'input_class' => array( 'wc-enhanced-select' ), 'default' => 'gold', 'desc_tip' => true, 'description' => __( 'Controls the background color of the primary button. Use "Gold" to leverage PayPal\'s recognition and preference, or change it to match your site design or aesthetic.', 'woocommerce-paypal-payments' ), 'options' => array( 'gold' => __( 'Gold (Recommended)', 'woocommerce-paypal-payments' ), 'blue' => __( 'Blue', 'woocommerce-paypal-payments' ), 'silver' => __( 'Silver', 'woocommerce-paypal-payments' ), 'black' => __( 'Black', 'woocommerce-paypal-payments' ), ), 'screens' => array( State::STATE_START, State::STATE_ONBOARDED, ), 'requirements' => array(), 'gateway' => 'paypal', ), 'button_mini-cart_shape' => array( 'title' => __( 'Shape', 'woocommerce-paypal-payments' ), 'type' => 'select', 'class' => array(), 'input_class' => array( 'wc-enhanced-select' ), 'default' => 'rect', 'desc_tip' => true, 'description' => __( 'The pill-shaped button\'s unique and powerful shape signifies PayPal in people\'s minds. Use the rectangular button as an alternative when pill-shaped buttons might pose design challenges.', 'woocommerce-paypal-payments' ), 'options' => array( 'pill' => __( 'Pill', 'woocommerce-paypal-payments' ), 'rect' => __( 'Rectangle', 'woocommerce-paypal-payments' ), ), 'screens' => array( State::STATE_START, State::STATE_ONBOARDED, ), 'requirements' => array(), 'gateway' => 'paypal', ), 'button_mini-cart_height' => array( 'title' => __( 'Button Height', 'woocommerce-paypal-payments' ), 'type' => 'number', 'default' => '35', 'desc_tip' => true, 'description' => __( 'Add a value from 25 to 55.', 'woocommerce-paypal-payments' ), 'screens' => array( State::STATE_START, State::STATE_ONBOARDED, ), 'requirements' => array(), 'gateway' => 'paypal', ), 'disable_cards' => array( 'title' => __( 'Disable specific credit cards', 'woocommerce-paypal-payments' ), 'type' => 'ppcp-multiselect', 'class' => array(), 'input_class' => array( 'wc-enhanced-select' ), 'default' => array(), 'desc_tip' => true, 'description' => __( 'By default all possible credit cards will be accepted. You can disable some cards, if you wish.', 'woocommerce-paypal-payments' ), 'options' => array( 'visa' => _x( 'Visa', 'Name of credit card', 'woocommerce-paypal-payments' ), 'mastercard' => _x( 'Mastercard', 'Name of credit card', 'woocommerce-paypal-payments' ), 'amex' => _x( 'American Express', 'Name of credit card', 'woocommerce-paypal-payments' ), 'discover' => _x( 'Discover', 'Name of credit card', 'woocommerce-paypal-payments' ), 'jcb' => _x( 'JCB', 'Name of credit card', 'woocommerce-paypal-payments' ), 'elo' => _x( 'Elo', 'Name of credit card', 'woocommerce-paypal-payments' ), 'hiper' => _x( 'Hiper', 'Name of credit card', 'woocommerce-paypal-payments' ), ), 'screens' => array( State::STATE_ONBOARDED, ), 'requirements' => array( 'dcc', ), 'gateway' => 'dcc', ), 'card_icons' => array( 'title' => __( 'Show logo of the following credit cards', 'woocommerce-paypal-payments' ), 'type' => 'ppcp-multiselect', 'class' => array(), 'input_class' => array( 'wc-enhanced-select' ), 'default' => array(), 'desc_tip' => true, 'description' => __( 'Define which cards you want to display in your checkout.', 'woocommerce-paypal-payments' ), 'options' => array( 'visa' => _x( 'Visa (light)', 'Name of credit card', 'woocommerce-paypal-payments' ), 'visa-dark' => _x( 'Visa (dark)', 'Name of credit card', 'woocommerce-paypal-payments' ), 'mastercard' => _x( 'Mastercard (light)', 'Name of credit card', 'woocommerce-paypal-payments' ), 'mastercard-dark' => _x( 'Mastercard (dark)', 'Name of credit card', 'woocommerce-paypal-payments' ), 'amex' => _x( 'American Express', 'Name of credit card', 'woocommerce-paypal-payments' ), 'discover' => _x( 'Discover', 'Name of credit card', 'woocommerce-paypal-payments' ), 'jcb' => _x( 'JCB', 'Name of credit card', 'woocommerce-paypal-payments' ), 'elo' => _x( 'Elo', 'Name of credit card', 'woocommerce-paypal-payments' ), 'hiper' => _x( 'Hiper', 'Name of credit card', 'woocommerce-paypal-payments' ), ), 'screens' => array( State::STATE_ONBOARDED, ), 'requirements' => array( 'dcc', ), 'gateway' => 'dcc', ), '3d_secure_heading' => array( 'heading' => __( '3D Secure', 'woocommerce-paypal-payments' ), 'type' => 'ppcp-heading', 'description' => wp_kses_post( sprintf( // translators: %1$s and %2$s is a link tag. __( '3D Secure benefits cardholders and merchants by providing an additional layer of verification using Verified by Visa, MasterCard SecureCode and American Express SafeKey. %1$sLearn more about 3D Secure.%2$s', 'woocommerce-paypal-payments' ), '', '' ) ), 'screens' => array( State::STATE_ONBOARDED, ), 'requirements' => array( 'dcc', ), 'gateway' => 'dcc', ), '3d_secure_contingency' => array( 'title' => __( 'Contingency for 3D Secure', 'woocommerce-paypal-payments' ), 'type' => 'select', 'description' => sprintf( // translators: %1$s and %2$s opening and closing ul tag, %3$s and %4$s opening and closing li tag. __( '%1$s%3$sNo 3D Secure will cause transactions to be denied if 3D Secure is required by the bank of the cardholder.%4$s%3$sSCA_WHEN_REQUIRED returns a 3D Secure contingency when it is a mandate in the region where you operate.%4$s%3$sSCA_ALWAYS triggers 3D Secure for every transaction, regardless of SCA requirements.%4$s%2$s', 'woocommerce-paypal-payments' ), '
'; $vaulting_label .= __( 'This will disable all Pay Later messaging on your site.', 'woocommerce-paypal-payments' ); $vaulting_label .= '
'; return $vaulting_label; }, 'wcgateway.settings.fields.pay-later-label' => static function ( ContainerInterface $container ): string { $pay_later_label = '%s'; $pay_later_label .= ''; $pay_later_label .= __( "You have PayPal vaulting enabled, that's why Pay Later Messaging options are unavailable now. You cannot use both features at the same time.", 'woocommerce-paypal-payments' ); $pay_later_label .= ''; return $pay_later_label; }, 'wcgateway.settings.card_billing_data_mode.default' => static function ( ContainerInterface $container ): string { return $container->get( 'api.shop.is-latin-america' ) ? CardBillingMode::MINIMAL_INPUT : CardBillingMode::USE_WC; }, 'wcgateway.settings.card_billing_data_mode' => static function ( ContainerInterface $container ): string { $settings = $container->get( 'wcgateway.settings' ); assert( $settings instanceof ContainerInterface ); return $settings->has( 'card_billing_data_mode' ) ? (string) $settings->get( 'card_billing_data_mode' ) : $container->get( 'wcgateway.settings.card_billing_data_mode.default' ); }, 'wcgateway.settings.allow_card_button_gateway.default' => static function ( ContainerInterface $container ): bool { return $container->get( 'api.shop.is-latin-america' ); }, 'wcgateway.settings.allow_card_button_gateway' => static function ( ContainerInterface $container ): bool { if ( defined( 'PPCP_FLAG_SEPARATE_APM_BUTTONS' ) && PPCP_FLAG_SEPARATE_APM_BUTTONS === false ) { return false; } $settings = $container->get( 'wcgateway.settings' ); assert( $settings instanceof ContainerInterface ); return $settings->has( 'allow_card_button_gateway' ) ? (bool) $settings->get( 'allow_card_button_gateway' ) : $container->get( 'wcgateway.settings.allow_card_button_gateway.default' ); }, 'order-tracking.is-tracking-available' => static function ( ContainerInterface $container ): bool { try { $bearer = $container->get( 'api.bearer' ); assert( $bearer instanceof Bearer ); $token = $bearer->bearer(); return $token->is_tracking_available(); } catch ( RuntimeException $exception ) { return false; } }, 'wcgateway.settings.should-disable-tracking-checkbox' => static function ( ContainerInterface $container ): bool { $pui_helper = $container->get( 'wcgateway.pay-upon-invoice-helper' ); assert( $pui_helper instanceof PayUponInvoiceHelper ); $is_tracking_available = $container->get( 'order-tracking.is-tracking-available' ); if ( ! $is_tracking_available ) { return true; } if ( $pui_helper->is_pui_enabled() ) { return true; } return false; }, 'wcgateway.settings.tracking-label' => static function ( ContainerInterface $container ): string { $tracking_label = __( 'Enable tracking information feature on your store.', 'woocommerce-paypal-payments' ); $is_tracking_available = $container->get( 'order-tracking.is-tracking-available' ); if ( $is_tracking_available ) { return $tracking_label; } $tracking_label .= sprintf( // translators: %1$s and %2$s are the opening and closing of HTML tag. __( ' To use tracking features, you must %1$senable tracking on your account%2$s.', 'woocommerce-paypal-payments' ), '', '' ); return $tracking_label; }, );