+
{{ card.type_of_card }} ending in {{ card.last_four_digits }}
{{ card.name_on_card }}
Expires: {{ card.expiration_month }}/{{ card.expiration_year }}
@@ -111,6 +113,13 @@
Price per Gallon
${{ delivery.customer_price }}
+
+ Gallons Ordered
+
+ FILL (250 gal estimate)
+ {{ delivery.gallons_ordered }} Gallons
+
+
Prime Fee
+ ${{ pricing.price_prime }}
@@ -143,6 +152,10 @@
+
+
+ Pay Authorize
+
Confirm & Process Payment
@@ -157,6 +170,23 @@
+
+
+
+
@@ -167,6 +197,7 @@ import authHeader from '../../services/auth.header'
import Header from '../../layouts/headers/headerauth.vue'
import SideBar from '../../layouts/sidebar/sidebar.vue'
import Footer from '../../layouts/footers/footer.vue'
+import PaymentAuthorizePopup from '../../components/PaymentAuthorizePopup.vue'
import useValidate from "@vuelidate/core";
import { notify } from "@kyvg/vue3-notification"
import { minLength, required } from "@vuelidate/validators";
@@ -178,6 +209,7 @@ export default defineComponent({
Header,
SideBar,
Footer,
+ PaymentAuthorizePopup,
},
data() {
@@ -274,6 +306,7 @@ export default defineComponent({
total_amount: 0,
discount: 0,
total_amount_after_discount: 0,
+ showPaymentPopup: false,
}
},
validations() {
@@ -324,19 +357,22 @@ export default defineComponent({
})
.then((response: any) => {
if (response.data.ok) {
- console.log(response.data)
+ console.log('%%%%%%%%%%%%%%%')
+ console.log(response.data)
+
this.priceprime = response.data.priceprime;
this.pricesameday = response.data.pricesameday;
this.priceemergency = response.data.priceemergency;
this.total_amount = response.data.total_amount;
this.discount = response.data.discount;
this.total_amount_after_discount = response.data.total_amount_after_discount;
+ console.log('%%%%%%%%%%%%%%%')
}
})
.catch(() => {
notify({
title: "Error",
- text: "Could not get oil pricing",
+ text: "Could not get oil pricing 1",
type: "error",
});
});
@@ -384,12 +420,13 @@ export default defineComponent({
.catch(() => {
notify({
title: "Error",
- text: "Could not get oil pricing",
+ text: "Could not get oil pricing 2",
type: "error",
});
});
},
getOilOrder(delivery_id: any) {
+ console.log("=== DEBUG: getOilOrder called with delivery_id:", delivery_id);
let path = import.meta.env.VITE_BASE_URL + "/delivery/order/" + delivery_id;
axios({
method: "get",
@@ -397,8 +434,13 @@ export default defineComponent({
withCredentials: true,
})
.then((response: any) => {
+ console.log("=== DEBUG: API Response:", response.data);
if (response.data && response.data.ok) {
+ console.log("=== DEBUG: Delivery data from API:", response.data.delivery);
+ console.log("=== DEBUG: Delivery ID from API:", response.data.delivery?.id);
this.delivery = response.data.delivery;
+ console.log("=== DEBUG: Delivery object after assignment:", this.delivery);
+ console.log("=== DEBUG: Delivery ID after assignment:", this.delivery.id);
this.getCustomer(this.delivery.customer_id)
this.getCreditCards(this.delivery.customer_id)
if (this.delivery.promo_id != null) {
@@ -409,7 +451,8 @@ export default defineComponent({
console.error("API Error:", response.data.error || "Failed to fetch delivery data.");
}
})
- .catch(() => {
+ .catch((error: any) => {
+ console.error("=== DEBUG: API Error in getOilOrder:", error);
notify({
title: "Error",
text: "Could not get delivery",
@@ -487,7 +530,23 @@ export default defineComponent({
});
},
-
+ handlePaymentSuccess(data: any) {
+ // Handle successful payment
+ console.log('Payment successful:', data)
+
+ // Show success notification
+ notify({
+ title: "Success",
+ text: "Payment authorized successfully",
+ type: "success",
+ });
+
+ // Close the popup
+ this.showPaymentPopup = false
+
+ // Redirect to customer profile
+ this.$router.push({ name: "customerProfile", params: { id: this.customer.id } });
+ },
},
})
diff --git a/src/pages/pay/routes.ts b/src/pages/pay/routes.ts
index 956a1db..ff2eb2f 100755
--- a/src/pages/pay/routes.ts
+++ b/src/pages/pay/routes.ts
@@ -1,9 +1,7 @@
-import PayOil from '../pay/pay_oil.vue';
-
-
-
+import PayOil from './pay_oil.vue';
+import CaptureAuthorize from './capture_authorize.vue';
const payRoutes = [
@@ -12,7 +10,11 @@ const payRoutes = [
name: 'payOil',
component: PayOil,
},
-
+ {
+ path: '/pay/capture/authorize/:id',
+ name: 'captureAuthorize',
+ component: CaptureAuthorize,
+ },
]