From a511546976ec24a461fd8cb36c7ab5607424d249 Mon Sep 17 00:00:00 2001 From: nlaverde-godaddy Date: Fri, 20 Mar 2026 17:24:55 -0500 Subject: [PATCH 1/2] fix(react): convert MercadoPago amount from minor to major units --- .../checkout-buttons/mercadopago/mercadopago.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/react/src/components/checkout/payment/checkout-buttons/mercadopago/mercadopago.tsx b/packages/react/src/components/checkout/payment/checkout-buttons/mercadopago/mercadopago.tsx index 29ea7781..dfc9b657 100644 --- a/packages/react/src/components/checkout/payment/checkout-buttons/mercadopago/mercadopago.tsx +++ b/packages/react/src/components/checkout/payment/checkout-buttons/mercadopago/mercadopago.tsx @@ -3,6 +3,7 @@ import React, { useCallback, useLayoutEffect, useState } from 'react'; import { useFormContext } from 'react-hook-form'; import { useCheckoutContext } from '@/components/checkout/checkout'; import { useDraftOrderTotals } from '@/components/checkout/order/use-draft-order'; +import { formatCurrency } from '@/components/checkout/utils/format-currency'; import { PaymentProvider, useConfirmCheckout, @@ -96,7 +97,15 @@ export function MercadoPagoCheckoutButton() { } else { // Create new brick const renderBrick = async () => { - const total = totals?.total?.value || 0; + // Convert from minor units (cents) to major units + const total = parseFloat( + formatCurrency({ + amount: totals?.total?.value || 0, + currencyCode: totals?.total?.currencyCode || 'USD', + inputInMinorUnits: true, + returnRaw: true, + }) + ); try { const container = document.getElementById(elementId); From a53ff45268463bb344b4c6c66297e8546673dfe1 Mon Sep 17 00:00:00 2001 From: nlaverde-godaddy Date: Fri, 20 Mar 2026 17:49:14 -0500 Subject: [PATCH 2/2] chore: add changeset --- .changeset/fix-mercadopago-amount.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fix-mercadopago-amount.md diff --git a/.changeset/fix-mercadopago-amount.md b/.changeset/fix-mercadopago-amount.md new file mode 100644 index 00000000..df539959 --- /dev/null +++ b/.changeset/fix-mercadopago-amount.md @@ -0,0 +1,5 @@ +--- +"@godaddy/react": patch +--- + +Fix MercadoPago amount conversion from minor units to major units. The SDK expects amounts in major units (e.g., 90.00 BRL) but we were sending minor units (e.g., 9000 cents).