diff --git a/osinaweb/osinacore/urls.py b/osinaweb/osinacore/urls.py
index 2b9e0d5e..d80e5184 100644
--- a/osinaweb/osinacore/urls.py
+++ b/osinaweb/osinacore/urls.py
@@ -74,8 +74,8 @@ urlpatterns = [
#CUSTOMER DASHBOARD
path('customerdashboard/', views.customer_index, name='customerdashboard'),
path('customerinvoices/', views.customer_invoices, name='customerinvoices'),
- path('payment/', views.payment, name='payment'),
-
+ path('customerproducts/', views.customer_products, name='customerproducts'),
+ path('pricing/', views.pricing, name='pricing'),
path('initiate_checkout/', views.initiate_checkout, name='initiatecheckout'),
]
diff --git a/osinaweb/osinacore/views.py b/osinaweb/osinacore/views.py
index 8a8068e2..d73cd607 100644
--- a/osinaweb/osinacore/views.py
+++ b/osinaweb/osinacore/views.py
@@ -542,7 +542,34 @@ def recent_activities_page(request):
return render(request, 'recent-activities-page.html', context)
+def add_reaction(request, status_id, emoji):
+ status = get_object_or_404(Status, pk=status_id)
+ user = request.user
+ existing_reaction = Reaction.objects.filter(status=status, user=user).first()
+ if existing_reaction:
+ # If the user has already reacted, update the reaction
+ existing_reaction.emoji = emoji
+ existing_reaction.save()
+ return JsonResponse({'message': 'Reaction updated successfully.'})
+ else:
+ # If the user hasn't reacted yet, create a new reaction
+ new_reaction = Reaction.objects.create(status=status, emoji=emoji, user=user)
+ return JsonResponse({'message': 'Reaction added successfully.'})
+
+
+
+
+
+
+
+
+
+
+
+
+
# CUSTOMER DASHBOARD
+# LISTING PAGES
@login_required
def customer_index(request, *args, **kwargs):
@@ -564,13 +591,36 @@ def customer_invoices(request, *args, **kwargs):
@login_required
-def payment(request, *args, **kwargs):
+def customer_products(request, *args, **kwargs):
+
+ context = {
+
+ }
+
+ return render(request, 'customer_dashboard/listing/customer-products.html', context)
+
+
+@login_required
+def pricing(request, *args, **kwargs):
+
+ context = {
+
+ }
+
+ return render(request, 'customer_dashboard/pricing.html', context)
+
+
+
+@login_required
+def customer_products(request, *args, **kwargs):
context = {
}
- return render(request, 'customer_dashboard/payment.html', context)
+ return render(request, 'customer_dashboard/listing/payment.html', context)
+
+
from django.http import JsonResponse
@@ -581,7 +631,7 @@ def initiate_checkout(request):
api_username = "merchant.TEST06127800"
api_password = "37846250a67c70e7fe9f82cf6ca81f93"
merchant_id = "TEST06127800"
- merchant_name = "admin"
+ merchant_name = "Ositcom Sal"
# Data for Initiate Checkout operation
data = {
@@ -589,44 +639,30 @@ def initiate_checkout(request):
"apiUsername": api_username,
"apiPassword": api_password,
"merchant": merchant_id,
- "interaction.operation": "AUTHORIZE",
+ "interaction.operation": "PURCHASE",
"interaction.merchant.name": merchant_name,
"order.id": "123",
"order.amount": "100.00",
"order.currency": "USD",
"order.description": "description_of_order"
}
+
- # Make request to Mastercard API
- response = requests.post("https://creditlibanais-netcommerce.gateway.mastercard.com/api/nvp/version/72", data=data)
-
- # Check if request was successful
- if response.status_code == 200:
- # Parse response JSON
- response_data = response.json()
- session_id = response_data.get("session.id")
- success_indicator = response_data.get("successIndicator")
+ try:
+ response = requests.post("https://creditlibanais-netcommerce.gateway.mastercard.com/api/nvp/version/72", data=data)
- # Save success indicator in your shop system for further processing
- # For example, you can save it in your database associated with the order
+ print("Response Content:", response.content.decode()) # Print response content
- return JsonResponse({"session_id": session_id, "success_indicator": success_indicator})
- else:
- # Handle error
- return JsonResponse({"error": "Failed to initiate checkout"}, status=500)
-
-
+ if response.status_code == 200:
+ response_data = response.text
+ parsed_data = dict(item.split("=") for item in response_data.split("&"))
+ session_id = parsed_data.get("session.id")
+ success_indicator = parsed_data.get("successIndicator")
+ return JsonResponse({"session_id": session_id, "success_indicator": success_indicator})
+ else:
+ print("Response Status Code:", response.status_code) # Print status code
+ return JsonResponse({"error": "Failed to initiate checkout"}, status=500)
-def add_reaction(request, status_id, emoji):
- status = get_object_or_404(Status, pk=status_id)
- user = request.user
- existing_reaction = Reaction.objects.filter(status=status, user=user).first()
- if existing_reaction:
- # If the user has already reacted, update the reaction
- existing_reaction.emoji = emoji
- existing_reaction.save()
- return JsonResponse({'message': 'Reaction updated successfully.'})
- else:
- # If the user hasn't reacted yet, create a new reaction
- new_reaction = Reaction.objects.create(status=status, emoji=emoji, user=user)
- return JsonResponse({'message': 'Reaction added successfully.'})
+ except Exception as e:
+ print("Exception:", e) # Print exception traceback
+ return JsonResponse({"error": "Internal Server Error"}, status=500)
\ No newline at end of file
diff --git a/osinaweb/static/dist/output.css b/osinaweb/static/dist/output.css
index 0239ea8b..c799203a 100644
--- a/osinaweb/static/dist/output.css
+++ b/osinaweb/static/dist/output.css
@@ -686,6 +686,18 @@ video {
right: -10rem;
}
+.-top-10 {
+ top: -2.5rem;
+}
+
+.-top-12 {
+ top: -3rem;
+}
+
+.-top-\[54px\] {
+ top: -54px;
+}
+
.bottom-0 {
bottom: 0px;
}
@@ -887,6 +899,10 @@ video {
margin-top: 5rem;
}
+.mt-24 {
+ margin-top: 6rem;
+}
+
.mt-28 {
margin-top: 7rem;
}
@@ -911,6 +927,10 @@ video {
margin-top: 1.5rem;
}
+.mt-8 {
+ margin-top: 2rem;
+}
+
.mt-\[-50px\] {
margin-top: -50px;
}
@@ -1075,6 +1095,10 @@ video {
height: 8px;
}
+.h-\[90\%\] {
+ height: 90%;
+}
+
.h-auto {
height: auto;
}
@@ -1124,6 +1148,10 @@ video {
width: 180px;
}
+.w-\[20px\] {
+ width: 20px;
+}
+
.w-\[22px\] {
width: 22px;
}
@@ -1188,6 +1216,10 @@ video {
width: 50px;
}
+.w-\[550px\] {
+ width: 550px;
+}
+
.w-\[55px\] {
width: 55px;
}
@@ -1484,6 +1516,10 @@ video {
overflow-x: scroll;
}
+.overflow-y-scroll {
+ overflow-y: scroll;
+}
+
.truncate {
overflow: hidden;
text-overflow: ellipsis;
@@ -1729,6 +1765,10 @@ video {
border-color: rgb(202 138 4 / var(--tw-border-opacity));
}
+.border-r-transparent {
+ border-right-color: transparent;
+}
+
.border-opacity-10 {
--tw-border-opacity: 0.1;
}
@@ -2828,6 +2868,12 @@ video {
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
+.hover\:scale-110:hover {
+ --tw-scale-x: 1.1;
+ --tw-scale-y: 1.1;
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
+}
+
.hover\:bg-gray-50:hover {
--tw-bg-opacity: 1;
background-color: rgb(249 250 251 / var(--tw-bg-opacity));
@@ -3111,6 +3157,10 @@ video {
display: flex;
}
+ .l\:grid {
+ display: grid;
+ }
+
.l\:hidden {
display: none;
}
diff --git a/osinaweb/static/images/.DS_Store b/osinaweb/static/images/.DS_Store
index 1ea60b35..8f913dc8 100644
Binary files a/osinaweb/static/images/.DS_Store and b/osinaweb/static/images/.DS_Store differ
diff --git a/osinaweb/static/images/icons/.DS_Store b/osinaweb/static/images/icons/.DS_Store
new file mode 100644
index 00000000..5008ddfc
Binary files /dev/null and b/osinaweb/static/images/icons/.DS_Store differ
diff --git a/osinaweb/static/images/icons/about.svg b/osinaweb/static/images/icons/about.svg
new file mode 100644
index 00000000..ae79238d
--- /dev/null
+++ b/osinaweb/static/images/icons/about.svg
@@ -0,0 +1,17 @@
+
+
diff --git a/osinaweb/static/images/icons/checkmark.png b/osinaweb/static/images/icons/checkmark.png
new file mode 100644
index 00000000..64004a44
Binary files /dev/null and b/osinaweb/static/images/icons/checkmark.png differ
diff --git a/osinaweb/static/images/icons/greencheckmark.png b/osinaweb/static/images/icons/greencheckmark.png
new file mode 100644
index 00000000..fbdd1255
Binary files /dev/null and b/osinaweb/static/images/icons/greencheckmark.png differ
diff --git a/osinaweb/static/images/icons/invoice.svg b/osinaweb/static/images/icons/invoice.svg
new file mode 100644
index 00000000..3502de12
--- /dev/null
+++ b/osinaweb/static/images/icons/invoice.svg
@@ -0,0 +1,30 @@
+
+
diff --git a/osinaweb/static/images/icons/products.svg b/osinaweb/static/images/icons/products.svg
new file mode 100644
index 00000000..a55159f2
--- /dev/null
+++ b/osinaweb/static/images/icons/products.svg
@@ -0,0 +1,12 @@
+
+
diff --git a/osinaweb/static/images/icons/projectswhite.png b/osinaweb/static/images/icons/projectswhite.png
new file mode 100644
index 00000000..6d14ebb3
Binary files /dev/null and b/osinaweb/static/images/icons/projectswhite.png differ
diff --git a/osinaweb/static/images/icons/projectswhite.svg b/osinaweb/static/images/icons/projectswhite.svg
new file mode 100644
index 00000000..08a6c93f
--- /dev/null
+++ b/osinaweb/static/images/icons/projectswhite.svg
@@ -0,0 +1,17 @@
+
+
diff --git a/osinaweb/static/images/icons/support.svg b/osinaweb/static/images/icons/support.svg
new file mode 100644
index 00000000..0ccdbcb3
--- /dev/null
+++ b/osinaweb/static/images/icons/support.svg
@@ -0,0 +1,38 @@
+
+
diff --git a/osinaweb/static/images/icons/ticket.svg b/osinaweb/static/images/icons/ticket.svg
new file mode 100644
index 00000000..dec9577a
--- /dev/null
+++ b/osinaweb/static/images/icons/ticket.svg
@@ -0,0 +1,36 @@
+
+
diff --git a/osinaweb/static/images/ositcom_logos/osicardblue.png b/osinaweb/static/images/ositcom_logos/osicardblue.png
new file mode 100644
index 00000000..c698f37f
Binary files /dev/null and b/osinaweb/static/images/ositcom_logos/osicardblue.png differ
diff --git a/osinaweb/static/images/ositcom_logos/osicardwhite.png b/osinaweb/static/images/ositcom_logos/osicardwhite.png
new file mode 100644
index 00000000..5b387631
Binary files /dev/null and b/osinaweb/static/images/ositcom_logos/osicardwhite.png differ
diff --git a/osinaweb/static/images/ositcom_logos/osimenublue.png b/osinaweb/static/images/ositcom_logos/osimenublue.png
new file mode 100644
index 00000000..7029d8ca
Binary files /dev/null and b/osinaweb/static/images/ositcom_logos/osimenublue.png differ
diff --git a/osinaweb/static/images/ositcom_logos/osimenuwhite.png b/osinaweb/static/images/ositcom_logos/osimenuwhite.png
new file mode 100644
index 00000000..7cdff4e5
Binary files /dev/null and b/osinaweb/static/images/ositcom_logos/osimenuwhite.png differ
diff --git a/osinaweb/static/images/ositcom_logos/osinablue.png b/osinaweb/static/images/ositcom_logos/osinablue.png
new file mode 100644
index 00000000..487ccf1a
Binary files /dev/null and b/osinaweb/static/images/ositcom_logos/osinablue.png differ
diff --git a/osinaweb/static/images/ositcom_logos/osinawhite.png b/osinaweb/static/images/ositcom_logos/osinawhite.png
new file mode 100644
index 00000000..925581b7
Binary files /dev/null and b/osinaweb/static/images/ositcom_logos/osinawhite.png differ
diff --git a/osinaweb/static/images/ositcom_logos/ositcomwhite.png b/osinaweb/static/images/ositcom_logos/ositcomwhite.png
new file mode 100644
index 00000000..00702dea
Binary files /dev/null and b/osinaweb/static/images/ositcom_logos/ositcomwhite.png differ
diff --git a/osinaweb/static/js/.DS_Store b/osinaweb/static/js/.DS_Store
index f7367d16..2189b430 100644
Binary files a/osinaweb/static/js/.DS_Store and b/osinaweb/static/js/.DS_Store differ
diff --git a/osinaweb/static/js/customer_dashboard/payment.js b/osinaweb/static/js/customer_dashboard/payment.js
new file mode 100644
index 00000000..bf70bb96
--- /dev/null
+++ b/osinaweb/static/js/customer_dashboard/payment.js
@@ -0,0 +1,91 @@
+document.addEventListener("DOMContentLoaded", function () {
+
+ // Function to initiate checkout
+ function initiateCheckout() {
+ // Fetch the CSRF token from the cookie
+ const csrftoken = getCookie('csrftoken');
+
+ console.log('CSRF Token:', csrftoken);
+
+ fetch('/initiate_checkout/', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'X-CSRFToken': csrftoken // Include the CSRF token in the request headers
+ },
+ body: JSON.stringify({})
+ })
+ .then(response => {
+ if (!response.ok) {
+ throw new Error('Network response was not ok');
+ }
+ return response.json();
+ })
+ .then(data => {
+ // Handle success response
+ console.log("Session ID: " + data.session_id);
+ // Configure Checkout with the fetched session ID
+ configureCheckout(data.session_id);
+ })
+ .catch(error => {
+ // Handle error response
+ console.error('There was a problem with the fetch operation:', error);
+ // You can display an error message to the user or perform other actions
+ });
+ }
+
+ // Function to configure Checkout with session ID
+ function configureCheckout(sessionId) {
+ // Configure Checkout session with the fetched session ID
+ Checkout.configure({
+ session: {
+ id: sessionId,
+ }
+ });
+ }
+
+ // Function to get CSRF token from cookie
+ function getCookie(name) {
+ let cookieValue = null;
+ if (document.cookie && document.cookie !== '') {
+ const cookies = document.cookie.split(';');
+ for (let i = 0; i < cookies.length; i++) {
+ const cookie = cookies[i].trim();
+ if (cookie.substring(0, name.length + 1) === (name + '=')) {
+ cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
+ break;
+ }
+ }
+ }
+ return cookieValue;
+ }
+
+ // Configure Checkout and modal
+ Checkout.configure({
+ session: {
+ id: 1, // Default session ID, will be replaced with actual session ID after initiation
+ }
+ });
+
+
+ const displayPaymentModalButton = document.querySelectorAll('.displayPaymentModal');
+ const closeButton = document.querySelector('#closePaymentModalButton');
+ const paymentModal = document.getElementById('paymentModal');
+
+ // Add click event listener to each button
+ displayPaymentModalButton.forEach(function (button) {
+ button.addEventListener('click', function () {
+ paymentModal.classList.remove('hidden');
+
+ initiateCheckout();
+
+ Checkout.showEmbeddedPage('#paymentContent', () => { $('#paymentModal').modal(); });
+ });
+ });
+
+ closeButton.addEventListener('click', function () {
+ paymentModal.classList.add('hidden');
+ sessionStorage.clear();
+ });
+
+});
\ No newline at end of file
diff --git a/osinaweb/static/js/customer_dashboard/pricing-dropdown.js b/osinaweb/static/js/customer_dashboard/pricing-dropdown.js
new file mode 100644
index 00000000..8f125df8
--- /dev/null
+++ b/osinaweb/static/js/customer_dashboard/pricing-dropdown.js
@@ -0,0 +1,12 @@
+// TO OPEN FEATURES DROPDOWN ON MOBILE
+
+document.addEventListener('DOMContentLoaded', function () {
+ const dropdowns = document.querySelectorAll('.openFeaturesDropdown');
+
+ dropdowns.forEach(dropdown => {
+ dropdown.addEventListener('click', function () {
+ const container = this.nextElementSibling;
+ container.classList.toggle('hidden');
+ });
+ });
+});
\ No newline at end of file