action will be denied if 3D Secure is required)', 'woocommerce-paypal-payments' ), 'SCA_WHEN_REQUIRED' => __( '3D Secure when required', 'woocommerce-paypal-payments' ), 'SCA_ALWAYS' => __( 'Always trigger 3D Secure', 'woocommerce-paypal-payments' ), ), 'screens' => array( State::STATE_ONBOARDED, ), 'requirements' => array( 'dcc', ), 'gateway' => 'dcc', ), 'paypal_saved_payments' => array( 'heading' => __( 'Saved payments', 'woocommerce-paypal-payments' ), 'description' => sprintf( // translators: %1$s, %2$s, %3$s and %4$s are a link tags. __( 'PayPal can securely store your customers\' payment methods for %1$sfuture payments%2$s and %3$ssubscriptions%4$s, simplifying the checkout process and enabling recurring transactions on your website.', 'woocommerce-paypal-payments' ), '', '', '', '' ), 'type' => 'ppcp-heading', 'screens' => array( State::STATE_START, State::STATE_ONBOARDED, ), 'requirements' => array(), 'gateway' => 'paypal', ), 'subscriptions_mode' => $container->get( 'wcgateway.settings.fields.subscriptions_mode' ), 'vault_enabled' => array( 'title' => __( 'Vaulting', 'woocommerce-paypal-payments' ), 'type' => 'checkbox', 'desc_tip' => true, 'label' => sprintf( // translators: %1$s and %2$s are the opening and closing of HTML tag. __( 'Securely store your customers’ PayPal accounts for a seamless checkout experience. Payment methods are saved in the secure %1$sPayPal Vault%2$s.', 'woocommerce-paypal-payments' ), '', '' ) . $container->get( 'button.helper.vaulting-label' ), 'description' => __( 'Allow registered buyers to save PayPal payments.', 'woocommerce-paypal-payments' ), 'default' => false, 'screens' => array( State::STATE_ONBOARDED, ), 'requirements' => array(), 'gateway' => 'paypal', 'input_class' => $container->get( 'wcgateway.helper.vaulting-scope' ) ? array() : array( 'ppcp-disabled-checkbox' ), ), ); if ( ! $subscription_helper->plugin_is_active() ) { unset( $fields['subscriptions_mode'] ); } /** * Depending on your store location, some credit cards can't be used. * Here, we filter them out. */ $card_options = $fields['disable_cards']['options']; $card_icons = $fields['card_icons']['options']; $dark_versions = array(); foreach ( $card_options as $card => $label ) { if ( $dcc_applies->can_process_card( $card ) ) { if ( 'visa' === $card || 'mastercard' === $card ) { $dark_versions = array( 'visa-dark' => $card_icons['visa-dark'], 'mastercard-dark' => $card_icons['mastercard-dark'], ); } continue; } unset( $card_options[ $card ] ); } $fields['disable_cards']['options'] = $card_options; $fields['card_icons']['options'] = array_merge( $dark_versions, $card_options ); return $fields; }, 'wcgateway.all-funding-sources' => static function( ContainerInterface $container ): array { return array( 'card' => _x( 'Credit or debit cards', 'Name of payment method', 'woocommerce-paypal-payments' ), 'sepa' => _x( 'SEPA-Lastschrift', 'Name of payment method', 'woocommerce-paypal-payments' ), 'bancontact' => _x( 'Bancontact', 'Name of payment method', 'woocommerce-paypal-payments' ), 'blik' => _x( 'BLIK', 'Name of payment method', 'woocommerce-paypal-payments' ), 'eps' => _x( 'eps', 'Name of payment method', 'woocommerce-paypal-payments' ), 'giropay' => _x( 'giropay', 'Name of payment method', 'woocommerce-paypal-payments' ), 'ideal' => _x( 'iDEAL', 'Name of payment method', 'woocommerce-paypal-payments' ), 'mybank' => _x( 'MyBank', 'Name of payment method', 'woocommerce-paypal-payments' ), 'p24' => _x( 'Przelewy24', 'Name of payment method', 'woocommerce-paypal-payments' ), 'venmo' => _x( 'Venmo', 'Name of payment method', 'woocommerce-paypal-payments' ), 'trustly' => _x( 'Trustly', 'Name of payment method', 'woocommerce-paypal-payments' ), 'paylater' => _x( 'PayPal Pay Later', 'Name of payment method', 'woocommerce-paypal-payments' ), 'paypal' => _x( 'PayPal', 'Name of payment method', 'woocommerce-paypal-payments' ), ); }, 'wcgateway.extra-funding-sources' => static function( ContainerInterface $container ): array { return array( 'googlepay' => _x( 'Google Pay', 'Name of payment method', 'woocommerce-paypal-payments' ), 'applepay' => _x( 'Apple Pay', 'Name of payment method', 'woocommerce-paypal-payments' ), ); }, /** * The sources that do not cause issues about redirecting (on mobile, ...) and sometimes not returning back. */ 'wcgateway.funding-sources-without-redirect' => static function( ContainerInterface $container ): array { return array( 'paypal', 'paylater', 'venmo', 'card' ); }, 'wcgateway.settings.funding-sources' => static function( ContainerInterface $container ): array { return array_diff_key( $container->get( 'wcgateway.all-funding-sources' ), array_flip( array( 'paylater', 'paypal', ) ) ); }, 'wcgateway.checkout.address-preset' => static function( ContainerInterface $container ): CheckoutPayPalAddressPreset { return new CheckoutPayPalAddressPreset( $container->get( 'session.handler' ) ); }, 'wcgateway.url' => static function ( ContainerInterface $container ): string { return plugins_url( $container->get( 'wcgateway.relative-path' ), dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php' ); }, 'wcgateway.relative-path' => static function( ContainerInterface $container ): string { return 'modules/ppcp-wc-gateway/'; }, 'wcgateway.absolute-path' => static function( ContainerInterface $container ): string { return plugin_dir_path( dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php' ) . $container->get( 'wcgateway.relative-path' ); }, 'wcgateway.endpoint.return-url' => static function ( ContainerInterface $container ) : ReturnUrlEndpoint { $gateway = $container->get( 'wcgateway.paypal-gateway' ); $endpoint = $container->get( 'api.endpoint.order' ); return new ReturnUrlEndpoint( $gateway, $endpoint, $container->get( 'session.handler' ), $container->get( 'woocommerce.logger.woocommerce' ) ); }, 'wcgateway.endpoint.refresh-feature-status' => static function ( ContainerInterface $container ) : RefreshFeatureStatusEndpoint { return new RefreshFeatureStatusEndpoint( $container->get( 'wcgateway.settings' ), new Cache( 'ppcp-timeout' ), $container->get( 'woocommerce.logger.woocommerce' ) ); }, 'wcgateway.transaction-url-sandbox' => static function ( ContainerInterface $container ): string { return 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_view-a-trans&id=%s'; }, 'wcgateway.transaction-url-live' => static function ( ContainerInterface $container ): string { return 'https://www.paypal.com/cgi-bin/webscr?cmd=_view-a-trans&id=%s'; }, 'wcgateway.soft-descriptor' => static function ( ContainerInterface $container ): string { $settings = $container->get( 'wcgateway.settings' ); assert( $settings instanceof Settings ); if ( $settings->has( 'soft_descriptor' ) ) { return $settings->get( 'soft_descriptor' ); } return ''; }, 'wcgateway.transaction-url-provider' => static function ( ContainerInterface $container ): TransactionUrlProvider { $sandbox_url_base = $container->get( 'wcgateway.transaction-url-sandbox' ); $live_url_base = $container->get( 'wcgateway.transaction-url-live' ); return new TransactionUrlProvider( $sandbox_url_base, $live_url_base ); }, 'wcgateway.helper.dcc-product-status' => static function ( ContainerInterface $container ) : DCCProductStatus { $settings = $container->get( 'wcgateway.settings' ); $partner_endpoint = $container->get( 'api.endpoint.partners' ); return new DCCProductStatus( $settings, $partner_endpoint, $container->get( 'dcc.status-cache' ), $container->get( 'api.helpers.dccapplies' ), $container->get( 'onboarding.state' ), $container->get( 'api.helper.failure-registry' ) ); }, 'wcgateway.helper.refund-fees-updater' => static function ( ContainerInterface $container ): RefundFeesUpdater { $order_endpoint = $container->get( 'api.endpoint.order' ); $logger = $container->get( 'woocommerce.logger.woocommerce' ); return new RefundFeesUpdater( $order_endpoint, $logger ); }, 'button.helper.messages-disclaimers' => static function ( ContainerInterface $container ): MessagesDisclaimers { return new MessagesDisclaimers( $container->get( 'api.shop.country' ) ); }, 'wcgateway.funding-source.renderer' => function ( ContainerInterface $container ) : FundingSourceRenderer { return new FundingSourceRenderer( $container->get( 'wcgateway.settings' ), array_merge( $container->get( 'wcgateway.all-funding-sources' ), $container->get( 'wcgateway.extra-funding-sources' ) ) ); }, 'wcgateway.checkout-helper' => static function ( ContainerInterface $container ): CheckoutHelper { return new CheckoutHelper(); }, 'wcgateway.pay-upon-invoice-order-endpoint' => static function ( ContainerInterface $container ): PayUponInvoiceOrderEndpoint { return new PayUponInvoiceOrderEndpoint( $container->get( 'api.host' ), $container->get( 'api.bearer' ), $container->get( 'api.factory.order' ), $container->get( 'wcgateway.fraudnet' ), $container->get( 'woocommerce.logger.woocommerce' ) ); }, 'wcgateway.pay-upon-invoice-payment-source-factory' => static function ( ContainerInterface $container ): PaymentSourceFactory { return new PaymentSourceFactory(); }, 'wcgateway.pay-upon-invoice-gateway' => static function ( ContainerInterface $container ): PayUponInvoiceGateway { return new PayUponInvoiceGateway( $container->get( 'wcgateway.pay-upon-invoice-order-endpoint' ), $container->get( 'api.factory.purchase-unit' ), $container->get( 'wcgateway.pay-upon-invoice-payment-source-factory' ), $container->get( 'onboarding.environment' ), $container->get( 'wcgateway.transaction-url-provider' ), $container->get( 'woocommerce.logger.woocommerce' ), $container->get( 'wcgateway.pay-upon-invoice-helper' ), $container->get( 'wcgateway.checkout-helper' ), $container->get( 'onboarding.state' ), $container->get( 'wcgateway.processor.refunds' ) ); }, 'wcgateway.fraudnet-session-id' => static function ( ContainerInterface $container ): FraudNetSessionId { return new FraudNetSessionId(); }, 'wcgateway.fraudnet-source-website-id' => static function ( ContainerInterface $container ): FraudNetSourceWebsiteId { return new FraudNetSourceWebsiteId( $container->get( 'api.merchant_id' ) ); }, 'wcgateway.fraudnet' => static function ( ContainerInterface $container ): FraudNet { $session_id = $container->get( 'wcgateway.fraudnet-session-id' ); $source_website_id = $container->get( 'wcgateway.fraudnet-source-website-id' ); return new FraudNet( (string) $session_id(), (string) $source_website_id() ); }, 'wcgateway.pay-upon-invoice-helper' => static function( ContainerInterface $container ): PayUponInvoiceHelper { return new PayUponInvoiceHelper( $container->get( 'wcgateway.checkout-helper' ), $container->get( 'api.shop.country' ) ); }, 'wcgateway.pay-upon-invoice-product-status' => static function( ContainerInterface $container ): PayUponInvoiceProductStatus { return new PayUponInvoiceProductStatus( $container->get( 'wcgateway.settings' ), $container->get( 'api.endpoint.partners' ), $container->get( 'pui.status-cache' ), $container->get( 'onboarding.state' ), $container->get( 'api.helper.failure-registry' ) ); }, 'wcgateway.pay-upon-invoice' => static function ( ContainerInterface $container ): PayUponInvoice { return new PayUponInvoice( $container->get( 'wcgateway.pay-upon-invoice-order-endpoint' ), $container->get( 'woocommerce.logger.woocommerce' ), $container->get( 'wcgateway.settings' ), $container->get( 'onboarding.state' ), $container->get( 'wcgateway.current-ppcp-settings-page-id' ), $container->get( 'wcgateway.pay-upon-invoice-product-status' ), $container->get( 'wcgateway.pay-upon-invoice-helper' ), $container->get( 'wcgateway.checkout-helper' ), $container->get( 'api.factory.capture' ) ); }, 'wcgateway.oxxo' => static function( ContainerInterface $container ): OXXO { return new OXXO( $container->get( 'wcgateway.checkout-helper' ), $container->get( 'wcgateway.url' ), $container->get( 'ppcp.asset-version' ) ); }, 'wcgateway.oxxo-gateway' => static function( ContainerInterface $container ): OXXOGateway { return new OXXOGateway( $container->get( 'api.endpoint.order' ), $container->get( 'api.factory.purchase-unit' ), $container->get( 'api.factory.shipping-preference' ), $container->get( 'wcgateway.url' ), $container->get( 'wcgateway.transaction-url-provider' ), $container->get( 'onboarding.environment' ), $container->get( 'woocommerce.logger.woocommerce' ) ); }, 'wcgateway.logging.is-enabled' => function ( ContainerInterface $container ) : bool { $settings = $container->get( 'wcgateway.settings' ); /** * Whether the logging of the plugin errors/events is enabled. */ return apply_filters( 'woocommerce_paypal_payments_is_logging_enabled', $settings->has( 'logging_enabled' ) && $settings->get( 'logging_enabled' ) ); }, 'wcgateway.use-place-order-button' => function ( ContainerInterface $container ) : bool { /** * Whether to use the standard "Place order" button with redirect to PayPal instead of the PayPal smart buttons. */ return apply_filters( 'woocommerce_paypal_payments_use_place_order_button', false ); }, 'wcgateway.place-order-button-text' => function ( ContainerInterface $container ) : string { /** * The text for the standard "Place order" button, when the "Place order" button mode is enabled. */ return apply_filters( 'woocommerce_paypal_payments_place_order_button_text', __( 'Proceed to PayPal', 'woocommerce-paypal-payments' ) ); }, 'wcgateway.place-order-button-description' => function ( ContainerInterface $container ) : string { /** * The text for additional description, when the "Place order" button mode is enabled. */ return apply_filters( 'woocommerce_paypal_payments_place_order_button_description', __( 'Clicking "Proceed to PayPal" will redirect you to PayPal to complete your purchase.', 'woocommerce-paypal-payments' ) ); }, 'wcgateway.helper.vaulting-scope' => static function ( ContainerInterface $container ): bool { try { $token = $container->get( 'api.bearer' )->bearer(); return $token->vaulting_available(); } catch ( RuntimeException $exception ) { return false; } }, 'button.helper.vaulting-label' => static function ( ContainerInterface $container ): string { $vaulting_label = ''; if ( ! $container->get( 'wcgateway.helper.vaulting-scope' ) ) { $vaulting_label .= sprintf( // translators: %1$s and %2$s are the opening and closing of HTML tag. __( ' To use vaulting features, you must %1$senable vaulting on your account%2$s.', 'woocommerce-paypal-payments' ), '', '' ); } $vaulting_label .= '
'; $vaulting_label .= sprintf( // translators: %1$s, %2$s, %3$s and %4$s are the opening and closing of HTML tag. __( 'This will disable all %1$sPay Later%2$s features and %3$sAlternative Payment Methods%4$s on your site.', 'woocommerce-paypal-payments' ), '', '', '', '' ); $vaulting_label .= '
'; return $vaulting_label; }, 'wcgateway.settings.dcc-gateway-title.default' => static function ( ContainerInterface $container ): string { return __( 'Debit & Credit Cards', 'woocommerce-paypal-payments' ); }, '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 { $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' ); }, 'wcgateway.settings.has_enabled_separate_button_gateways' => static function ( ContainerInterface $container ): bool { return (bool) $container->get( 'wcgateway.settings.allow_card_button_gateway' ); }, 'wcgateway.settings.should-disable-fraudnet-checkbox' => static function( ContainerInterface $container ): bool { $pui_helper = $container->get( 'wcgateway.pay-upon-invoice-helper' ); assert( $pui_helper instanceof PayUponInvoiceHelper ); if ( $pui_helper->is_pui_gateway_enabled() ) { return true; } return false; }, 'wcgateway.settings.fraudnet-label' => static function ( ContainerInterface $container ): string { $label = sprintf( // translators: %1$s and %2$s are the opening and closing of HTML tag. __( 'Manage online risk with %1$sFraudNet%2$s.', 'woocommerce-paypal-payments' ), '', '' ); if ( 'DE' === $container->get( 'api.shop.country' ) ) { $label .= '%1$s %2$s
', $dcc_enabled ? $enabled_status_text : $disabled_status_text, $dcc_enabled ? '' : '', $dcc_enabled ? '_self' : '_blank', esc_url( $dcc_button_url ), esc_html( $dcc_button_text ) ); }, 'wcgateway.settings.connection.reference-transactions-status-text' => static function ( ContainerInterface $container ): string { $environment = $container->get( 'onboarding.environment' ); assert( $environment instanceof Environment ); $billing_agreements_endpoint = $container->get( 'api.endpoint.billing-agreements' ); assert( $billing_agreements_endpoint instanceof BillingAgreementsEndpoint ); $enabled = $billing_agreements_endpoint->reference_transaction_enabled(); $enabled_status_text = esc_html__( 'Status: Available', 'woocommerce-paypal-payments' ); $disabled_status_text = esc_html__( 'Status: Not yet enabled', 'woocommerce-paypal-payments' ); $button_text = $enabled ? esc_html__( 'Settings', 'woocommerce-paypal-payments' ) : esc_html__( 'Enable Advanced PayPal Wallet', 'woocommerce-paypal-payments' ); $enable_url = $environment->current_environment_is( Environment::PRODUCTION ) ? $container->get( 'wcgateway.enable-reference-transactions-url-live' ) : $container->get( 'wcgateway.enable-reference-transactions-url-sandbox' ); $button_url = $enabled ? admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=ppcp-gateway#field-paypal_saved_payments' ) : $enable_url; return sprintf( '%1$s %2$s
', $enabled ? $enabled_status_text : $disabled_status_text, $enabled ? '' : '', $enabled ? '_self' : '_blank', esc_url( $button_url ), esc_html( $button_text ) ); }, 'wcgateway.settings.connection.pui-status-text' => static function ( ContainerInterface $container ): string { $state = $container->get( 'onboarding.state' ); if ( $state->current_state() < State::STATE_ONBOARDED ) { return ''; } $pui_product_status = $container->get( 'wcgateway.pay-upon-invoice-product-status' ); assert( $pui_product_status instanceof PayUponInvoiceProductStatus ); $environment = $container->get( 'onboarding.environment' ); assert( $environment instanceof Environment ); $pui_enabled = $pui_product_status->pui_is_active(); $enabled_status_text = esc_html__( 'Status: Available', 'woocommerce-paypal-payments' ); $disabled_status_text = esc_html__( 'Status: Not yet enabled', 'woocommerce-paypal-payments' ); $enable_pui_url = $environment->current_environment_is( Environment::PRODUCTION ) ? $container->get( 'wcgateway.enable-pui-url-live' ) : $container->get( 'wcgateway.enable-pui-url-sandbox' ); $pui_button_url = $pui_enabled ? admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=ppcp-pay-upon-invoice-gateway' ) : $enable_pui_url; $pui_button_text = $pui_enabled ? esc_html__( 'Settings', 'woocommerce-paypal-payments' ) : esc_html__( 'Enable Pay upon Invoice', 'woocommerce-paypal-payments' ); return sprintf( '%1$s %2$s
', $pui_enabled ? $enabled_status_text : $disabled_status_text, $pui_enabled ? '' : '', $pui_enabled ? '_self' : '_blank', esc_url( $pui_button_url ), esc_html( $pui_button_text ) ); }, 'pui.status-cache' => static function( ContainerInterface $container ): Cache { return new Cache( 'ppcp-paypal-pui-status-cache' ); }, 'dcc.status-cache' => static function( ContainerInterface $container ): Cache { return new Cache( 'ppcp-paypal-dcc-status-cache' ); }, 'wcgateway.button.locations' => static function( ContainerInterface $container ): array { return array( 'product' => 'Single Product', 'cart' => 'Classic Cart', 'checkout' => 'Classic Checkout', 'mini-cart' => 'Mini Cart', ); }, 'wcgateway.button.default-locations' => static function( ContainerInterface $container ): array { $button_locations = $container->get( 'wcgateway.button.locations' ); unset( $button_locations['mini-cart'] ); return array_keys( $button_locations ); }, 'wcgateway.settings.pay-later.messaging-locations' => static function( ContainerInterface $container ): array { $button_locations = $container->get( 'wcgateway.button.locations' ); unset( $button_locations['mini-cart'] ); return array_merge( $button_locations, array( 'shop' => __( 'Shop', 'woocommerce-paypal-payments' ), 'home' => __( 'Home', 'woocommerce-paypal-payments' ), ) ); }, 'wcgateway.settings.pay-later.default-messaging-locations' => static function( ContainerInterface $container ): array { $locations = $container->get( 'wcgateway.settings.pay-later.messaging-locations' ); unset( $locations['home'] ); return array_keys( $locations ); }, 'wcgateway.settings.pay-later.button-locations' => static function( ContainerInterface $container ): array { $settings = $container->get( 'wcgateway.settings' ); assert( $settings instanceof Settings ); $button_locations = $container->get( 'wcgateway.button.locations' ); $smart_button_selected_locations = $settings->has( 'smart_button_locations' ) ? $settings->get( 'smart_button_locations' ) : array(); return array_intersect_key( $button_locations, array_flip( $smart_button_selected_locations ) ); }, 'wcgateway.settings.pay-later.default-button-locations' => static function( ContainerInterface $container ): array { return $container->get( 'wcgateway.button.default-locations' ); }, 'wcgateway.ppcp-gateways' => static function ( ContainerInterface $container ): array { return array( PayPalGateway::ID, CreditCardGateway::ID, PayUponInvoiceGateway::ID, CardButtonGateway::ID, OXXOGateway::ID, ); }, 'wcgateway.gateway-repository' => static function ( ContainerInterface $container ): GatewayRepository { return new GatewayRepository( $container->get( 'wcgateway.ppcp-gateways' ) ); }, 'wcgateway.is-fraudnet-enabled' => static function ( ContainerInterface $container ): bool { $settings = $container->get( 'wcgateway.settings' ); assert( $settings instanceof Settings ); return $settings->has( 'fraudnet_enabled' ) && $settings->get( 'fraudnet_enabled' ); }, 'wcgateway.fraudnet-assets' => function( ContainerInterface $container ) : FraudNetAssets { return new FraudNetAssets( $container->get( 'wcgateway.url' ), $container->get( 'ppcp.asset-version' ), $container->get( 'wcgateway.fraudnet' ), $container->get( 'onboarding.environment' ), $container->get( 'wcgateway.settings' ), $container->get( 'wcgateway.gateway-repository' ), $container->get( 'session.handler' ), $container->get( 'wcgateway.is-fraudnet-enabled' ) ); }, 'wcgateway.cli.settings.command' => function( ContainerInterface $container ) : SettingsCommand { return new SettingsCommand( $container->get( 'wcgateway.settings' ) ); }, 'wcgateway.display-manager' => SingletonDecorator::make( static function( ContainerInterface $container ): DisplayManager { $settings = $container->get( 'wcgateway.settings' ); return new DisplayManager( $settings ); } ), 'wcgateway.wp-paypal-locales-map' => static function( ContainerInterface $container ): array { return apply_filters( 'woocommerce_paypal_payments_button_locales', array( '' => __( 'Browser language', 'woocommerce-paypal-payments' ), 'ar_DZ' => __( 'Arabic (Algeria)', 'woocommerce-paypal-payments' ), 'ar_BH' => __( 'Arabic (Bahrain)', 'woocommerce-paypal-payments' ), 'ar_EG' => __( 'Arabic (Egypt)', 'woocommerce-paypal-payments' ), 'ar_JO' => __( 'Arabic (Jordan)', 'woocommerce-paypal-payments' ), 'ar_KW' => __( 'Arabic (Kuwait)', 'woocommerce-paypal-payments' ), 'ar_MA' => __( 'Arabic (Morocco)', 'woocommerce-paypal-payments' ), 'ar_SA' => __( 'Arabic (Saudi Arabia)', 'woocommerce-paypal-payments' ), 'cs_CZ' => __( 'Czech', 'woocommerce-paypal-payments' ), 'zh_CN' => __( 'Chinese (Simplified)', 'woocommerce-paypal-payments' ), 'zh_HK' => __( 'Chinese (Hong Kong)', 'woocommerce-paypal-payments' ), 'zh_TW' => __( 'Chinese (Traditional)', 'woocommerce-paypal-payments' ), 'da_DK' => __( 'Danish', 'woocommerce-paypal-payments' ), 'nl_NL' => __( 'Dutch', 'woocommerce-paypal-payments' ), 'en_AU' => __( 'English (Australia)', 'woocommerce-paypal-payments' ), 'en_GB' => __( 'English (United Kingdom)', 'woocommerce-paypal-payments' ), 'en_US' => __( 'English (United States)', 'woocommerce-paypal-payments' ), 'fi_FI' => __( 'Finnish', 'woocommerce-paypal-payments' ), 'fr_CA' => __( 'French (Canada)', 'woocommerce-paypal-payments' ), 'fr_FR' => __( 'French (France)', 'woocommerce-paypal-payments' ), 'de_DE' => __( 'German (Germany)', 'woocommerce-paypal-payments' ), 'de_CH' => __( 'German (Switzerland)', 'woocommerce-paypal-payments' ), 'de_AT' => __( 'German (Austria)', 'woocommerce-paypal-payments' ), 'de_LU' => __( 'German (Luxembourg)', 'woocommerce-paypal-payments' ), 'el_GR' => __( 'Greek', 'woocommerce-paypal-payments' ), 'he_IL' => __( 'Hebrew', 'woocommerce-paypal-payments' ), 'hu_HU' => __( 'Hungarian', 'woocommerce-paypal-payments' ), 'id_ID' => __( 'Indonesian', 'woocommerce-paypal-payments' ), 'it_IT' => __( 'Italian', 'woocommerce-paypal-payments' ), 'ja_JP' => __( 'Japanese', 'woocommerce-paypal-payments' ), 'ko_KR' => __( 'Korean', 'woocommerce-paypal-payments' ), 'no_NO' => __( 'Norwegian', 'woocommerce-paypal-payments' ), 'es_ES' => __( 'Spanish (Spain)', 'woocommerce-paypal-payments' ), 'es_MX' => __( 'Spanish (Mexico)', 'woocommerce-paypal-payments' ), 'pl_PL' => __( 'Polish', 'woocommerce-paypal-payments' ), 'pt_BR' => __( 'Portuguese (Brazil)', 'woocommerce-paypal-payments' ), 'pt_PT' => __( 'Portuguese (Portugal)', 'woocommerce-paypal-payments' ), 'ru_RU' => __( 'Russian', 'woocommerce-paypal-payments' ), 'sk_SK' => __( 'Slovak', 'woocommerce-paypal-payments' ), 'sv_SE' => __( 'Swedish', 'woocommerce-paypal-payments' ), 'th_TH' => __( 'Thai', 'woocommerce-paypal-payments' ), ) ); }, 'wcgateway.endpoint.capture-card-payment' => static function( ContainerInterface $container ): CaptureCardPayment { return new CaptureCardPayment( $container->get( 'api.host' ), $container->get( 'api.bearer' ), $container->get( 'api.factory.order' ), $container->get( 'api.factory.purchase-unit' ), $container->get( 'api.endpoint.order' ), $container->get( 'session.handler' ), $container->get( 'wc-subscriptions.helpers.real-time-account-updater' ), $container->get( 'wcgateway.settings' ), $container->get( 'woocommerce.logger.woocommerce' ) ); }, );