subscription updated
This commit is contained in:
@@ -0,0 +1,339 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\APIs\Customer_API;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\APIs\CustomerAPIs\RulesApiServices;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class SubscriptionController extends Controller
|
||||
{
|
||||
|
||||
|
||||
//created by; Hritik
|
||||
//On - 28th June ,2024
|
||||
//use - to get Data of User in Webview and show list of product
|
||||
public function mySubscription(Request $request)
|
||||
{
|
||||
try {
|
||||
|
||||
|
||||
|
||||
return view('Admin.pages.subscriptions.my-subscription');
|
||||
|
||||
} catch (\Exception $e) {
|
||||
Log::error("An error occurred in " . __METHOD__ . ": " . $e->getMessage(), ['exception' => $e]);
|
||||
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//created by; Hritik
|
||||
//On - 28th June ,2024
|
||||
//use - to get Data of User in Webview and show list of product
|
||||
|
||||
|
||||
public function listOfProduct(Request $request)
|
||||
{
|
||||
try {
|
||||
|
||||
|
||||
|
||||
return view('Admin.pages.subscriptions.list-of-products');
|
||||
|
||||
} catch (\Exception $e) {
|
||||
Log::error("An error occurred in " . __METHOD__ . ": " . $e->getMessage(), ['exception' => $e]);
|
||||
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//created by; Hritik
|
||||
//On - 18th May ,2024
|
||||
//use - to get Data of Detailed List Of Product , Monthly & Yearly
|
||||
public function nextPage(Request $request)
|
||||
{
|
||||
|
||||
try {
|
||||
// $token = readHeaderToken();
|
||||
$token = true;
|
||||
// dd($request);
|
||||
if ($token) {
|
||||
// $user_id = $token['sub'];
|
||||
|
||||
// $validator = $this->validateSubscriptionsForm($request);
|
||||
|
||||
// if ($validator->fails()) {
|
||||
// $validationErrors = $validator->errors()->all();
|
||||
// Log::error("Razorpay subscriptions plan validation error: " . implode(", ", $validationErrors));
|
||||
// return jsonResponseWithErrorMessageApi($validationErrors, 203);
|
||||
// }
|
||||
|
||||
// $request['iam_principal_id'] = $user_id;
|
||||
$productTypeXid = $request->query('selected_product_type_id');
|
||||
|
||||
$userId = $request->query('user_id');
|
||||
$products = Products::with('productType', 'productTier')
|
||||
->where('product_type_xid', $productTypeXid)
|
||||
->where('is_active', '1')->get();
|
||||
|
||||
foreach ($products as $k => $val) {
|
||||
|
||||
$products[$k]['product_image'] = ListingImageUrl('product_image', $val['product_image']);
|
||||
}
|
||||
|
||||
$user = IamPrincipal::where('id', $userId)->where('is_active', 1)->first();
|
||||
|
||||
$user_name = $user->user_name;
|
||||
$user_contact_no = $user->phone_number;
|
||||
$user_email = $user->email_address;
|
||||
|
||||
|
||||
return view(
|
||||
'admin-dashboard.pages.razorpay-subscription.subscription-product-detail-pay',
|
||||
compact(
|
||||
'products',
|
||||
'userId',
|
||||
'user_name',
|
||||
'user_contact_no',
|
||||
'user_email',
|
||||
|
||||
)
|
||||
);
|
||||
} else {
|
||||
return jsonResponseWithErrorMessageApi(__('auth.user_deleted'), 409);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
Log::error("An error occurred in " . __METHOD__ . ": " . $e->getMessage(), ['exception' => $e]);
|
||||
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
|
||||
}
|
||||
}
|
||||
|
||||
//created by :-Hritik
|
||||
// On - 16th may ,2024
|
||||
//subscription to a particular project based on plans and returning the subscription id to web to open Subscription screen
|
||||
public function subscribeToProduct(Request $request)
|
||||
{
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
// $token = readHeaderToken();
|
||||
|
||||
$iamId = $request->iam_principal_xid;
|
||||
$razorPayPlanId = $request->razorpay_plan_id;
|
||||
$productId = $request->product_id;
|
||||
|
||||
|
||||
$user = IamPrincipal::where('id', $iamId)->where('is_active', 1)->first();
|
||||
$id = $user->id;
|
||||
$phone = $user->phone_number;
|
||||
$email = $user->email_address;
|
||||
|
||||
$product = Products::where('razorpay_plan_id', $razorPayPlanId)
|
||||
->where('is_active', 1)
|
||||
->first();
|
||||
|
||||
if ($product && $product->product_tier_xid == 1) {
|
||||
//if product tier is monthly then we are setting count to 1200 means 100 years
|
||||
$total_count = 1200;
|
||||
} else if ($product && $product->product_tier_xid == 2) {
|
||||
//if product tier is Yearly then we are setting count to 100 means 100 years
|
||||
|
||||
$total_count = 100;
|
||||
} else {
|
||||
|
||||
//if product tier is not found then we are setting to 1
|
||||
|
||||
$total_count = 1;
|
||||
}
|
||||
|
||||
|
||||
$api = new Api(config('constants.razorpay.key_id'), config('constants.razorpay.key_secret'));
|
||||
$plan_id = $product->razorpay_plan_id;
|
||||
|
||||
// Call the subscription create method with request parameters
|
||||
$response = $api->subscription->create([
|
||||
'plan_id' => $plan_id,
|
||||
'total_count' => $total_count,
|
||||
'quantity' => '1',
|
||||
|
||||
'notes' => [
|
||||
'product_id' => intval($product->id),
|
||||
'iam_principal_xid' => intval($iamId)
|
||||
],
|
||||
'notify_info' => [
|
||||
'notify_phone' => $phone,
|
||||
'notify_email' => $email
|
||||
],
|
||||
// 'callback_url' => route('my-subscription-page')
|
||||
]);
|
||||
|
||||
$notes = $response->notes;
|
||||
$notesArray = [
|
||||
'product_id' => $notes->product_id,
|
||||
'iam_principal_xid' => $notes->iam_principal_xid,
|
||||
];
|
||||
|
||||
DB::commit();
|
||||
|
||||
// return response()->json($response);
|
||||
|
||||
return response()->json([
|
||||
'subId' => $response->id,
|
||||
'userId' => $iamId,
|
||||
|
||||
|
||||
]);
|
||||
return jsonResponseWithSuccessMessage(__('success.save_data', $response->short_url));
|
||||
|
||||
// return Redirect::away($response->short_url);
|
||||
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
|
||||
Log::error("An error occurred in " . __METHOD__ . ": " . $e->getMessage(), ['exception' => $e]);
|
||||
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
|
||||
}
|
||||
}
|
||||
|
||||
public function validateSubscriptionsForm(Request $request)
|
||||
{
|
||||
return Validator::make(
|
||||
$request->all(),
|
||||
[
|
||||
'plan_id' => 'required',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function thankyou(Request $request)
|
||||
{
|
||||
$userId = $request->query('user_xid');
|
||||
if ($userId) {
|
||||
//store data in DATABSE
|
||||
|
||||
RazorpayWebhookUsers::updateOrCreate(
|
||||
['iam_principal_xid' => $userId],
|
||||
['isSuccessPayment' => 1]
|
||||
);
|
||||
}
|
||||
return view('admin-dashboard.pages.razorpay-subscription.thankyou');
|
||||
}
|
||||
|
||||
public function cancelThankYou(Request $request)
|
||||
{
|
||||
$endAt = $request->query('end_date');
|
||||
if ($endAt) {
|
||||
$endDate = $endAt;
|
||||
} else {
|
||||
$endDate = null;
|
||||
}
|
||||
return view('admin-dashboard.pages.razorpay-subscription.cancel-thank-you', compact('endDate'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//created by; Hritik
|
||||
//On - 28th May ,2024
|
||||
//use - To cancel the subscription of user on end of subscription end period
|
||||
|
||||
public function cancelSubscription(Request $request)
|
||||
{
|
||||
try {
|
||||
Log::info("Razorpay Cancel subscriptions Begin: ");
|
||||
DB::beginTransaction();
|
||||
|
||||
$validator = $this->validateCancelSubscriptionForm($request);
|
||||
|
||||
if ($validator->fails()) {
|
||||
$validationErrors = $validator->errors()->all();
|
||||
Log::error("Razorpay Cancel subscriptions validation error: " . implode(", ", $validationErrors));
|
||||
return jsonResponseWithErrorMessageApi($validationErrors, 203);
|
||||
}
|
||||
|
||||
$iamPrincipalId = $request->iam_principal_xid;
|
||||
$razorpaySubscriptionId = $request->subscription_id;
|
||||
$subscriptionXid = $request->subscription_xid;
|
||||
|
||||
$getSubscriptionData = RazorpaySubscriptions::where(['id' => $subscriptionXid, 'iam_principal_xid' => $iamPrincipalId, 'subscription_id' => $razorpaySubscriptionId, 'isCancelledSubscription' => 0])->first();
|
||||
|
||||
|
||||
if (!$getSubscriptionData) {
|
||||
return response()->json(['status' => 502, 'message' => 'Something went wrong while cancelling Subscription']);
|
||||
}
|
||||
|
||||
$api = new Api(config('constants.razorpay.key_id'), config('constants.razorpay.key_secret'));
|
||||
|
||||
$options = ['cancel_at_cycle_end' => 1];
|
||||
// Call the subscription create method with request parameters
|
||||
$response = $api->subscription->fetch($razorpaySubscriptionId)->cancel($options);
|
||||
|
||||
$endAt = date('Y-m-d H:i:s', $response->end_at);
|
||||
$dateTime = now();
|
||||
$currentDateTime = $dateTime->format('Y-m-d H:i:s');
|
||||
$getSubscriptionData->isCancelledSubscription = 1;
|
||||
$getSubscriptionData->cancelled_at = $currentDateTime;
|
||||
$getSubscriptionData->save();
|
||||
|
||||
DB::commit();
|
||||
Log::info("Razorpay Cancel subscriptions end: ");
|
||||
|
||||
return response()->json(['status' => 200, 'end_date' => $endAt]);
|
||||
// return response()->json(['status' => 200, 'message' => 'Your Subscription has been cancelled Sucessfully']);
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::error("An error occurred in " . __METHOD__ . ": " . $e->getMessage(), ['exception' => $e]);
|
||||
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
|
||||
}
|
||||
}
|
||||
public function validateCancelSubscriptionForm(Request $request)
|
||||
{
|
||||
return Validator::make(
|
||||
$request->all(),
|
||||
[
|
||||
'iam_principal_xid' => 'required',
|
||||
'subscription_id' => 'required',
|
||||
'subscription_xid' => 'required',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// public function subscriptionUpgrade(Request $request)
|
||||
// {
|
||||
// // dd($request->all());
|
||||
|
||||
// $razorPayPlanId = $request->razorpay_plan_id;
|
||||
// $productTypeId = $request->product_type_xid;
|
||||
// $productTierId = $request->product_tier_xid;
|
||||
// $iamId = $request->iam_principal_xid;
|
||||
|
||||
// $user_id = 12; // Change this to dynamic user ID
|
||||
|
||||
// // Retrieve the current monthly subscription
|
||||
// $currentSubscription = RazorpaySubscriptions::where('iam_principal_xid', $user_id)->first();
|
||||
|
||||
// if (!$currentSubscription) {
|
||||
// return response()->json(['status' => 502, 'message' => 'Something went wrong current user Subscription not found']);
|
||||
// }
|
||||
|
||||
// $products = Products::where('product_type_xid', $productTypeId)
|
||||
// ->where('product_tier_xid', $productTierId)
|
||||
// ->where('razorpay_plan_id', $razorPayPlanId)
|
||||
// ->where('is_active', '1')->first();
|
||||
|
||||
// if (!$products) {
|
||||
// return response()->json(['status' => 502, 'message' => 'Something went wrong current product not found']);
|
||||
// }
|
||||
|
||||
// $api = new Api(config('constants.razorpay.key_id'), config('constants.razorpay.key_secret'));
|
||||
// $plan_id = $products->razorpay_plan_id;
|
||||
|
||||
// // Call the subscription create method with request parameters
|
||||
|
||||
// }
|
||||
}
|
||||
BIN
resources/views/Admin/pages/subscriptions/images/arrow-left.png
Normal file
BIN
resources/views/Admin/pages/subscriptions/images/arrow-left.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 223 B |
BIN
resources/views/Admin/pages/subscriptions/images/cheers-logo.png
Normal file
BIN
resources/views/Admin/pages/subscriptions/images/cheers-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
BIN
resources/views/Admin/pages/subscriptions/images/dull.png
Normal file
BIN
resources/views/Admin/pages/subscriptions/images/dull.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
BIN
resources/views/Admin/pages/subscriptions/images/glass.png
Normal file
BIN
resources/views/Admin/pages/subscriptions/images/glass.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.8 KiB |
1
resources/views/Admin/pages/subscriptions/images/x.svg
Normal file
1
resources/views/Admin/pages/subscriptions/images/x.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
|
||||
|
After Width: | Height: | Size: 299 B |
@@ -0,0 +1,162 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="{{ asset('resources/views/Admin/pages/subscriptions/subscription-style.css') }}" />
|
||||
|
||||
<title>List Of Products</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<section class="new-subs-main">
|
||||
<div class="container">
|
||||
<h3 class="comm-head mt-3 d-flex gap-2" style="font-size: 20px;">
|
||||
<a href="#">
|
||||
{{-- <img src="images/arrow-left.png" alt=""> --}}
|
||||
|
||||
{{-- <img src="{{ asset('resources/views/Admin/pages/subscriptions/images/arrow-left.png') }}" /> --}}
|
||||
</a>
|
||||
</h3>
|
||||
<div class="new-subs-img">
|
||||
<img src="{{ asset('resources/views/Admin/pages/subscriptions/images/cheers-logo.png') }}" alt="">
|
||||
</div>
|
||||
<p class="text-center mt-3 para-mid">Subscribe to Cheers to the Season app to gain access to free cocktails* at
|
||||
local
|
||||
restaurants.
|
||||
</p>
|
||||
<p class="text-center mt-3 grey-para">*Free cocktail stipulations vary by state in accordance with local liquor
|
||||
laws.</p>
|
||||
<div class="subscription-card">
|
||||
<h3 class="head">Subscription</h3>
|
||||
<div class="main-text">
|
||||
<div>
|
||||
<p class="comm-head">Monthly Plan</p>
|
||||
<p class="grey-para">Billed monthly</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="price">$2.99</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="my-5" style="border-top: 2px dashed; color: #042857;">
|
||||
<div class="input-group mb-5 d-flex align-items-center justify-content-between">
|
||||
<div class="in-group">
|
||||
<label class="comm-head" for="">Enter coupon code</label>
|
||||
</div>
|
||||
<div class="apply-btn">
|
||||
<button class="apply" type="button">Apply</button>
|
||||
</div>
|
||||
<input type="text" class="form-control coupon-input mt-3" placeholder="Enter coupon code">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="main-text">
|
||||
<div>
|
||||
<p class="comm-head">Applied Discount</p>
|
||||
<p class="grey-para">First Month free </p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p class="price">$2.99</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="main-text">
|
||||
<div>
|
||||
<p class="comm-head">Total Payment</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p class="price">$0.00</p>
|
||||
</div>
|
||||
</div>
|
||||
<button class="subscribe-button w-75" type="button" data-bs-toggle="modal"
|
||||
data-bs-target="#exampleModal">SUBSCRIBE
|
||||
NOW</button>
|
||||
<p class="grey-para text-center mt-3">You will be charged $2.99 every month after your free trial period ends.
|
||||
</p>
|
||||
<p class="grey-para text-center mt-2">Subscription will be renewed monthly until cancelled.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="mt-3 mb-5">
|
||||
<h3 class="text-center head my-4">Program/Redemption Rules</h3>
|
||||
<div class="container">
|
||||
<div data-ui-tablist class="ui-accordion ui-accordion--outlined" data-ui-transition="collapse-fade">
|
||||
<div class="ui-accordion-item">
|
||||
<button data-ui-tablist-tab class="ui-accordion-header ui-active">How to create new account?</button>
|
||||
<div data-ui-tablist-tabpanel>
|
||||
<div class="ui-accordion-body">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
||||
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
|
||||
laboris nisi ut aliquip ex ea commodo consequat.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-accordion-item">
|
||||
<button data-ui-tablist-tab class="ui-accordion-header">How to create new account?</button>
|
||||
<div data-ui-tablist-tabpanel hidden>
|
||||
<div class="ui-accordion-body">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
||||
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
|
||||
laboris nisi ut aliquip ex ea commodo consequat.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-accordion-item">
|
||||
<button data-ui-tablist-tab class="ui-accordion-header">How to create new account?</button>
|
||||
<div data-ui-tablist-tabpanel hidden>
|
||||
<div class="ui-accordion-body">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
||||
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
|
||||
laboris nisi ut aliquip ex ea commodo consequat.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<!-- Modal start -->
|
||||
<div class="modal fade bottom-mod" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="exampleModalLabel"></h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
|
||||
<img src="{{ asset('resources/views/Admin/pages/subscriptions/images/x.svg') }}" alt="">
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body mb-4">
|
||||
<div class="mod-img d-flex align-items-center justify-content-center mb-3">
|
||||
<img src="{{ asset('resources/views/Admin/pages/subscriptions/images/glass.png') }}" alt="">
|
||||
</div>
|
||||
<p class="para-mid text-center">You have successfully subscribed. Cheers!</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal end -->
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
|
||||
crossorigin="anonymous"></script>
|
||||
|
||||
<script type="module">
|
||||
import { Tablist } from "https://cdn.jsdelivr.net/npm/jolty@0.6.2/dist/jolty.esm.min.js";
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
Tablist.initAll();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,153 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="{{ asset('resources/views/Admin/pages/subscriptions/subscription-style.css') }}" />
|
||||
|
||||
<title>My Subscription</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<section class="new-subs-main">
|
||||
<div class="container">
|
||||
<h3 class="comm-head mt-3 d-flex gap-2" style="font-size: 20px;">
|
||||
<a href="subscription.html">
|
||||
{{-- <img src="images/arrow-left.png" alt=""> --}}
|
||||
</a>
|
||||
My Active Plan
|
||||
</h3>
|
||||
<div class="main-inn">
|
||||
<div class="inn-group my-4">
|
||||
<label class="comm-head" for="">Plan Name</label>
|
||||
<input type="text" class="form-control other-input mt-3" placeholder="Monthly Plan">
|
||||
</div>
|
||||
<div class="inn-group my-4">
|
||||
<label class="comm-head" for="">Subscription Charge</label>
|
||||
<input type="text" class="form-control other-input mt-3" value="$5000">
|
||||
</div>
|
||||
<div class="inn-group my-4">
|
||||
<label class="comm-head" for="">Renewal date</label>
|
||||
<input type="text" class="form-control other-input mt-3" value="September 15th, 2024">
|
||||
</div>
|
||||
</div>
|
||||
<div class="my-5">
|
||||
<a href="" class="anch" type="button" data-bs-toggle="modal" data-bs-target="#exampleModal">Cancel
|
||||
Subscription</a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="mt-3 mb-5">
|
||||
<div class="container">
|
||||
<h3 class=" head my-4">Subscription FAQs</h3>
|
||||
<div data-ui-tablist class="ui-accordion ui-accordion--outlined" data-ui-transition="collapse-fade">
|
||||
<div class="ui-accordion-item">
|
||||
<button data-ui-tablist-tab class="ui-accordion-header ui-active">How to create new account?</button>
|
||||
<div data-ui-tablist-tabpanel>
|
||||
<div class="ui-accordion-body">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
||||
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
|
||||
laboris nisi ut aliquip ex ea commodo consequat.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-accordion-item">
|
||||
<button data-ui-tablist-tab class="ui-accordion-header">How to create new account?</button>
|
||||
<div data-ui-tablist-tabpanel hidden>
|
||||
<div class="ui-accordion-body">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
||||
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
|
||||
laboris nisi ut aliquip ex ea commodo consequat.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-accordion-item">
|
||||
<button data-ui-tablist-tab class="ui-accordion-header">How to create new account?</button>
|
||||
<div data-ui-tablist-tabpanel hidden>
|
||||
<div class="ui-accordion-body">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
||||
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
|
||||
laboris nisi ut aliquip ex ea commodo consequat.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Modal start -->
|
||||
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="exampleModalLabel"></h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
|
||||
<img src="{{ asset('resources/views/Admin/pages/subscriptions/images/x.svg') }}" alt="">
|
||||
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p class="text-center para">If you cancel now, you can still access your subscription until September
|
||||
15th, 2024. After this date, you will no longer be able to redeem cocktails.
|
||||
</p>
|
||||
<p class="text-center mt-3 para">Are you sure you want to cancel?
|
||||
</p>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-center gap-3 my-4">
|
||||
<button type="button" class="no-btn" data-bs-dismiss="modal">No</button>
|
||||
<button type="button" class="yes-btn" data-bs-toggle="modal" data-bs-target="#tar-mod">Yes</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal end -->
|
||||
|
||||
<!-- Modal start target -->
|
||||
<div class="modal fade bottom-mod" id="tar-mod" tabindex="-1" aria-labelledby="tar-modLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-bottom">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="tar-modLabel"></h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
|
||||
<img src="{{ asset('resources/views/Admin/pages/subscriptions/images/x.svg') }}" alt="">
|
||||
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body mb-4">
|
||||
<div class="mod-img d-flex align-items-center justify-content-center mb-3">
|
||||
{{-- <img src="images/dull.png" alt=""> --}}
|
||||
<img src="{{ asset('resources/views/Admin/pages/subscriptions/images/dull.png') }}" alt="">
|
||||
|
||||
</div>
|
||||
<p class="para-mid text-center">Your subscription has been cancelled successfully!</p>
|
||||
</div>
|
||||
<!-- <div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary">Save changes</button>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal end -->
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
|
||||
crossorigin="anonymous"></script>
|
||||
|
||||
<script type="module">
|
||||
import { Tablist } from "https://cdn.jsdelivr.net/npm/jolty@0.6.2/dist/jolty.esm.min.js";
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
Tablist.initAll();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
</html>
|
||||
208
resources/views/Admin/pages/subscriptions/subscription-style.css
Normal file
208
resources/views/Admin/pages/subscriptions/subscription-style.css
Normal file
@@ -0,0 +1,208 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&display=swap');
|
||||
@import "https://unpkg.com/jolty-ui/dist/jolty-ui.min.css";
|
||||
|
||||
:root {
|
||||
--border-color: #E3E3E3;
|
||||
--background-color: transparent;
|
||||
--transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "Nunito Sans", sans-serif;
|
||||
}
|
||||
|
||||
.head {
|
||||
font-weight: 700;
|
||||
color: #000000;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.comm-head {
|
||||
font-weight: 500;
|
||||
color: #000000;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.grey-para {
|
||||
color: #4D4D4D;
|
||||
}
|
||||
|
||||
.para {
|
||||
color: #000000;
|
||||
font-size: 17px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.para-mid {
|
||||
color: #000000;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
hr {
|
||||
border: none;
|
||||
border-top: 1px dashed #042857;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.main-text {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.new-subs-img {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.subscription-card {
|
||||
padding: 20px;
|
||||
border-radius: 15px;
|
||||
background-color: #E4F0FF;
|
||||
box-shadow: 0px 0px 16.1px 0px #B4B4B440;
|
||||
margin: 50px auto;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
border: 1px solid #ABD0FF;
|
||||
}
|
||||
|
||||
.subscription-card:before,
|
||||
.subscription-card:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background-color: #fff;
|
||||
top: 22%;
|
||||
}
|
||||
|
||||
.subscription-card:before {
|
||||
left: -25px;
|
||||
border-top-right-radius: 20px;
|
||||
border-bottom-right-radius: 20px;
|
||||
}
|
||||
|
||||
.subscription-card:after {
|
||||
right: -25px;
|
||||
border-top-left-radius: 20px;
|
||||
border-bottom-left-radius: 20px;
|
||||
}
|
||||
|
||||
.subscription-card h1 {
|
||||
font-size: 24px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.subscription-card .price {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
color: #052857;
|
||||
}
|
||||
|
||||
|
||||
.subscription-card .coupon-input {
|
||||
width: calc(100% - 70px);
|
||||
display: inline-block;
|
||||
border: 0.8px solid #CFCFCF !important;
|
||||
border-radius: 20px !important;
|
||||
}
|
||||
|
||||
.apply {
|
||||
border: 1px solid #042857;
|
||||
padding: 3px 18px;
|
||||
border-radius: 16px;
|
||||
background: transparent;
|
||||
color: #042857;
|
||||
}
|
||||
|
||||
.subscribe-button {
|
||||
background-color: #EEBA2B;
|
||||
border: none;
|
||||
color: #000000;
|
||||
padding: 10px 20px;
|
||||
font-size: 16px;
|
||||
border-radius: 20px;
|
||||
cursor: pointer;
|
||||
margin: 40px 0 20px 0;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
|
||||
/* .subscription-card .note {
|
||||
font-size: 12px;
|
||||
color: #6c757d;
|
||||
margin-top: 10px;
|
||||
} */
|
||||
|
||||
|
||||
.modal-header {
|
||||
border-bottom: none;
|
||||
padding: 25px 30px;
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.modal-header .btn-close {
|
||||
border: 1px solid #000000;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.bottom-mod .modal-content {
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
.bottom-mod .modal-dialog {
|
||||
position: fixed !important;
|
||||
bottom: 0 !important;
|
||||
left: 0% !important;
|
||||
right: 0% !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.ui-accordion {
|
||||
max-width: 100%;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.ui-accordion-header {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.other-input {
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.anch {
|
||||
color: #0085FF;
|
||||
text-decoration: underline;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.no-btn {
|
||||
padding: 4px 40px;
|
||||
border: 0.5px solid #052857;
|
||||
border-radius: 16px;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.yes-btn {
|
||||
padding: 5px 40px;
|
||||
background-color: #EEBA2B;
|
||||
border: none;
|
||||
border-radius: 16px;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\Admin\APIs\Customer_API\SubscriptionController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use App\Http\Controllers\Admin\ManageProfileController;
|
||||
use App\Http\Controllers\Admin\ManageCustomerController;
|
||||
@@ -193,3 +194,22 @@ Route::group(['middleware' => ['checkStatus']], function () {
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
//subscription ROutes
|
||||
// Route::group(['middleware' => ['vendor.jwt.verify']], function () {
|
||||
|
||||
Route::get('my-subscription-page', [SubscriptionController::class, 'mySubscription'])->name('my-subscription-page');
|
||||
// });
|
||||
|
||||
|
||||
|
||||
|
||||
// Route::middleware(['checkToken'])->group(function () {
|
||||
Route::get('list-of-plans', [SubscriptionController::class, 'listOfProduct'])->name('next.page.route');
|
||||
// });
|
||||
// Route::post('subscribe-to-product', [SubscriptionController::class, 'subscribeToProduct'])->name('subscribe-to-product');
|
||||
// Route::post('cancel-subscription', [SubscriptionController::class, 'cancelSubscription'])->name('cancel-subscription');
|
||||
// Route::get('thank-you', [SubscriptionController::class, 'thankyou'])->name('thankyou');
|
||||
// Route::get('cancel-thank-you', [SubscriptionController::class, 'cancelThankYou'])->name('cancel-thank-you');
|
||||
// Route::post('subscription-upgrade', [SubscriptionController::class, 'subscriptionUpgrade'])->name('subscription-upgrade');
|
||||
|
||||
Reference in New Issue
Block a user