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 / Webhook / WebhookServiceProvider.php

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

85 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Webhook: Service provider
4 *
5 * @package SimplePay
6 * @subpackage Core
7 * @copyright Copyright (c) 2021, WP Simple Pay, LLC
8 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 * @since 4.4.0
10 */
11
12 namespace SimplePay\Core\Webhook;
13
14 use SimplePay\Core\AbstractPluginServiceProvider;
15 use SimplePay\Core\Webhook\CreateWebhookTool;
16
17 /**
18 * WebhookServiceProvider class.
19 *
20 * @since 4.4.1
21 */
22 class WebhookServiceProvider extends AbstractPluginServiceProvider {
23
24 /**
25 * {@inheritdoc}
26 */
27 public function get_services() {
28 return array(
29 'webhook-endpoint-manager',
30 );
31 }
32
33 /**
34 * {@inheritdoc}
35 */
36 public function get_subscribers() {
37 return array(
38 'webhook-none-received-notice',
39 'webhook-stripe-connect-sync',
40 'webhook-endpoint-health-check',
41 'webhook-create-tool',
42 );
43 }
44
45 /**
46 * {@inheritdoc}
47 */
48 public function register() {
49 $container = $this->getContainer();
50
51 // Manager.
52 $container->share(
53 'webhook-endpoint-manager',
54 WebhookEndpointManager::class
55 );
56
57 // Stripe Connect sync.
58 $container->share(
59 'webhook-stripe-connect-sync',
60 StripeConnectSync::class
61 )
62 ->withArgument( $container->get( 'webhook-endpoint-manager' ) );
63
64 // Endpoint health check.
65 $container->share(
66 'webhook-endpoint-health-check',
67 EndpointHealthCheck::class
68 )
69 ->withArgument( $container->get( 'webhook-endpoint-manager' ) );
70
71 // No webhook received notice.
72 $container->share(
73 'webhook-none-received-notice',
74 NoneReceivedNotice::class
75 );
76
77 // Create Webhook Tool.
78 $container->share(
79 'webhook-create-tool',
80 CreateWebhookTool::class
81 )->withArgument( $container->get( 'webhook-endpoint-manager' ) );
82 }
83
84 }
85