PluginProbe
Subscriptions for WooCommerce with Stripe Recurring Payments / 1.5.0
Subscriptions for WooCommerce with Stripe Recurring Payments v1.5.0
2.0.0 1.11.2 1.11.1 1.11.0 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.6 1.9.5 trunk 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 All 61 releases
subscription / includes / Illuminate.php

Illuminate.php in Subscriptions for WooCommerce with Stripe Recurring Payments 1.5.0, at includes/Illuminate.php

78 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace SpringDevs\Subscription;
4
5 use SpringDevs\Subscription\Frontend\Checkout;
6 use SpringDevs\Subscription\Illuminate\AutoRenewal;
7 use SpringDevs\Subscription\Illuminate\Block;
8 use SpringDevs\Subscription\Illuminate\Cron;
9 use SpringDevs\Subscription\Illuminate\Email;
10 use SpringDevs\Subscription\Illuminate\Order;
11 use SpringDevs\Subscription\Illuminate\Post;
12 use SpringDevs\Subscription\Illuminate\Stripe;
13
14 /**
15 * Globally Load Scripts.
16 */
17 class Illuminate {
18
19 /**
20 * Initialize the Class.
21 */
22 public function __construct() {
23 $this->stripe_initialization();
24 $this->paypal_initialization();
25 new Order();
26 new Cron();
27 new Post();
28 new Block();
29 new Checkout();
30 new AutoRenewal();
31 new Email();
32 }
33
34 /**
35 * Stripe Initialization.
36 *
37 * @return void
38 */
39 public function stripe_initialization() {
40 if ( function_exists( 'woocommerce_gateway_stripe' ) ) {
41 include_once dirname( WC_STRIPE_MAIN_FILE ) . '/includes/compat/trait-wc-stripe-subscriptions-utilities.php';
42 include_once dirname( WC_STRIPE_MAIN_FILE ) . '/includes/compat/trait-wc-stripe-pre-orders.php';
43 include_once dirname( WC_STRIPE_MAIN_FILE ) . '/includes/compat/trait-wc-stripe-subscriptions.php';
44 include_once dirname( WC_STRIPE_MAIN_FILE ) . '/includes/abstracts/abstract-wc-stripe-payment-gateway.php';
45
46 new Stripe();
47 }
48 }
49
50 /**
51 * PayPal Gateway Initialization.
52 *
53 * @return void
54 */
55 public function paypal_initialization() {
56 // Forcefully enable PayPal integration if the option is not set.
57 update_option( 'wp_subs_paypal_integration_enabled', 'on' );
58
59 $is_paypal_integration_enabled = 'on' === get_option( 'wp_subs_paypal_integration_enabled', 'off' );
60
61 // Register the PayPal gateway with WooCommerce.
62 if ( $is_paypal_integration_enabled ) {
63 add_filter( 'woocommerce_payment_gateways', array( $this, 'register_paypal_gateway' ) );
64 }
65 }
66
67 /**
68 * Register our custom PayPal gateway with WooCommerce
69 *
70 * @param array $gateways Payment gateways.
71 * @return array
72 */
73 public function register_paypal_gateway( $gateways ) {
74 $gateways[] = 'SpringDevs\\Subscription\\Illuminate\\Gateways\\Paypal\\Paypal';
75 return $gateways;
76 }
77 }
78