Skip to content

Commit

Permalink
Fix price conversion in checkout options
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Dec 27, 2024
1 parent 220ee11 commit 8082ed3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/src/components/CheckoutOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as movininHelper from ':movinin-helper'
import { strings as csStrings } from '@/lang/properties'
import { strings } from '@/lang/checkout'
import * as helper from '@/common/helper'
import * as StripeService from '@/services/StripeService'

import '@/assets/css/checkout-options.css'

Expand Down Expand Up @@ -45,13 +46,13 @@ const CheckoutOptions = ({
return null
}

const handleCancellationChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const handleCancellationChange = async (e: React.ChangeEvent<HTMLInputElement>) => {
if (property && from && to) {
const _cancellation = e.target.checked
const options: movininTypes.PropertyOptions = {
cancellation: _cancellation
}
const _price = movininHelper.calculateTotalPrice(property, from, to, options)
const _price = await StripeService.convertPrice(movininHelper.calculateTotalPrice(property, from, to, options))

setCancellation(_cancellation)
onCancellationChange(_cancellation)
Expand Down

0 comments on commit 8082ed3

Please sign in to comment.