woocommerce-paypal-payments/modules/ppcp-wc-gateway/services.php

1615 lines
64 KiB
PHP
Raw Normal View History

2020-04-02 08:38:00 +03:00
<?php
2020-08-28 08:13:45 +03:00
/**
* The services of the Gateway module.
*
* @package Inpsyde\PayPalCommerce\WcGateway
*/
2020-04-02 08:38:00 +03:00
declare(strict_types=1);
namespace Inpsyde\PayPalCommerce\WcGateway;
use Dhii\Data\Container\ContainerInterface;
2020-07-13 08:24:56 +03:00
use Inpsyde\PayPalCommerce\ApiClient\Entity\ApplicationContext;
2020-06-15 11:48:37 +03:00
use Inpsyde\PayPalCommerce\Onboarding\State;
2020-04-23 11:19:09 +03:00
use Inpsyde\PayPalCommerce\WcGateway\Admin\OrderTablePaymentStatusColumn;
use Inpsyde\PayPalCommerce\WcGateway\Admin\PaymentStatusOrderDetail;
use Inpsyde\PayPalCommerce\WcGateway\Checkout\CheckoutPayPalAddressPreset;
2020-04-02 08:38:00 +03:00
use Inpsyde\PayPalCommerce\WcGateway\Checkout\DisableGateways;
use Inpsyde\PayPalCommerce\WcGateway\Endpoint\ReturnUrlEndpoint;
2020-08-18 09:04:58 +03:00
use Inpsyde\PayPalCommerce\WcGateway\Gateway\CreditCardGateway;
2020-08-18 08:46:18 +03:00
use Inpsyde\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
2020-04-13 22:30:57 +03:00
use Inpsyde\PayPalCommerce\WcGateway\Notice\AuthorizeOrderActionNotice;
use Inpsyde\PayPalCommerce\WcGateway\Notice\ConnectAdminNotice;
use Inpsyde\PayPalCommerce\WcGateway\Processor\AuthorizedPaymentsProcessor;
2020-04-28 13:32:48 +03:00
use Inpsyde\PayPalCommerce\WcGateway\Processor\OrderProcessor;
2020-09-02 09:56:04 +03:00
use Inpsyde\PayPalCommerce\WcGateway\Settings\SectionsRenderer;
2020-04-09 14:02:35 +03:00
use Inpsyde\PayPalCommerce\WcGateway\Settings\Settings;
use Inpsyde\PayPalCommerce\WcGateway\Settings\SettingsListener;
use Inpsyde\PayPalCommerce\WcGateway\Settings\SettingsRenderer;
2020-07-09 09:18:16 +03:00
use WpOop\TransientCache\CachePoolFactory;
2020-04-02 08:38:00 +03:00
2020-08-28 08:13:45 +03:00
return array(
'wcgateway.paypal-gateway' => static function ( ContainerInterface $container ): PayPalGateway {
$order_processor = $container->get( 'wcgateway.order-processor' );
$settings_renderer = $container->get( 'wcgateway.settings.render' );
$authorized_payments = $container->get( 'wcgateway.processor.authorized-payments' );
$notice = $container->get( 'wcgateway.notice.authorize-order-action' );
$settings = $container->get( 'wcgateway.settings' );
$session_handler = $container->get( 'session.handler' );
2020-06-30 08:35:28 +03:00
2020-08-28 08:13:45 +03:00
return new PayPalGateway(
$settings_renderer,
$order_processor,
$authorized_payments,
$notice,
$settings,
$session_handler
);
},
'wcgateway.credit-card-gateway' => static function ( ContainerInterface $container ): CreditCardGateway {
$order_processor = $container->get( 'wcgateway.order-processor' );
$settings_renderer = $container->get( 'wcgateway.settings.render' );
$authorized_payments = $container->get( 'wcgateway.processor.authorized-payments' );
2020-08-31 09:13:24 +03:00
$notice = $container->get( 'wcgateway.notice.authorize-order-action' );
$settings = $container->get( 'wcgateway.settings' );
$module_url = $container->get( 'wcgateway.url' );
2020-08-28 08:13:45 +03:00
$session_handler = $container->get( 'session.handler' );
return new CreditCardGateway(
$settings_renderer,
$order_processor,
$authorized_payments,
$notice,
$settings,
2020-08-31 09:13:24 +03:00
$module_url,
2020-08-28 08:13:45 +03:00
$session_handler
);
},
'wcgateway.disabler' => static function ( ContainerInterface $container ): DisableGateways {
$session_handler = $container->get( 'session.handler' );
$settings = $container->get( 'wcgateway.settings' );
return new DisableGateways( $session_handler, $settings );
},
'wcgateway.settings' => static function ( ContainerInterface $container ): Settings {
return new Settings();
},
'wcgateway.notice.connect' => static function ( ContainerInterface $container ): ConnectAdminNotice {
$state = $container->get( 'onboarding.state' );
$settings = $container->get( 'wcgateway.settings' );
return new ConnectAdminNotice( $state, $settings );
},
'wcgateway.notice.authorize-order-action' =>
static function ( ContainerInterface $container ): AuthorizeOrderActionNotice {
return new AuthorizeOrderActionNotice();
},
2020-09-02 09:56:04 +03:00
'wcgateway.settings.sections-renderer' => static function ( ContainerInterface $container ): SectionsRenderer {
return new SectionsRenderer();
},
2020-08-28 08:13:45 +03:00
'wcgateway.settings.render' => static function ( ContainerInterface $container ): SettingsRenderer {
$settings = $container->get( 'wcgateway.settings' );
$state = $container->get( 'onboarding.state' );
$fields = $container->get( 'wcgateway.settings.fields' );
$dcc_applies = $container->get( 'api.helpers.dccapplies' );
$messages_apply = $container->get( 'button.helper.messages-apply' );
return new SettingsRenderer(
$settings,
$state,
$fields,
$dcc_applies,
$messages_apply
);
},
'wcgateway.settings.listener' => static function ( ContainerInterface $container ): SettingsListener {
$settings = $container->get( 'wcgateway.settings' );
$fields = $container->get( 'wcgateway.settings.fields' );
$webhook_registrar = $container->get( 'webhook.registrar' );
$state = $container->get( 'onboarding.state' );
2020-07-09 09:10:35 +03:00
2020-08-28 08:13:45 +03:00
global $wpdb;
$cache_pool_factory = new CachePoolFactory( $wpdb );
$pool = $cache_pool_factory->createCachePool( 'ppcp-token' );
return new SettingsListener( $settings, $fields, $webhook_registrar, $pool, $state );
},
'wcgateway.order-processor' => static function ( ContainerInterface $container ): OrderProcessor {
2020-04-28 13:32:48 +03:00
2020-08-28 08:13:45 +03:00
$session_handler = $container->get( 'session.handler' );
$cart_repository = $container->get( 'api.repository.cart' );
$order_endpoint = $container->get( 'api.endpoint.order' );
$payments_endpoint = $container->get( 'api.endpoint.payments' );
$order_factory = $container->get( 'api.factory.order' );
$threed_secure = $container->get( 'button.helper.three-d-secure' );
$authorized_payments_processor = $container->get( 'wcgateway.processor.authorized-payments' );
$settings = $container->get( 'wcgateway.settings' );
return new OrderProcessor(
$session_handler,
$cart_repository,
$order_endpoint,
$payments_endpoint,
$order_factory,
$threed_secure,
$authorized_payments_processor,
$settings
);
},
'wcgateway.processor.authorized-payments' => static function ( ContainerInterface $container ): AuthorizedPaymentsProcessor {
$order_endpoint = $container->get( 'api.endpoint.order' );
$payments_endpoint = $container->get( 'api.endpoint.payments' );
return new AuthorizedPaymentsProcessor( $order_endpoint, $payments_endpoint );
},
'wcgateway.admin.order-payment-status' => static function ( ContainerInterface $container ): PaymentStatusOrderDetail {
return new PaymentStatusOrderDetail();
},
'wcgateway.admin.orders-payment-status-column' => static function ( ContainerInterface $container ): OrderTablePaymentStatusColumn {
$settings = $container->get( 'wcgateway.settings' );
return new OrderTablePaymentStatusColumn( $settings );
},
2020-08-28 08:13:45 +03:00
'wcgateway.settings.fields' => static function ( ContainerInterface $container ): array {
$settings = $container->get( 'wcgateway.settings' );
$sandbox_text = $settings->has( 'sandbox_on' ) && $settings->get( 'sandbox_on' ) ?
2020-08-31 09:13:24 +03:00
// translators: %1$s and %2$s are button tags.
2020-08-28 08:13:45 +03:00
__(
2020-08-31 09:13:24 +03:00
'You are currently in the sandbox mode to test your installation. You can switch this, by clicking %1$sReset%2$s',
'paypal-payments-for-woocommerce'
2020-08-31 09:13:24 +03:00
) :
// translators: %1$s and %2$s are button tags.
__(
'You are in live mode. This means, you can receive money into your account. You can switch this, by clicking %1$sReset%2$s',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
);
$sandbox_text = sprintf(
$sandbox_text,
2020-08-31 09:13:24 +03:00
'<button name="save" value="reset">',
'</button>'
2020-08-28 08:13:45 +03:00
);
2020-08-28 08:13:45 +03:00
$merchant_email_text = sprintf(
2020-08-31 09:13:24 +03:00
// translators: %1$s is the email address %2$s and %3$s are button tags.
2020-08-28 08:13:45 +03:00
__(
2020-08-31 09:13:24 +03:00
'You are connected with your email address %1$s.
If you want to change this settings, please click %2$sReset%3$s',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
2020-09-01 14:07:56 +03:00
$settings->has( 'merchant_email' ) ? '<mark>' . $settings->get( 'merchant_email' ) . '</mark>' : '',
2020-08-31 09:13:24 +03:00
'<button name="save" value="reset">',
'</button>'
2020-08-28 08:13:45 +03:00
);
$fields = array(
'ppcp_onboarding' => array(
'title' => __( 'Connect to PayPal', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'ppcp_onboarding',
'screens' => array(
State::STATE_PROGRESSIVE,
),
'requirements' => array(),
'gateway' => 'paypal',
2020-08-28 08:13:45 +03:00
),
'sandbox_on' => array(
'title' => __( 'Sandbox', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'checkbox',
'label' => __( 'To test your WooCommerce installation, you can use the sandbox mode.', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'default' => 0,
'screens' => array(
State::STATE_START,
),
'requirements' => array(),
'gateway' => 'paypal',
2020-08-28 08:13:45 +03:00
),
'sandbox_on_info' => array(
'title' => __( 'Sandbox', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'ppcp-text',
'text' => $sandbox_text,
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'hidden' => 'sandbox_on',
'requirements' => array(),
'gateway' => 'paypal',
2020-08-28 08:13:45 +03:00
),
'merchant_email' => array(
'title' => __( 'Email address', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'text',
'required' => true,
'desc_tip' => true,
'description' => __( 'The email address of your PayPal account.', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'default' => '',
'screens' => array(
State::STATE_START,
),
'requirements' => array(),
'gateway' => 'paypal',
2020-08-28 08:13:45 +03:00
),
'merchant_email_info' => array(
'title' => __( 'Email address', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'ppcp-text',
'text' => $merchant_email_text,
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'hidden' => 'merchant_email',
'requirements' => array(),
'gateway' => 'paypal',
2020-08-28 08:13:45 +03:00
),
'toggle_manual_input' => array(
'type' => 'ppcp-text',
'title' => __( 'Manual mode', 'paypal-payments-for-woocommerce' ),
'text' => '<button id="ppcp[toggle_manual_input]">' . __( 'Toggle to manual credential input', 'paypal-payments-for-woocommerce' ) . '</button>',
2020-08-28 08:13:45 +03:00
'screens' => array(
State::STATE_START,
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
2020-08-28 08:13:45 +03:00
),
'client_id' => array(
'title' => __( 'Client Id', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'ppcp-text-input',
'desc_tip' => true,
'description' => __( 'The client id of your api ', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'default' => false,
'screens' => array(
State::STATE_START,
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
2020-08-28 08:13:45 +03:00
),
'client_secret' => array(
'title' => __( 'Secret Key', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'ppcp-password',
'desc_tip' => true,
'description' => __( 'The secret key of your api', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'default' => false,
'screens' => array(
State::STATE_START,
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
2020-08-28 08:13:45 +03:00
),
'title' => array(
'title' => __( 'Title', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'text',
'description' => __(
'This controls the title which the user sees during checkout.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'default' => __( 'PayPal', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'desc_tip' => true,
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'dcc_enabled' => array(
'title' => __( 'Enable/Disable', 'paypal-payments-for-woocommerce' ),
'desc_tip' => true,
'description' => __( 'Once enabled, the Credit Card option will show up in the checkout.', 'paypal-payments-for-woocommerce' ),
'label' => __( 'Enable PayPal Card Processing', 'paypal-payments-for-woocommerce' ),
'type' => 'checkbox',
'default' => false,
'gateway' => 'dcc',
2020-09-03 08:43:03 +03:00
'requirements' => array(
'dcc',
),
'screens' => array(
State::STATE_ONBOARDED,
),
),
2020-08-28 08:13:45 +03:00
'dcc_gateway_title' => array(
'title' => __( 'Title', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'text',
'description' => __(
'This controls the title which the user sees during checkout.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'default' => __( 'Credit Cards', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'desc_tip' => true,
'screens' => array(
State::STATE_ONBOARDED,
),
2020-09-03 08:43:03 +03:00
'requirements' => array(
'dcc',
),
2020-08-28 08:13:45 +03:00
'gateway' => 'dcc',
),
'description' => array(
'title' => __( 'Description', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'text',
'desc_tip' => true,
'description' => __(
'This controls the description which the user sees during checkout.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'default' => __(
'Pay via PayPal; you can pay with your credit card if you don\'t have a PayPal account.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'dcc_gateway_description' => array(
'title' => __( 'Description', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'text',
'desc_tip' => true,
'description' => __(
'This controls the description which the user sees during checkout.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'default' => __(
'Pay with your credit card.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_ONBOARDED,
),
2020-09-03 08:43:03 +03:00
'requirements' => array(
'dcc',
),
2020-08-28 08:13:45 +03:00
'gateway' => 'dcc',
),
'intent' => array(
'title' => __( 'Intent', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'class' => array( 'wc-enhanced-select' ),
'default' => 'capture',
'desc_tip' => true,
'description' => __(
'The intent to either capture payment immediately or authorize a payment for an order after order creation.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'capture' => __( 'Capture', 'paypal-payments-for-woocommerce' ),
'authorize' => __( 'Authorize', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
2020-08-28 08:13:45 +03:00
),
'capture_for_virtual_only' => array(
'title' => __( 'Capture Virtual-Only Orders ', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'checkbox',
'default' => false,
'desc_tip' => true,
'description' => __(
'If the order contains exclusively virtual items, enable this to immediately capture, rather than authorize, the transaction.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'label' => __( 'Capture Virtual-Only Orders', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'screens' => array(
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
2020-08-28 08:13:45 +03:00
),
'payee_preferred' => array(
'title' => __( 'Instant Payments ', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'checkbox',
'default' => false,
'desc_tip' => true,
'description' => __(
'If you enable this setting, PayPal will be instructed not to allow the buyer to use funding sources that take additional time to complete (for example, eChecks). Instead, the buyer will be required to use an instant funding source, such as an instant transfer, a credit/debit card, or PayPal Credit.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'label' => __( 'Require Instant Payment', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'brand_name' => array(
'title' => __( 'Brand Name', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'text',
'default' => get_bloginfo( 'name' ),
'desc_tip' => true,
'description' => __(
'Control the name of your shop, customers will see in the PayPal process.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'landing_page' => array(
'title' => __( 'Landing Page', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'class' => array( 'wc-enhanced-select' ),
'default' => 'gold',
'desc_tip' => true,
'description' => __(
'Type of PayPal page to display.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
ApplicationContext::LANDING_PAGE_LOGIN => __( 'Login (PayPal account login)', 'paypal-payments-for-woocommerce' ),
ApplicationContext::LANDING_PAGE_BILLING => __( 'Billing (Non-PayPal account)', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'disable_funding' => array(
'title' => __( 'Disable funding sources', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'ppcp-multiselect',
'class' => array( 'wc-enhanced-select' ),
'default' => array(),
'desc_tip' => true,
'description' => __(
'By default all possible funding sources will be shown. You can disable some sources, if you wish.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'card' => _x( 'Credit or debit cards', 'Name of payment method', 'paypal-payments-for-woocommerce' ),
'credit' => _x( 'PayPal Credit', 'Name of payment method', 'paypal-payments-for-woocommerce' ),
'sepa' => _x( 'SEPA-Lastschrift', 'Name of payment method', 'paypal-payments-for-woocommerce' ),
'bancontact' => _x( 'Bancontact', 'Name of payment method', 'paypal-payments-for-woocommerce' ),
'eps' => _x( 'eps', 'Name of payment method', 'paypal-payments-for-woocommerce' ),
'giropay' => _x( 'giropay', 'Name of payment method', 'paypal-payments-for-woocommerce' ),
'ideal' => _x( 'iDEAL', 'Name of payment method', 'paypal-payments-for-woocommerce' ),
'mybank' => _x( 'MyBank', 'Name of payment method', 'paypal-payments-for-woocommerce' ),
'p24' => _x( 'Przelewy24', 'Name of payment method', 'paypal-payments-for-woocommerce' ),
'sofort' => _x( 'Sofort', 'Name of payment method', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'vault_enabled' => array(
'title' => __( 'Vaulting', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'checkbox',
'desc_tip' => true,
'label' => __( 'Enable vaulting', 'paypal-payments-for-woocommerce' ),
'description' => __( 'Enables you to store payment tokens for subscriptions.', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'default' => true,
'screens' => array(
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
2020-08-28 08:13:45 +03:00
'logging_enabled' => array(
'title' => __( 'Logging', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'checkbox',
'desc_tip' => true,
'label' => __( 'Enable logging', 'paypal-payments-for-woocommerce' ),
'description' => __( 'Enable logging of unexpected behavior. This can also log private data and should only be enabled in a development or stage environment.', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'default' => false,
'screens' => array(
State::STATE_START,
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
2020-08-28 08:13:45 +03:00
),
'prefix' => array(
'title' => __( 'Installation prefix', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'text',
'desc_tip' => true,
'description' => __( 'If you use your PayPal account with more than one installation, please use a distinct prefix to seperate those installations. Please do not use numbers in your prefix.', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'default' => 'WC-',
'screens' => array(
State::STATE_START,
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
2020-08-28 08:13:45 +03:00
),
2020-08-19 05:19:29 +03:00
2020-08-31 09:13:24 +03:00
// General button styles.
2020-08-28 08:13:45 +03:00
'button_style_heading' => array(
'heading' => __( 'Checkout', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'ppcp-heading',
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_enabled' => array(
'title' => __( 'Enable buttons on Checkout', 'paypal-payments-for-woocommerce' ),
'type' => 'checkbox',
'label' => __( 'Enable on Checkout', 'paypal-payments-for-woocommerce' ),
'default' => true,
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
2020-08-28 08:13:45 +03:00
'button_layout' => array(
'title' => __( 'Button Layout', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'class' => array( 'wc-enhanced-select' ),
'default' => 'vertical',
'desc_tip' => true,
'description' => __(
'If additional funding sources are available to the buyer through PayPal, 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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'vertical' => __( 'Vertical', 'paypal-payments-for-woocommerce' ),
'horizontal' => __( 'Horizontal', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_tagline' => array(
'title' => __( 'Tagline', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'checkbox',
'default' => true,
'label' => __( 'Enable tagline', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'desc_tip' => true,
'description' => __(
'Add the tagline. This line will only show up, if you select a horizontal layout.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_label' => array(
'title' => __( 'Button Label', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'class' => array( 'wc-enhanced-select' ),
'default' => 'paypal',
'desc_tip' => true,
'description' => __(
'This controls the label on the primary button.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'paypal' => __( 'PayPal', 'paypal-payments-for-woocommerce' ),
'checkout' => __( 'PayPal Checkout', 'paypal-payments-for-woocommerce' ),
'buynow' => __( 'PayPal Buy Now', 'paypal-payments-for-woocommerce' ),
'pay' => __( 'Pay with PayPal', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_color' => array(
'title' => __( 'Color', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'gold' => __( 'Gold (Recommended)', 'paypal-payments-for-woocommerce' ),
'blue' => __( 'Blue', 'paypal-payments-for-woocommerce' ),
'silver' => __( 'Silver', 'paypal-payments-for-woocommerce' ),
'black' => __( 'Black', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_shape' => array(
'title' => __( 'Shape', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'pill' => __( 'Pill', 'paypal-payments-for-woocommerce' ),
'rect' => __( 'Rectangle', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'message_heading' => array(
'heading' => __( 'Credit Messaging on Checkout', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'ppcp-heading',
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_enabled' => array(
'title' => __( 'Enable message on Checkout', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'checkbox',
'label' => __( 'Enable on Checkout', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'default' => true,
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_layout' => array(
'title' => __( 'Credit Messaging layout', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'class' => array( 'wc-enhanced-select' ),
'default' => 'text',
'desc_tip' => true,
'description' => __(
'The layout of the message.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'text' => __( 'Text', 'paypal-payments-for-woocommerce' ),
'flex' => __( 'Flex', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_logo' => array(
'title' => __( 'Credit Messaging logo', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'primary' => __( 'Primary', 'paypal-payments-for-woocommerce' ),
'alternative' => __( 'Alternative', 'paypal-payments-for-woocommerce' ),
'inline' => __( 'Inline', 'paypal-payments-for-woocommerce' ),
'none' => __( 'None', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_position' => array(
'title' => __( 'Credit Messaging logo position', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'left' => __( 'Left', 'paypal-payments-for-woocommerce' ),
'right' => __( 'Right', 'paypal-payments-for-woocommerce' ),
'top' => __( 'Top', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_color' => array(
'title' => __( 'Credit Messaging text color', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'black' => __( 'Black', 'paypal-payments-for-woocommerce' ),
'white' => __( 'White', 'paypal-payments-for-woocommerce' ),
'monochrome' => __( 'Monochrome', 'paypal-payments-for-woocommerce' ),
'grayscale' => __( 'Grayscale', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_flex_color' => array(
'title' => __( 'Credit Messaging color', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'blue' => __( 'Blue', 'paypal-payments-for-woocommerce' ),
'black' => __( 'Black', 'paypal-payments-for-woocommerce' ),
'white' => __( 'White', 'paypal-payments-for-woocommerce' ),
'white-no-border' => __( 'White no border', 'paypal-payments-for-woocommerce' ),
'gray' => __( 'Gray', 'paypal-payments-for-woocommerce' ),
'monochrome' => __( 'Monochrome', 'paypal-payments-for-woocommerce' ),
'grayscale' => __( 'Grayscale', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_flex_ratio' => array(
'title' => __( 'Credit Messaging ratio', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'class' => array( 'wc-enhanced-select' ),
'default' => '1x1',
'desc_tip' => true,
'description' => __(
'The color of the text. Only applicable, when the layout style Flex is used.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'1x1' => __( '1x1', 'paypal-payments-for-woocommerce' ),
'1x4' => __( '1x4', 'paypal-payments-for-woocommerce' ),
'8x1' => __( '8x1', 'paypal-payments-for-woocommerce' ),
'20x1' => __( '20x1', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
2020-08-31 09:13:24 +03:00
// Single product page.
2020-08-28 08:13:45 +03:00
'button_product_heading' => array(
'heading' => __( 'Button on Single product', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'ppcp-heading',
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_product_enabled' => array(
'title' => __( 'Enable buttons on Single Product', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'checkbox',
'label' => __( 'Enable on Single Product', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'default' => true,
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_product_layout' => array(
'title' => __( 'Button Layout', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'class' => array( 'wc-enhanced-select' ),
'default' => 'horizontal',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'vertical' => __( 'Vertical', 'paypal-payments-for-woocommerce' ),
'horizontal' => __( 'Horizontal', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_product_tagline' => array(
'title' => __( 'Tagline', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'checkbox',
'label' => __( 'Enable tagline', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'default' => true,
'desc_tip' => true,
'description' => __(
'Add the tagline. This line will only show up, if you select a horizontal layout.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_product_label' => array(
'title' => __( 'Button Label', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'class' => array( 'wc-enhanced-select' ),
'default' => 'paypal',
'desc_tip' => true,
'description' => __(
'This controls the label on the primary button.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'paypal' => __( 'PayPal', 'paypal-payments-for-woocommerce' ),
'checkout' => __( 'PayPal Checkout', 'paypal-payments-for-woocommerce' ),
'buynow' => __( 'PayPal Buy Now', 'paypal-payments-for-woocommerce' ),
'pay' => __( 'Pay with PayPal', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_product_color' => array(
'title' => __( 'Color', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'gold' => __( 'Gold (Recommended)', 'paypal-payments-for-woocommerce' ),
'blue' => __( 'Blue', 'paypal-payments-for-woocommerce' ),
'silver' => __( 'Silver', 'paypal-payments-for-woocommerce' ),
'black' => __( 'Black', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_product_shape' => array(
'title' => __( 'Shape', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'pill' => __( 'Pill', 'paypal-payments-for-woocommerce' ),
'rect' => __( 'Rectangle', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
2020-08-14 10:28:24 +03:00
2020-08-28 08:13:45 +03:00
'message_product_heading' => array(
'heading' => __( 'Credit Messaging on Single product', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'ppcp-heading',
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_product_enabled' => array(
'title' => __( 'Enable message on Single Product', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'checkbox',
'label' => __( 'Enable on Single Product', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'default' => true,
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_product_layout' => array(
'title' => __( 'Credit Messaging layout', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'class' => array( 'wc-enhanced-select' ),
'default' => 'text',
'desc_tip' => true,
'description' => __(
'The layout of the message.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'text' => __( 'Text', 'paypal-payments-for-woocommerce' ),
'flex' => __( 'Flex', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_product_logo' => array(
'title' => __( 'Credit Messaging logo', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'primary' => __( 'Primary', 'paypal-payments-for-woocommerce' ),
'alternative' => __( 'Alternative', 'paypal-payments-for-woocommerce' ),
'inline' => __( 'Inline', 'paypal-payments-for-woocommerce' ),
'none' => __( 'None', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_product_position' => array(
'title' => __( 'Credit Messaging logo position', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'left' => __( 'Left', 'paypal-payments-for-woocommerce' ),
'right' => __( 'Right', 'paypal-payments-for-woocommerce' ),
'top' => __( 'Top', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_product_color' => array(
'title' => __( 'Credit Messaging text color', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'black' => __( 'Black', 'paypal-payments-for-woocommerce' ),
'white' => __( 'White', 'paypal-payments-for-woocommerce' ),
'monochrome' => __( 'Monochrome', 'paypal-payments-for-woocommerce' ),
'grayscale' => __( 'Grayscale', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_product_flex_color' => array(
'title' => __( 'Credit Messaging color', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'blue' => __( 'Blue', 'paypal-payments-for-woocommerce' ),
'black' => __( 'Black', 'paypal-payments-for-woocommerce' ),
'white' => __( 'White', 'paypal-payments-for-woocommerce' ),
'white-no-border' => __( 'White no border', 'paypal-payments-for-woocommerce' ),
'gray' => __( 'Gray', 'paypal-payments-for-woocommerce' ),
'monochrome' => __( 'Monochrome', 'paypal-payments-for-woocommerce' ),
'grayscale' => __( 'Grayscale', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_product_flex_ratio' => array(
'title' => __( 'Credit Messaging ratio', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'class' => array( 'wc-enhanced-select' ),
'default' => '1x1',
'desc_tip' => true,
'description' => __(
'The color of the text. Only applicable, when the layout style Flex is used.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'1x1' => __( '1x1', 'paypal-payments-for-woocommerce' ),
'1x4' => __( '1x4', 'paypal-payments-for-woocommerce' ),
'8x1' => __( '8x1', 'paypal-payments-for-woocommerce' ),
'20x1' => __( '20x1', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
2020-08-19 05:19:29 +03:00
2020-08-31 09:13:24 +03:00
// Mini cart settings.
2020-08-28 08:13:45 +03:00
'button_mini-cart_heading' => array(
'heading' => __( 'Mini Cart', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'ppcp-heading',
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_mini-cart_enabled' => array(
'title' => __( 'Buttons on Mini Cart', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'checkbox',
'label' => __( 'Enable on Mini Cart', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'default' => true,
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_mini-cart_layout' => array(
'title' => __( 'Button Layout', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'class' => array( 'wc-enhanced-select' ),
'default' => 'horizontal',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'vertical' => __( 'Vertical', 'paypal-payments-for-woocommerce' ),
'horizontal' => __( 'Horizontal', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_mini-cart_tagline' => array(
'title' => __( 'Tagline', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'checkbox',
'label' => __( 'Enable tagline', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'default' => false,
'desc_tip' => true,
'description' => __(
'Add the tagline. This line will only show up, if you select a horizontal layout.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_mini-cart_label' => array(
'title' => __( 'Button Label', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'class' => array( 'wc-enhanced-select' ),
'default' => 'paypal',
'desc_tip' => true,
'description' => __(
'This controls the label on the primary button.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'paypal' => __( 'PayPal', 'paypal-payments-for-woocommerce' ),
'checkout' => __( 'PayPal Checkout', 'paypal-payments-for-woocommerce' ),
'buynow' => __( 'PayPal Buy Now', 'paypal-payments-for-woocommerce' ),
'pay' => __( 'Pay with PayPal', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_mini-cart_color' => array(
'title' => __( 'Color', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'gold' => __( 'Gold (Recommended)', 'paypal-payments-for-woocommerce' ),
'blue' => __( 'Blue', 'paypal-payments-for-woocommerce' ),
'silver' => __( 'Silver', 'paypal-payments-for-woocommerce' ),
'black' => __( 'Black', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_mini-cart_shape' => array(
'title' => __( 'Shape', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'pill' => __( 'Pill', 'paypal-payments-for-woocommerce' ),
'rect' => __( 'Rectangle', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
2020-08-14 10:28:24 +03:00
2020-08-31 09:13:24 +03:00
// Cart settings.
2020-08-28 08:13:45 +03:00
'button_cart_heading' => array(
'heading' => __( 'Cart', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'ppcp-heading',
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_cart_enabled' => array(
'title' => __( 'Buttons on Cart', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'checkbox',
'label' => __( 'Enable on Cart', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'default' => true,
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_cart_layout' => array(
'title' => __( 'Button Layout', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'class' => array( 'wc-enhanced-select' ),
'default' => 'horizontal',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'vertical' => __( 'Vertical', 'paypal-payments-for-woocommerce' ),
'horizontal' => __( 'Horizontal', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_cart_tagline' => array(
'title' => __( 'Tagline', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'checkbox',
'label' => __( 'Enable tagline', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'default' => true,
'desc_tip' => true,
'description' => __(
'Add the tagline. This line will only show up, if you select a horizontal layout.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_cart_label' => array(
'title' => __( 'Button Label', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'class' => array( 'wc-enhanced-select' ),
'default' => 'paypal',
'desc_tip' => true,
'description' => __(
'This controls the label on the primary button.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'paypal' => __( 'PayPal', 'paypal-payments-for-woocommerce' ),
'checkout' => __( 'PayPal Checkout', 'paypal-payments-for-woocommerce' ),
'buynow' => __( 'PayPal Buy Now', 'paypal-payments-for-woocommerce' ),
'pay' => __( 'Pay with PayPal', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_cart_color' => array(
'title' => __( 'Color', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'gold' => __( 'Gold (Recommended)', 'paypal-payments-for-woocommerce' ),
'blue' => __( 'Blue', 'paypal-payments-for-woocommerce' ),
'silver' => __( 'Silver', 'paypal-payments-for-woocommerce' ),
'black' => __( 'Black', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'button_cart_shape' => array(
'title' => __( 'Shape', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'pill' => __( 'Pill', 'paypal-payments-for-woocommerce' ),
'rect' => __( 'Rectangle', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
2020-08-28 08:13:45 +03:00
'message_cart_heading' => array(
'heading' => __( 'Credit Messaging on Cart', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'ppcp-heading',
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_cart_enabled' => array(
'title' => __( 'Enable message on Cart', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'checkbox',
'label' => __( 'Enable on Cart', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'default' => true,
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_cart_layout' => array(
'title' => __( 'Credit Messaging layout', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'class' => array( 'wc-enhanced-select' ),
'default' => 'text',
'desc_tip' => true,
'description' => __(
'The layout of the message.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'text' => __( 'Text', 'paypal-payments-for-woocommerce' ),
'flex' => __( 'Flex', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_cart_logo' => array(
'title' => __( 'Credit Messaging logo', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'primary' => __( 'Primary', 'paypal-payments-for-woocommerce' ),
'alternative' => __( 'Alternative', 'paypal-payments-for-woocommerce' ),
'inline' => __( 'Inline', 'paypal-payments-for-woocommerce' ),
'none' => __( 'None', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_cart_position' => array(
'title' => __( 'Credit Messaging logo position', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'left' => __( 'Left', 'paypal-payments-for-woocommerce' ),
'right' => __( 'Right', 'paypal-payments-for-woocommerce' ),
'top' => __( 'Top', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_cart_color' => array(
'title' => __( 'Credit Messaging text color', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'black' => __( 'Black', 'paypal-payments-for-woocommerce' ),
'white' => __( 'White', 'paypal-payments-for-woocommerce' ),
'monochrome' => __( 'Monochrome', 'paypal-payments-for-woocommerce' ),
'grayscale' => __( 'Grayscale', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_cart_flex_color' => array(
'title' => __( 'Credit Messaging color', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'blue' => __( 'Blue', 'paypal-payments-for-woocommerce' ),
'black' => __( 'Black', 'paypal-payments-for-woocommerce' ),
'white' => __( 'White', 'paypal-payments-for-woocommerce' ),
'white-no-border' => __( 'White no border', 'paypal-payments-for-woocommerce' ),
'gray' => __( 'Gray', 'paypal-payments-for-woocommerce' ),
'monochrome' => __( 'Monochrome', 'paypal-payments-for-woocommerce' ),
'grayscale' => __( 'Grayscale', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
'message_cart_flex_ratio' => array(
'title' => __( 'Credit Messaging ratio', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'select',
'class' => array( 'wc-enhanced-select' ),
'default' => '1x1',
'desc_tip' => true,
'description' => __(
'The color of the text. Only applicable, when the layout style Flex is used.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'1x1' => __( '1x1', 'paypal-payments-for-woocommerce' ),
'1x4' => __( '1x4', 'paypal-payments-for-woocommerce' ),
'8x1' => __( '8x1', 'paypal-payments-for-woocommerce' ),
'20x1' => __( '20x1', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array( 'messages' ),
'gateway' => 'paypal',
),
2020-08-19 05:19:29 +03:00
2020-08-28 08:13:45 +03:00
'disable_cards' => array(
'title' => __( 'Disable specific credit cards', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'ppcp-multiselect',
'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.',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'visa' => _x( 'Visa', 'Name of credit card', 'paypal-payments-for-woocommerce' ),
'mastercard' => _x( 'Mastercard', 'Name of credit card', 'paypal-payments-for-woocommerce' ),
'amex' => _x( 'American Express', 'Name of credit card', 'paypal-payments-for-woocommerce' ),
'discover' => _x( 'Discover', 'Name of credit card', 'paypal-payments-for-woocommerce' ),
'jcb' => _x( 'JCB', 'Name of credit card', 'paypal-payments-for-woocommerce' ),
'elo' => _x( 'Elo', 'Name of credit card', 'paypal-payments-for-woocommerce' ),
'hiper' => _x( 'Hiper', 'Name of credit card', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_ONBOARDED,
),
'requirements' => array(
'dcc',
),
'gateway' => 'dcc',
),
'card_icons' => array(
'title' => __( 'Show logo of the following credit cards', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
'type' => 'ppcp-multiselect',
'class' => array( 'wc-enhanced-select' ),
'default' => array(),
'desc_tip' => true,
'description' => __(
'Define, which cards you want to display in your checkout..',
'paypal-payments-for-woocommerce'
2020-08-28 08:13:45 +03:00
),
'options' => array(
'visa' => _x( 'Visa', 'Name of credit card', 'paypal-payments-for-woocommerce' ),
'mastercard' => _x( 'Mastercard', 'Name of credit card', 'paypal-payments-for-woocommerce' ),
'amex' => _x( 'American Express', 'Name of credit card', 'paypal-payments-for-woocommerce' ),
'discover' => _x( 'Discover', 'Name of credit card', 'paypal-payments-for-woocommerce' ),
'jcb' => _x( 'JCB', 'Name of credit card', 'paypal-payments-for-woocommerce' ),
'elo' => _x( 'Elo', 'Name of credit card', 'paypal-payments-for-woocommerce' ),
'hiper' => _x( 'Hiper', 'Name of credit card', 'paypal-payments-for-woocommerce' ),
2020-08-28 08:13:45 +03:00
),
'screens' => array(
State::STATE_ONBOARDED,
),
'requirements' => array(
'dcc',
),
'gateway' => 'dcc',
),
);
if ( ! defined( 'PPCP_FLAG_SUBSCRIPTION' ) || ! PPCP_FLAG_SUBSCRIPTION ) {
unset( $fields['vault_enabled'] );
}
/**
* Disable card for UK.
*/
$region = wc_get_base_location();
$country = $region['country'];
if ( 'GB' === $country ) {
unset( $fields['disable_funding']['options']['card'] );
}
2020-08-28 08:13:45 +03:00
return $fields;
},
2020-08-28 08:13:45 +03:00
'wcgateway.checkout.address-preset' => static function( ContainerInterface $container ): CheckoutPayPalAddressPreset {
2020-08-28 08:13:45 +03:00
return new CheckoutPayPalAddressPreset(
$container->get( 'session.handler' )
);
},
'wcgateway.url' => static function ( ContainerInterface $container ): string {
return plugins_url(
'/modules/ppcp-wc-gateway/',
2020-08-28 08:13:45 +03:00
dirname( __FILE__, 3 ) . '/woocommerce-paypal-commerce-gateway.php'
);
},
'wcgateway.endpoint.return-url' => static function ( ContainerInterface $container ) : ReturnUrlEndpoint {
$gateway = $container->get( 'wcgateway.paypal-gateway' );
$endpoint = $container->get( 'api.endpoint.order' );
$prefix = $container->get( 'api.prefix' );
return new ReturnUrlEndpoint(
$gateway,
$endpoint,
$prefix
);
},
);