'title' => __( 'Configure PayPal Pay Later messaging', 'woocommerce-paypal-payments' ), 'description' => __( 'Decide where you want dynamic Pay Later messaging to show up and how you want it to look on your site.', 'woocommerce-paypal-payments' ), 'redirect_url' => admin_url( "admin.php?page=wc-settings&tab=checkout§ion={$section_id}&ppcp-tab={$pay_later_tab_id}" ), ); } return $list_of_config; }, /** * Retrieves the list of simple redirect task instances. * * @returns SimpleRedirectTask[] */ 'wcgateway.settings.wc-tasks.simple-redirect-tasks' => static function( ContainerInterface $container ): array { $simple_redirect_tasks_config = $container->get( 'wcgateway.settings.wc-tasks.simple-redirect-tasks-config' ); $simple_redirect_task_factory = $container->get( 'wcgateway.settings.wc-tasks.simple-redirect-task-factory' ); assert( $simple_redirect_task_factory instanceof SimpleRedirectTaskFactoryInterface ); $simple_redirect_tasks = array(); foreach ( $simple_redirect_tasks_config as $config ) { $id = $config['id'] ?? ''; $title = $config['title'] ?? ''; $description = $config['description'] ?? ''; $redirect_url = $config['redirect_url'] ?? ''; $simple_redirect_tasks[] = $simple_redirect_task_factory->create_task( $id, $title, $description, $redirect_url ); } return $simple_redirect_tasks; }, 'wcgateway.void-button.assets' => function( ContainerInterface $container ) : VoidButtonAssets { return new VoidButtonAssets( $container->get( 'wcgateway.url' ), $container->get( 'ppcp.asset-version' ), $container->get( 'api.endpoint.order' ), $container->get( 'wcgateway.processor.refunds' ), $container->get( 'wcgateway.allowed_refund_payment_methods' ) ); }, 'wcgateway.void-button.endpoint' => function( ContainerInterface $container ) : VoidOrderEndpoint { return new VoidOrderEndpoint( $container->get( 'button.request-data' ), $container->get( 'api.endpoint.order' ), $container->get( 'wcgateway.processor.refunds' ), $container->get( 'woocommerce.logger.woocommerce' ) ); }, 'wcgateway.settings.admin-settings-enabled' => static function( ContainerInterface $container ): bool { return $container->has( 'settings.url' ); }, );