Updated charge close to working

This commit is contained in:
2025-09-09 18:26:21 -04:00
parent fd11c9e794
commit 98fe855e65
19 changed files with 1785 additions and 372 deletions

View File

@@ -538,26 +538,11 @@ async onSubmit() {
// If a valid, approved, pre-auth transaction is found...
if (transactionResponse.data && transactionResponse.data.transaction_type === 1 && transactionResponse.data.status === 0) {
// ...redirect to the capture page. The delivery is already updated.
const gallons = this.FinalizeOilOrderForm.gallons_delivered || '0';
const pricePerGallon = parseFloat(this.deliveryOrder.customer_price);
let finalAmount = parseFloat(gallons) * pricePerGallon;
if (this.deliveryOrder.prime == 1) {
finalAmount += parseFloat(this.pricing.price_prime.toString()) || 0;
}
if (this.deliveryOrder.same_day == 1) {
finalAmount += parseFloat(this.pricing.price_same_day.toString()) || 0;
}
this.$router.push({
name: 'captureAuthorize',
params: { id: this.$route.params.id },
query: {
gallons: gallons,
amount: finalAmount.toFixed(2).toString()
}
params: { id: this.$route.params.id }
});
} else {