Skip to content

Commit 3d85a32

Browse files
use major units for square payments (#1283)
1 parent 14ef4d9 commit 3d85a32

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

.changeset/short-laws-warn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@godaddy/react": patch
3+
---
4+
5+
Send major unit price for square payments

packages/react/src/components/checkout/payment/utils/use-build-payment-request.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,12 @@ export function useBuildPaymentRequest(): {
551551
};
552552

553553
const squarePaymentRequest: SquarePaymentRequest = {
554-
amount: (totals?.total?.value || 0).toString(),
554+
amount: formatCurrency({
555+
amount: totals?.total?.value || 0,
556+
currencyCode,
557+
inputInMinorUnits: true,
558+
returnRaw: true,
559+
}),
555560
billingContact: {
556561
givenName: order?.billing?.firstName || '',
557562
familyName: order?.billing?.lastName || '',

0 commit comments

Comments
 (0)