Updated charge close to working
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user