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

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