helpers
3 years ago
routes
3 years ago
src
3 years ago
config.php
3 years ago
helpers.php
3 years ago
hooks.php
3 years ago
config.php
327 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Configuration. Based on WPEmerge config: |
| 4 | * |
| 5 | * @link https://docs.wpemerge.com/#/framework/configuration |
| 6 | * |
| 7 | * @package SureCart |
| 8 | */ |
| 9 | |
| 10 | return [ |
| 11 | /** |
| 12 | * Array of service providers you wish to enable. |
| 13 | */ |
| 14 | 'providers' => [ |
| 15 | \SureCartAppCore\AppCore\AppCoreServiceProvider::class, |
| 16 | \SureCartAppCore\Config\ConfigServiceProvider::class, |
| 17 | \SureCart\Database\MigrationsServiceProvider::class, |
| 18 | \SureCart\Database\UpdateMigrationServiceProvider::class, |
| 19 | \SureCart\Account\AccountServiceProvider::class, |
| 20 | \SureCart\WordPress\PluginServiceProvider::class, |
| 21 | \SureCart\WordPress\TranslationsServiceProvider::class, |
| 22 | \SureCart\WordPress\ThemeServiceProvider::class, |
| 23 | \SureCart\WordPress\Pages\PageServiceProvider::class, |
| 24 | \SureCart\WordPress\Users\UsersServiceProvider::class, |
| 25 | \SureCart\WordPress\Admin\Profile\UserProfileServiceProvider::class, |
| 26 | \SureCart\WordPress\PostTypes\FormPostTypeServiceProvider::class, |
| 27 | \SureCart\WordPress\Assets\AssetsServiceProvider::class, |
| 28 | \SureCart\WordPress\Shortcodes\ShortcodesServiceProvider::class, |
| 29 | \SureCart\WordPress\Admin\Menus\AdminMenuPageServiceProvider::class, |
| 30 | \SureCart\WordPress\Admin\Notices\AdminNoticesServiceProvider::class, |
| 31 | \SureCartAppCore\Assets\AssetsServiceProvider::class, |
| 32 | \SureCart\Routing\RouteConditionsServiceProvider::class, |
| 33 | \SureCart\Routing\AdminRouteServiceProvider::class, |
| 34 | \SureCart\Permissions\RolesServiceProvider::class, |
| 35 | \SureCart\Settings\SettingsServiceProvider::class, |
| 36 | \SureCart\Request\RequestServiceProvider::class, |
| 37 | \SureCart\View\ViewServiceProvider::class, |
| 38 | \SureCart\Cart\CartServiceProvider::class, |
| 39 | \SureCart\Webhooks\WebhooksServiceProvider::class, |
| 40 | \SureCart\BlockLibrary\BlockServiceProvider::class, |
| 41 | \SureCart\Support\Errors\ErrorsServiceProvider::class, |
| 42 | \SureCart\Activation\ActivationServiceProvider::class, |
| 43 | |
| 44 | // REST providers. |
| 45 | \SureCart\Rest\AbandonedCheckoutRestServiceProvider::class, |
| 46 | \SureCart\Rest\AbandonedCheckoutProtocolRestServiceProvider::class, |
| 47 | \SureCart\Rest\BlockPatternsRestServiceProvider::class, |
| 48 | \SureCart\Rest\AccountRestServiceProvider::class, |
| 49 | \SureCart\Rest\BrandRestServiceProvider::class, |
| 50 | \SureCart\Rest\BumpRestServiceProvider::class, |
| 51 | \SureCart\Rest\LoginRestServiceProvider::class, |
| 52 | \SureCart\Rest\PurchasesRestServiceProvider::class, |
| 53 | \SureCart\Rest\StatisticRestServiceProvider::class, |
| 54 | \SureCart\Rest\IntegrationsRestServiceProvider::class, |
| 55 | \SureCart\Rest\IntegrationProvidersRestServiceProvider::class, |
| 56 | \SureCart\Rest\CustomerRestServiceProvider::class, |
| 57 | \SureCart\Rest\CustomerLinksRestServiceProvider::class, |
| 58 | \SureCart\Rest\PaymentMethodsRestServiceProvider::class, |
| 59 | \SureCart\Rest\ProcessorRestServiceProvider::class, |
| 60 | \SureCart\Rest\ManualPaymentMethodsRestServiceProvider::class, |
| 61 | \SureCart\Rest\PaymentIntentsRestServiceProvider::class, |
| 62 | \SureCart\Rest\ProductsRestServiceProvider::class, |
| 63 | \SureCart\Rest\ProductGroupsRestServiceProvider::class, |
| 64 | \SureCart\Rest\PriceRestServiceProvider::class, |
| 65 | \SureCart\Rest\CouponRestServiceProvider::class, |
| 66 | \SureCart\Rest\PromotionRestServiceProvider::class, |
| 67 | \SureCart\Rest\UploadsRestServiceProvider::class, |
| 68 | \SureCart\Rest\BalanceTransactionRestServiceProvider::class, |
| 69 | \SureCart\Rest\ChargesRestServiceProvider::class, |
| 70 | \SureCart\Rest\RefundsRestServiceProvider::class, |
| 71 | \SureCart\Rest\DownloadRestServiceProvider::class, |
| 72 | \SureCart\Rest\LicenseRestServiceProvider::class, |
| 73 | \SureCart\Rest\ActivationRestServiceProvider::class, |
| 74 | \SureCart\Rest\MediaRestServiceProvider::class, |
| 75 | \SureCart\Rest\SubscriptionRestServiceProvider::class, |
| 76 | \SureCart\Rest\SubscriptionProtocolRestServiceProvider::class, |
| 77 | \SureCart\Rest\PeriodRestServiceProvider::class, |
| 78 | \SureCart\Rest\SettingsRestServiceProvider::class, |
| 79 | \SureCart\Rest\PortalProtocolRestServiceProvider::class, |
| 80 | \SureCart\Rest\TaxProtocolRestServiceProvider::class, |
| 81 | \SureCart\Rest\OrderProtocolRestServiceProvider::class, |
| 82 | \SureCart\Rest\TaxRegistrationRestServiceProvider::class, |
| 83 | \SureCart\Rest\TaxZoneRestServiceProvider::class, |
| 84 | \SureCart\Rest\CustomerNotificationProtocolRestServiceProvider::class, |
| 85 | \SureCart\Rest\OrderRestServiceProvider::class, |
| 86 | \SureCart\Rest\CheckoutRestServiceProvider::class, |
| 87 | \SureCart\Rest\InvoicesRestServiceProvider::class, |
| 88 | \SureCart\Rest\WebhooksRestServiceProvider::class, |
| 89 | \SureCart\Rest\VerificationCodeRestServiceProvider::class, |
| 90 | \SureCart\Rest\CheckEmailRestServiceProvider::class, |
| 91 | |
| 92 | // integrations. |
| 93 | \SureCart\Integrations\DiviServiceProvider::class, |
| 94 | \SureCart\Integrations\ThriveAutomator\ThriveAutomatorServiceProvider::class, |
| 95 | \SureCart\Integrations\LearnDash\LearnDashServiceProvider::class, |
| 96 | \SureCart\Integrations\LearnDashGroup\LearnDashGroupServiceProvider::class, |
| 97 | \SureCart\Integrations\LifterLMS\LifterLMSServiceProvider::class, |
| 98 | \SureCart\Integrations\BuddyBoss\BuddyBossServiceProvider::class, |
| 99 | \SureCart\Integrations\AffiliateWP\AffiliateWPServiceProvider::class, |
| 100 | \SureCart\Integrations\TutorLMS\TutorLMSServiceProvider::class, |
| 101 | \SureCart\Integrations\User\UserServiceProvider::class, |
| 102 | \SureCart\Integrations\MemberPress\MemberPressServiceProvider::class, |
| 103 | \SureCart\Integrations\Elementor\ElementorServiceProvider::class, |
| 104 | \SureCart\Integrations\Beaver\BeaverServiceProvider::class, |
| 105 | ], |
| 106 | |
| 107 | /** |
| 108 | * SSR Blocks |
| 109 | */ |
| 110 | 'blocks' => [ |
| 111 | \SureCartBlocks\Blocks\Email\Block::class, |
| 112 | \SureCartBlocks\Blocks\Address\Block::class, |
| 113 | \SureCartBlocks\Blocks\BuyButton\Block::class, |
| 114 | \SureCartBlocks\Blocks\AddToCartButton\Block::class, |
| 115 | \SureCartBlocks\Blocks\CustomerDashboardButton\Block::class, |
| 116 | \SureCartBlocks\Blocks\CheckoutForm\Block::class, |
| 117 | \SureCartBlocks\Blocks\CartSubtotal\Block::class, |
| 118 | \SureCartBlocks\Blocks\CartBumpLineItem\Block::class, |
| 119 | \SureCartBlocks\Blocks\OrderConfirmationLineItems\Block::class, |
| 120 | \SureCartBlocks\Blocks\Form\Block::class, |
| 121 | \SureCartBlocks\Blocks\Payment\Block::class, |
| 122 | \SureCartBlocks\Blocks\LogoutButton\Block::class, |
| 123 | \SureCartBlocks\Blocks\Dashboard\WordPressAccount\Block::class, |
| 124 | \SureCartBlocks\Blocks\Dashboard\CustomerCharges\Block::class, |
| 125 | \SureCartBlocks\Blocks\Dashboard\CustomerDashboard\Block::class, |
| 126 | \SureCartBlocks\Blocks\Dashboard\CustomerOrders\Block::class, |
| 127 | \SureCartBlocks\Blocks\Dashboard\CustomerDownloads\Block::class, |
| 128 | \SureCartBlocks\Blocks\Dashboard\CustomerBillingDetails\Block::class, |
| 129 | \SureCartBlocks\Blocks\Dashboard\CustomerPaymentMethods\Block::class, |
| 130 | \SureCartBlocks\Blocks\Dashboard\CustomerSubscriptions\Block::class, |
| 131 | \SureCartBlocks\Blocks\Dashboard\CustomerInvoices\Block::class, |
| 132 | \SureCartBlocks\Blocks\Dashboard\DashboardPage\Block::class, |
| 133 | \SureCartBlocks\Blocks\Dashboard\DashboardTab\Block::class, |
| 134 | ], |
| 135 | |
| 136 | /** Which components to preload for each block. */ |
| 137 | 'preload' => [ |
| 138 | 'surecart/address' => [ 'sc-order-shipping-address', 'sc-address', 'sc-dropdown' ], |
| 139 | 'surecart/add-to-cart-button' => [ 'sc-cart-form', 'sc-price-input', 'sc-cart-form-submit' ], |
| 140 | 'surecart/button' => [ 'sc-button' ], |
| 141 | 'surecart/buy-button' => [ 'sc-button' ], |
| 142 | 'surecart/card' => [ 'sc-card' ], |
| 143 | 'surecart/checkbox' => [ 'sc-checkbox' ], |
| 144 | 'surecart/column' => [ 'sc-column' ], |
| 145 | 'surecart/columns' => [ 'sc-columns' ], |
| 146 | 'surecart/confirmation' => [ 'sc-order-confirmation' ], |
| 147 | 'surecart/coupon' => [ 'sc-order-coupon-form', 'sc-coupon-form', 'sc-button', 'sc-input' ], |
| 148 | 'surecart/customer-dashboard-button' => [ 'sc-button' ], |
| 149 | 'surecart/customer-dashboard' => [ 'sc-tab-group' ], |
| 150 | 'surecart/customer-subscriptions' => [ 'sc-subscriptions-list', 'sc-dialog', 'sc-card', 'sc-stacked-list', 'sc-stacked-list-row', 'sc-flex' ], |
| 151 | 'surecart/dashboard-page' => [ 'sc-spacing' ], |
| 152 | 'surecart/dashboard-tab' => [ 'sc-tab' ], |
| 153 | 'surecart/customer-billing-details' => [ 'sc-dashboard-customer-details', 'sc-breadcrumbs', 'sc-breadcrumb', 'sc-customer-edit' ], |
| 154 | 'surecart/divider' => [ 'sc-divider' ], |
| 155 | 'surecart/donation' => [ 'sc-donation-choices', 'sc-choices', 'sc-choice' ], |
| 156 | 'surecart/donation-amount' => [ 'sc-choice', 'sc-format-number' ], |
| 157 | 'surecart/email' => [ 'sc-input', 'sc-customer-email' ], |
| 158 | 'surecart/express-payment' => [ 'sc-express-payment', 'sc-divider', 'sc-stripe-payment-request' ], |
| 159 | 'surecart/form' => [ 'sc-checkout', 'sc-form', 'sc-checkout-unsaved-changes-warning', 'sc-line-items-provider', 'sc-block-ui' ], |
| 160 | 'surecart/heading' => [ 'sc-heading' ], |
| 161 | 'surecart/input' => [ 'sc-input' ], |
| 162 | 'surecart/line-items' => [ 'sc-line-items', 'sc-line-item', 'sc-line-item-tax', 'sc-product-line-item', 'sc-format-number', 'sc-skeleton' ], |
| 163 | 'surecart/logout-button' => [ 'sc-button' ], |
| 164 | 'surecart/name' => [ 'sc-customer-name', 'sc-input' ], |
| 165 | 'surecart/first-name' => [ 'sc-customer-firstname', 'sc-input' ], |
| 166 | 'surecart/last-name' => [ 'sc-customer-lastname', 'sc-input' ], |
| 167 | 'surecart/name-your-price' => [ 'sc-custom-order-price-input', 'sc-price-input', 'sc-skeleton' ], |
| 168 | 'surecart/password' => [ 'sc-order-password', 'sc-input' ], |
| 169 | 'surecart/payment' => [ 'sc-payment', 'sc-toggles', 'sc-toggle', 'sc-tag' ], |
| 170 | 'surecart/price-choice' => [ 'sc-price-choice', 'sc-choice', 'sc-skeleton' ], |
| 171 | 'surecart/price-selector' => [ 'sc-price-choices' ], |
| 172 | 'surecart/submit' => [ 'sc-order-submit', 'sc-button', 'sc-total', 'sc-paypal-buttons', 'sc-format-number', 'sc-spinner' ], |
| 173 | 'surecart/subtotal' => [ 'sc-line-item-total', 'sc-format-number' ], |
| 174 | 'surecart/total' => [ 'sc-line-item-total', 'sc-format-number' ], |
| 175 | 'surecart/totals' => [ 'sc-order-summary' ], |
| 176 | ], |
| 177 | |
| 178 | /** |
| 179 | * Links used. |
| 180 | */ |
| 181 | 'links' => [ |
| 182 | 'purchase' => 'https://app.surecart.com/billing', |
| 183 | ], |
| 184 | |
| 185 | /** |
| 186 | * Permission Controllers |
| 187 | */ |
| 188 | 'permission_controllers' => [ |
| 189 | \SureCart\Permissions\Models\BalanceTransactionPermissionsController::class, |
| 190 | \SureCart\Permissions\Models\ChargePermissionsController::class, |
| 191 | \SureCart\Permissions\Models\LicensePermissionsController::class, |
| 192 | \SureCart\Permissions\Models\CustomerPermissionsController::class, |
| 193 | \SureCart\Permissions\Models\OrderPermissionsController::class, |
| 194 | \SureCart\Permissions\Models\CheckoutPermissionsController::class, |
| 195 | \SureCart\Permissions\Models\InvoicePermissionsController::class, |
| 196 | \SureCart\Permissions\Models\PaymentMethodPermissionsController::class, |
| 197 | \SureCart\Permissions\Models\PurchasePermissionsController::class, |
| 198 | \SureCart\Permissions\Models\RefundPermissionsController::class, |
| 199 | \SureCart\Permissions\Models\SubscriptionPermissionsController::class, |
| 200 | ], |
| 201 | |
| 202 | /** |
| 203 | * Array of route group definitions and default attributes. |
| 204 | * All of these are optional so if we are not using |
| 205 | * a certain group of routes we can skip it. |
| 206 | * If we are not using routing at all we can skip |
| 207 | * the entire 'routes' option. |
| 208 | */ |
| 209 | 'routes' => [ |
| 210 | 'web' => [ |
| 211 | 'definitions' => __DIR__ . DIRECTORY_SEPARATOR . 'routes' . DIRECTORY_SEPARATOR . 'web.php', |
| 212 | 'attributes' => [ |
| 213 | 'namespace' => 'SureCart\\Controllers\\Web\\', |
| 214 | ], |
| 215 | ], |
| 216 | 'admin' => [ |
| 217 | 'definitions' => __DIR__ . DIRECTORY_SEPARATOR . 'routes' . DIRECTORY_SEPARATOR . 'admin.php', |
| 218 | 'attributes' => [ |
| 219 | 'namespace' => 'SureCart\\Controllers\\Admin\\', |
| 220 | ], |
| 221 | ], |
| 222 | 'ajax' => [ |
| 223 | 'definitions' => __DIR__ . DIRECTORY_SEPARATOR . 'routes' . DIRECTORY_SEPARATOR . 'ajax.php', |
| 224 | 'attributes' => [ |
| 225 | 'namespace' => 'SureCart\\Controllers\\Ajax\\', |
| 226 | ], |
| 227 | ], |
| 228 | ], |
| 229 | |
| 230 | /** |
| 231 | * View Composers settings. |
| 232 | */ |
| 233 | 'view_composers' => [ |
| 234 | 'namespace' => 'SureCart\\ViewComposers\\', |
| 235 | ], |
| 236 | |
| 237 | /** |
| 238 | * Register middleware class aliases. |
| 239 | * Use fully qualified middleware class names. |
| 240 | * |
| 241 | * Internal aliases that you should avoid overriding: |
| 242 | * - 'flash' |
| 243 | * - 'old_input' |
| 244 | * - 'csrf' |
| 245 | * - 'user.logged_in' |
| 246 | * - 'user.logged_out' |
| 247 | * - 'user.can' |
| 248 | */ |
| 249 | 'middleware' => [ |
| 250 | 'archive_model' => \SureCart\Middleware\ArchiveModelMiddleware::class, |
| 251 | 'edit_model' => \SureCart\Middleware\EditModelMiddleware::class, |
| 252 | 'nonce' => \SureCart\Middleware\NonceMiddleware::class, |
| 253 | 'webhooks' => \SureCart\Middleware\WebhooksMiddleware::class, |
| 254 | 'assets.components' => \SureCart\Middleware\ComponentAssetsMiddleware::class, |
| 255 | 'assets.brand_colors' => \SureCart\Middleware\BrandColorMiddleware::class, |
| 256 | ], |
| 257 | |
| 258 | /** |
| 259 | * Map model names to their corresponding classes. |
| 260 | * This lets you reference a model based on a simple string. |
| 261 | */ |
| 262 | 'models' => [ |
| 263 | 'abandoned_checkout' => \SureCart\Models\AbandonedCheckout::class, |
| 264 | 'account' => \SureCart\Models\Account::class, |
| 265 | 'charge' => \SureCart\Models\Charge::class, |
| 266 | 'coupon' => \SureCart\Models\Coupon::class, |
| 267 | 'customer' => \SureCart\Models\Customer::class, |
| 268 | 'customer_link' => \SureCart\Models\CustomerLink::class, |
| 269 | 'form' => \SureCart\Models\Form::class, |
| 270 | 'line_item' => \SureCart\Models\LineItem::class, |
| 271 | 'order' => \SureCart\Models\Order::class, |
| 272 | 'price' => \SureCart\Models\Price::class, |
| 273 | 'processor' => \SureCart\Models\Processor::class, |
| 274 | 'product' => \SureCart\Models\Product::class, |
| 275 | 'promotion' => \SureCart\Models\Promotion::class, |
| 276 | 'subscription' => \SureCart\Models\Subscription::class, |
| 277 | 'upload' => \SureCart\Models\Upload::class, |
| 278 | 'user' => \SureCart\Models\User::class, |
| 279 | 'webhook' => \SureCart\Models\Webhook::class, |
| 280 | ], |
| 281 | |
| 282 | /** |
| 283 | * Register middleware groups. |
| 284 | * Use fully qualified middleware class names or registered aliases. |
| 285 | * There are a couple built-in groups that you may override: |
| 286 | * - 'web' - Automatically applied to web routes. |
| 287 | * - 'admin' - Automatically applied to admin routes. |
| 288 | * - 'ajax' - Automatically applied to ajax routes. |
| 289 | * - 'global' - Automatically applied to all of the above. |
| 290 | * - 'surecart' - Internal group applied the same way 'global' is. |
| 291 | * |
| 292 | * Warning: The 'surecart' group contains some internal SureCart core |
| 293 | * middleware which you should avoid overriding. |
| 294 | */ |
| 295 | 'middleware_groups' => [ |
| 296 | 'global' => [], |
| 297 | 'web' => [], |
| 298 | 'ajax' => [], |
| 299 | 'admin' => [], |
| 300 | ], |
| 301 | |
| 302 | /** |
| 303 | * Optionally specify middleware execution order. |
| 304 | * Use fully qualified middleware class names. |
| 305 | */ |
| 306 | 'middleware_priority' => [ |
| 307 | // phpcs:ignore |
| 308 | // \SureCart\Middleware\MyMiddlewareThatShouldRunFirst::class, |
| 309 | // \SureCart\Middleware\MyMiddlewareThatShouldRunSecond::class, |
| 310 | ], |
| 311 | |
| 312 | /** |
| 313 | * Custom directories to search for views. |
| 314 | * Use absolute paths or leave blank to disable. |
| 315 | * Applies only to the default PhpViewEngine. |
| 316 | */ |
| 317 | 'views' => [ dirname( __DIR__ ) . DIRECTORY_SEPARATOR . 'views' ], |
| 318 | |
| 319 | /** |
| 320 | * App Core configuration. |
| 321 | */ |
| 322 | 'app_core' => [ |
| 323 | 'path' => dirname( __DIR__ ), |
| 324 | 'url' => plugin_dir_url( SURECART_PLUGIN_FILE ), |
| 325 | ], |
| 326 | ]; |
| 327 |