PluginProbe
Subscriptions for WooCommerce with Stripe Recurring Payments / 1.11.2
Subscriptions for WooCommerce with Stripe Recurring Payments v1.11.2
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.11.2, at includes/Illuminate.php

95 lines 2.7 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\Cancellation;
9 use SpringDevs\Subscription\Illuminate\Cron;
10 use SpringDevs\Subscription\Illuminate\Email;
11 use SpringDevs\Subscription\Illuminate\Order;
12 use SpringDevs\Subscription\Illuminate\Post;
13 use SpringDevs\Subscription\Illuminate\Stats;
14 use SpringDevs\Subscription\Illuminate\Gateways\Stripe\Stripe;
15 use SpringDevs\Subscription\Illuminate\GuestCheckout;
16 use SpringDevs\Subscription\Illuminate\RoleManagement;
17 use SpringDevs\Subscription\Illuminate\Subscription\Subscription;
18
19 /**
20 * Globally Load Scripts.
21 */
22 class Illuminate {
23
24 /**
25 * Initialize the Class.
26 */
27 public function __construct() {
28 $this->stripe_initialization();
29 $this->paypal_initialization();
30
31 new Subscription();
32 new RoleManagement();
33 new Order();
34 new Cron();
35 new Cancellation();
36 new Stats();
37 new Post();
38 new Block();
39 new Checkout();
40 new GuestCheckout();
41 new AutoRenewal();
42 new Email();
43 }
44
45 /**
46 * Stripe Initialization.
47 *
48 * @return void
49 */
50 public function stripe_initialization() {
51 if ( function_exists( 'woocommerce_gateway_stripe' ) ) {
52 if ( ! class_exists( 'WC_Payment_Gateway_CC' ) ) {
53 include_once dirname( WC_PLUGIN_FILE ) . '/includes/gateways/class-wc-payment-gateway-cc.php';
54 }
55
56 include_once dirname( WC_STRIPE_MAIN_FILE ) . '/includes/compat/trait-wc-stripe-subscriptions-utilities.php';
57 include_once dirname( WC_STRIPE_MAIN_FILE ) . '/includes/compat/trait-wc-stripe-pre-orders.php';
58 include_once dirname( WC_STRIPE_MAIN_FILE ) . '/includes/compat/trait-wc-stripe-subscriptions.php';
59 include_once dirname( WC_STRIPE_MAIN_FILE ) . '/includes/abstracts/abstract-wc-stripe-payment-gateway.php';
60
61 if ( class_exists( '\WC_Stripe_Payment_Gateway' ) ) {
62 new Stripe();
63 }
64 }
65 }
66
67 /**
68 * PayPal Gateway Initialization.
69 *
70 * @return void
71 */
72 public function paypal_initialization() {
73 // Forcefully enable PayPal integration if the option is not set.
74 update_option( 'wp_subs_paypal_integration_enabled', 'on' );
75
76 $is_paypal_integration_enabled = 'on' === get_option( 'wp_subs_paypal_integration_enabled', 'off' );
77
78 // Register the PayPal gateway with WooCommerce.
79 if ( $is_paypal_integration_enabled ) {
80 add_filter( 'woocommerce_payment_gateways', [ $this, 'register_paypal_gateway' ] );
81 }
82 }
83
84 /**
85 * Register our custom PayPal gateway with WooCommerce
86 *
87 * @param array $gateways Payment gateways.
88 * @return array
89 */
90 public function register_paypal_gateway( $gateways ) {
91 $gateways[] = 'SpringDevs\\Subscription\\Illuminate\\Gateways\\Paypal\\Paypal';
92 return $gateways;
93 }
94 }
95