PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.3.26
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.3.26
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
fluent-cart / app / Http / Routes / frontend_routes.php

frontend_routes.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.3.26, at app/Http/Routes/frontend_routes.php

98 lines 6.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2 <?php
3 /**
4 * @var $router \FluentCart\Framework\Http\Router
5 */
6
7 use FluentCart\App\Http\Controllers\CartController;
8 use FluentCart\App\Http\Controllers\CheckoutController;
9 use FluentCart\App\Http\Controllers\FrontendControllers\CustomerController;
10 use FluentCart\App\Http\Controllers\FrontendControllers\CustomerOrderController;
11 use FluentCart\App\Http\Controllers\FrontendControllers\CustomerProfileController;
12 use FluentCart\App\Http\Controllers\FrontendControllers\CustomerSubscriptionController;
13 use FluentCart\App\Http\Controllers\ShopController;
14 use FluentCart\App\Http\Controllers\UserController;
15 use FluentCart\App\Modules\Shipping\Http\Controllers\Frontend\ShippingFrontendController;
16 use FluentCart\Framework\Http\Router;
17
18 $router->prefix('public')
19 ->withPolicy('PublicPolicy')->group(function (Router $router) {
20 $router->get('products', [ShopController::class, 'getProducts']);
21 $router->get('product-views', [ShopController::class, 'getProductViews']);
22 $router->get('product-search', [ShopController::class, 'searchProduct']);
23 });
24
25 $router->prefix('cart')
26 ->withPolicy('PublicPolicy')->group(function (Router $router) {
27 // add_item removed — cart updates go through the WordPress AJAX handler
28 // (fluent_cart_cart_update action in WebCheckoutHandler), not this REST route.
29 //$router->post('/apply-coupon', [CartController::class, 'applyCoupon']);
30 //$router->post('/cancel-coupon', [CartController::class, 'cancelCoupon']);
31 //$router->post('/re-apply-coupon', [CartController::class, 'reapplyCoupon']);
32 });
33
34 $router->prefix('checkout')
35 ->withPolicy('PublicPolicy')->group(function (Router $router) {
36 $router->post('place-order', [CheckoutController::class, 'placeOrder']);
37 $router->get('get-order-info', [CheckoutController::class, 'getOrderInfo']);
38 $router->get('get-checkout-summary-view', [CheckoutController::class, 'getCheckoutSummary']);
39 $router->get('/get-available-shipping-methods', [ShippingFrontendController::class, 'getAvailableShippingMethods']);
40 $router->get('/get-shipping-methods-list-view', [ShippingFrontendController::class, 'getShippingMethodsListView']);
41 $router->get('/get-country-info', [ShippingFrontendController::class, 'getCountryInfo']);
42 });
43
44 $router->prefix('user')->withPolicy('PublicPolicy')->group(function (Router $router) {
45 //$router->post('register', [UserController::class, 'register']);
46 $router->post('login', [UserController::class, 'login']);
47 });
48
49 $router->prefix('customers')
50 ->withPolicy('CustomerFrontendPolicy')->group(function (Router $router) {
51 //$router->post('/', [CustomerController::class, 'store']);
52 $router->get('/{customerId}', [CustomerController::class, 'getDetails']);
53 $router->put('/{customerId}', [CustomerController::class, 'updateDetails']);
54 $router->get('/{customerId}/orders', [CustomerController::class, 'getCustomerOrders']);
55 $router->get('/{customerAddressId}/update-address-select', [CustomerController::class, 'updateAddressSelect']);
56 $router->put('/{customerId}/address', [CustomerController::class, 'updateAddress']);
57 $router->post('/add-address', [CustomerController::class, 'createAddress']);
58 $router->delete('/{customerId}/address', [CustomerController::class, 'removeAddress']);
59 $router->post('/{customerId}/address/make-primary', [CustomerController::class, 'setAddressPrimary']);
60 });
61
62 $router->prefix('customer-profile')->withPolicy('CustomerFrontendPolicy')->group(function (Router $router) {
63 $router->get('/', [CustomerProfileController::class, 'index']);
64 $router->get('/downloads', [CustomerProfileController::class, 'getDownloads']);
65
66 $router->get('/profile', [CustomerProfileController::class, 'getCustomerProfileDetails']);
67 $router->post('/create-address', [CustomerProfileController::class, 'createCustomerProfileAddress']);
68
69 $router->post('/edit-address', [CustomerProfileController::class, 'updateCustomerProfileAddress']);
70 $router->post('/make-primary-address', [CustomerProfileController::class, 'makePrimaryCustomerProfileAddress']);
71 $router->post('/delete-address', [CustomerProfileController::class, 'deleteCustomerProfileAddress']);
72
73 $router->post('/update', [CustomerProfileController::class, 'updateCustomerProfileDetails']);
74
75
76 // orders
77 $router->get('orders', [CustomerOrderController::class, 'getOrders']);
78 $router->get('orders/{order_uuid}', [CustomerOrderController::class, 'orderDetails'])->alphaNumDash('order_uuid');
79 $router->get('orders/{order_uuid}/upgrade-paths', [CustomerProfileController::class, 'getUpgradePaths'])->alphaNumDash('order_uuid');
80
81 // Order billing address
82 $router->get('orders/{transaction_uuid}/billing-address', [CustomerOrderController::class, 'getTransactionBillingAddress'])->alphaNumDash('transaction_uuid');
83 $router->put('orders/{transaction_uuid}/billing-address', [CustomerOrderController::class, 'saveTransactionBillingAddress'])->alphaNumDash('transaction_uuid');
84
85
86 // subscriptions
87 $router->get('subscriptions', [CustomerSubscriptionController::class, 'getSubscriptions']);
88 $router->get('subscriptions/{subscription_uuid}', [CustomerSubscriptionController::class, 'getSubscription'])->alphaNumDash('subscription_uuid');
89 $router->get('subscriptions/{subscription_uuid}/setup-intent-attempts', [CustomerSubscriptionController::class, 'getSetupIntentRemainingAttempts'])->alphaNumDash('subscription_uuid');
90 $router->post('subscriptions/{subscription_uuid}/update-payment-method', [CustomerSubscriptionController::class, 'updatePaymentMethod'])->alphaNumDash('subscription_uuid');
91 $router->post('subscriptions/{subscription_uuid}/get-or-create-plan', [CustomerSubscriptionController::class, 'getOrCreatePlan'])->alphaNumDash('subscription_uuid');
92 $router->post('subscriptions/{subscription_uuid}/switch-payment-method', [CustomerSubscriptionController::class, 'switchPaymentMethod'])->alphaNumDash('subscription_uuid');
93 $router->post('subscriptions/{subscription_uuid}/confirm-subscription-switch', [CustomerSubscriptionController::class, 'confirmSubscriptionSwitch'])->alphaNumDash('subscription_uuid');
94 $router->post('subscriptions/{subscription_uuid}/cancel-auto-renew', [CustomerSubscriptionController::class, 'cancelAutoRenew'])->alphaNumDash('subscription_uuid');
95 $router->post('subscriptions/{subscription_uuid}/initiate-early-payment', [CustomerSubscriptionController::class, 'initiateEarlyPayment'])->alphaNumDash('subscription_uuid');
96
97 });
98