@@ -34,7 +34,7 @@ import { filterAndSortShippingMethods } from '@/components/checkout/shipping/uti
3434import { useGetShippingMethodByAddress } from '@/components/checkout/shipping/utils/use-get-shipping-methods' ;
3535import { useGetTaxes } from '@/components/checkout/taxes/utils/use-get-taxes' ;
3636import { mapOrderToFormValues } from '@/components/checkout/utils/checkout-transformers' ;
37- import { formatCurrency } from '@/components/checkout/utils/format-currency' ;
37+ import { useFormatCurrency } from '@/components/checkout/utils/format-currency' ;
3838import { Skeleton } from '@/components/ui/skeleton' ;
3939import { useGoDaddyContext } from '@/godaddy-provider' ;
4040import { GraphQLErrorWithCodes } from '@/lib/graphql-with-errors' ;
@@ -46,6 +46,7 @@ import {
4646} from '@/tracking/track' ;
4747
4848export function ExpressCheckoutButton ( ) {
49+ const formatCurrency = useFormatCurrency ( ) ;
4950 const { session, setCheckoutErrors } = useCheckoutContext ( ) ;
5051 const { isPoyntLoaded } = useLoadPoyntCollect ( ) ;
5152 const { godaddyPaymentsConfig } = useCheckoutContext ( ) ;
@@ -139,7 +140,7 @@ export function ExpressCheckoutButton() {
139140 const shippingMethodPrice = formatCurrency ( {
140141 amount : method . cost ?. value || 0 ,
141142 currencyCode : method . cost ?. currencyCode || currencyCode ,
142- isInCents : true ,
143+ inputInMinorUnits : true ,
143144 } ) ;
144145
145146 return {
@@ -151,7 +152,7 @@ export function ExpressCheckoutButton() {
151152 amount : formatCurrency ( {
152153 amount : method . cost ?. value || 0 ,
153154 currencyCode : method . cost ?. currencyCode || currencyCode ,
154- isInCents : true ,
155+ inputInMinorUnits : true ,
155156 returnRaw : true ,
156157 } ) ,
157158 amountInMinorUnits : method . cost ?. value || 0 , // Keep original minor unit value
@@ -186,7 +187,7 @@ export function ExpressCheckoutButton() {
186187 amount : formatCurrency ( {
187188 amount : - priceAdjustment ,
188189 currencyCode,
189- isInCents : true ,
190+ inputInMinorUnits : true ,
190191 returnRaw : true ,
191192 } ) ,
192193 isPending : false ,
@@ -199,7 +200,7 @@ export function ExpressCheckoutButton() {
199200 const totalAmount = formatCurrency ( {
200201 amount : totalInMinorUnits ,
201202 currencyCode,
202- isInCents : true ,
203+ inputInMinorUnits : true ,
203204 returnRaw : true ,
204205 } ) ;
205206
@@ -217,7 +218,7 @@ export function ExpressCheckoutButton() {
217218 amount : formatCurrency ( {
218219 amount : - priceAdjustment ,
219220 currencyCode,
220- isInCents : true ,
221+ inputInMinorUnits : true ,
221222 returnRaw : true ,
222223 } ) ,
223224 } ,
@@ -356,7 +357,7 @@ export function ExpressCheckoutButton() {
356357 amount : formatCurrency ( {
357358 amount : priceAdjustment ,
358359 currencyCode,
359- isInCents : true ,
360+ inputInMinorUnits : true ,
360361 returnRaw : true ,
361362 } ) ,
362363 } ;
@@ -553,7 +554,7 @@ export function ExpressCheckoutButton() {
553554 amount : formatCurrency ( {
554555 amount : godaddyTotals . shipping . value ,
555556 currencyCode,
556- isInCents : true ,
557+ inputInMinorUnits : true ,
557558 returnRaw : true ,
558559 } ) ,
559560 } ) ;
@@ -565,7 +566,7 @@ export function ExpressCheckoutButton() {
565566 amount : formatCurrency ( {
566567 amount : godaddyTotals . taxes . value ,
567568 currencyCode,
568- isInCents : true ,
569+ inputInMinorUnits : true ,
569570 returnRaw : true ,
570571 } ) ,
571572 } ) ;
@@ -580,7 +581,7 @@ export function ExpressCheckoutButton() {
580581 const totalAmount = formatCurrency ( {
581582 amount : totalInMinorUnits ,
582583 currencyCode,
583- isInCents : true ,
584+ inputInMinorUnits : true ,
584585 returnRaw : true ,
585586 } ) ;
586587
@@ -631,7 +632,7 @@ export function ExpressCheckoutButton() {
631632 amount : formatCurrency ( {
632633 amount : godaddyTotals . shipping . value ,
633634 currencyCode,
634- isInCents : true ,
635+ inputInMinorUnits : true ,
635636 returnRaw : true ,
636637 } ) ,
637638 } ) ;
@@ -643,7 +644,7 @@ export function ExpressCheckoutButton() {
643644 amount : formatCurrency ( {
644645 amount : godaddyTotals . taxes . value ,
645646 currencyCode,
646- isInCents : true ,
647+ inputInMinorUnits : true ,
647648 returnRaw : true ,
648649 } ) ,
649650 } ) ;
@@ -655,7 +656,7 @@ export function ExpressCheckoutButton() {
655656 amount : formatCurrency ( {
656657 amount : - adjustment ,
657658 currencyCode,
658- isInCents : true ,
659+ inputInMinorUnits : true ,
659660 returnRaw : true ,
660661 } ) ,
661662 } ) ;
@@ -670,7 +671,7 @@ export function ExpressCheckoutButton() {
670671 const totalAmount = formatCurrency ( {
671672 amount : totalInMinorUnits ,
672673 currencyCode,
673- isInCents : true ,
674+ inputInMinorUnits : true ,
674675 returnRaw : true ,
675676 } ) ;
676677
@@ -686,7 +687,7 @@ export function ExpressCheckoutButton() {
686687 amount : formatCurrency ( {
687688 amount : - adjustment ,
688689 currencyCode,
689- isInCents : true ,
690+ inputInMinorUnits : true ,
690691 returnRaw : true ,
691692 } ) ,
692693 } ,
@@ -980,7 +981,7 @@ export function ExpressCheckoutButton() {
980981 amount : formatCurrency ( {
981982 amount : taxesResult . value ,
982983 currencyCode,
983- isInCents : true ,
984+ inputInMinorUnits : true ,
984985 returnRaw : true ,
985986 } ) ,
986987 isPending : false ,
@@ -1016,7 +1017,7 @@ export function ExpressCheckoutButton() {
10161017 amount : formatCurrency ( {
10171018 amount : - priceAdjustment ,
10181019 currencyCode,
1019- isInCents : true ,
1020+ inputInMinorUnits : true ,
10201021 returnRaw : true ,
10211022 } ) ,
10221023 isPending : false ,
@@ -1045,7 +1046,7 @@ export function ExpressCheckoutButton() {
10451046 amount : formatCurrency ( {
10461047 amount : - priceAdjustment ,
10471048 currencyCode,
1048- isInCents : true ,
1049+ inputInMinorUnits : true ,
10491050 returnRaw : true ,
10501051 } ) ,
10511052 } ;
@@ -1161,7 +1162,7 @@ export function ExpressCheckoutButton() {
11611162 amount : formatCurrency ( {
11621163 amount : taxesResult . value ,
11631164 currencyCode,
1164- isInCents : true ,
1165+ inputInMinorUnits : true ,
11651166 returnRaw : true ,
11661167 } ) ,
11671168 isPending : false ,
@@ -1200,7 +1201,7 @@ export function ExpressCheckoutButton() {
12001201 amount : formatCurrency ( {
12011202 amount : - priceAdjustment ,
12021203 currencyCode,
1203- isInCents : true ,
1204+ inputInMinorUnits : true ,
12041205 returnRaw : true ,
12051206 } ) ,
12061207 isPending : false ,
@@ -1230,7 +1231,7 @@ export function ExpressCheckoutButton() {
12301231 amount : formatCurrency ( {
12311232 amount : - priceAdjustment ,
12321233 currencyCode,
1233- isInCents : true ,
1234+ inputInMinorUnits : true ,
12341235 returnRaw : true ,
12351236 } ) ,
12361237 } ;
0 commit comments