PluginProbe
Stripe Payment Forms by WP Simple Pay – Accept Credit Card Payments + Subscriptions with Stripe / trunk
Stripe Payment Forms by WP Simple Pay – Accept Credit Card Payments + Subscriptions with Stripe vtrunk
4.17.3 trunk 2.2.0 2.3.0 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.6.2 2.6.3 4.10.0 4.11.1 4.12.2 4.14.1 4.14.2 4.14.3 4.15.0 4.16.0 All 59 releases
stripe / src / Help / HelpServiceProvider.php

HelpServiceProvider.php in Stripe Payment Forms by WP Simple Pay – Accept Credit Card Payments + Subscriptions with Stripe trunk, at src/Help/HelpServiceProvider.php

83 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Help: Service provider
4 *
5 * @package SimplePay
6 * @subpackage Core
7 * @copyright Copyright (c) 2022, Sandhills Development, LLC
8 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 * @since 4.4.6
10 */
11
12 namespace SimplePay\Core\Help;
13
14 use SimplePay\Core\AbstractPluginServiceProvider;
15
16 /**
17 * HelpServiceProvider class.
18 *
19 * @since 4.4.6
20 */
21 class HelpServiceProvider extends AbstractPluginServiceProvider {
22
23 /*
24 * {@inheritdoc}
25 */
26 public function get_services() {
27 return array(
28 'admin-help-docs-context',
29 );
30 }
31
32 /**
33 * {@inheritdoc}
34 */
35 public function get_subscribers() {
36 return array(
37 'admin-help-docs-importer',
38 'admin-help-ui',
39 );
40 }
41
42 /**
43 * {@inheritdoc}
44 */
45 public function register() {
46 $container = $this->getContainer();
47
48 // Docs importer.
49 $container->share(
50 'admin-help-docs-importer',
51 HelpDocsImporter::class
52 )
53 ->withArgument( $this->get_remote_api_url() )
54 ->withArgument( $container->get( 'scheduler' ) );
55
56 // Context.
57 $container->share(
58 'admin-help-docs-context',
59 HelpDocsContext::class
60 );
61
62 // UI.
63 $container->share( 'admin-help-ui', HelpUi::class )
64 ->withArgument( $container->get( 'admin-help-docs-context' ) );
65 }
66
67 /**
68 * Returns the API URL for remote doc articles to import.
69 *
70 * @since 4.4.6
71 *
72 * @return string
73 */
74 private function get_remote_api_url() {
75 if ( defined( 'SIMPAY_HELP_DOCS_API_URL' ) ) {
76 return SIMPAY_HELP_DOCS_API_URL;
77 }
78
79 return 'https://wpsimplepay.com/wp-content/docs.json';
80 }
81
82 }
83