Add ach payment method#1313
Open
pbennett1-godaddy wants to merge 19 commits into
Open
Conversation
…-ach-paymentMethod # Conflicts: # examples/nextjs/app/page.tsx # packages/localizations/src/deDe.ts # packages/localizations/src/enIe.ts # packages/localizations/src/enUs.ts # packages/localizations/src/esAr.ts # packages/localizations/src/esCl.ts # packages/localizations/src/esCo.ts # packages/localizations/src/esEs.ts # packages/localizations/src/esMx.ts # packages/localizations/src/esPe.ts # packages/localizations/src/esUs.ts # packages/localizations/src/frCa.ts # packages/localizations/src/frFr.ts # packages/localizations/src/idId.ts # packages/localizations/src/itIt.ts # packages/localizations/src/ptBr.ts # packages/localizations/src/qaPs.ts # packages/localizations/src/trTr.ts # packages/localizations/src/viVn.ts # packages/localizations/src/zhCn.ts # packages/localizations/src/zhSg.ts # packages/react/src/components/checkout/payment/lazy-payment-loader.tsx # packages/react/src/lib/godaddy/checkout-mutations.ts # packages/react/src/lib/godaddy/checkout-queries.ts
…-ach-paymentMethod # Conflicts: # packages/react/src/components/checkout/payment/checkout-buttons/express/godaddy.tsx
…-ach-paymentMethod # Conflicts: # packages/localizations/src/deDe.ts # packages/react/src/components/checkout/payment/lazy-payment-loader.tsx # packages/react/src/components/checkout/payment/utils/conditional-providers.tsx
…-ach-paymentMethod
🦋 Changeset detectedLatest commit: d913f07 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
'This PR is stale as it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.' |
Contributor
|
'This PR was closed because it has been stalled for 5 days with no activity.' |
# Conflicts: # packages/react/src/components/checkout/payment/checkout-buttons/express/godaddy.tsx # packages/react/src/components/checkout/payment/checkout-buttons/paze/godaddy.tsx # packages/react/src/components/checkout/pickup/local-pickup.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds ACH (bank account) as a new payment method for GoDaddy Payments, surfaces tips, fees, shipping, and taxes correctly in the order summary, rewrites the custom tip input for better
multi-currency UX, and ships several checkout bug fixes (inline billing for ACH & pickup, stuck nonce loading state, $0 line items, duplicate DOM IDs).
Packages affected:
@godaddy/react(patch),@godaddy/localizations(patch)🆕 ACH Payment Method
Adds full support for ACH (bank account) payments via GoDaddy Payments:
GoDaddyACHForm— Collect iframe for bank account input (account holder name/type, routing number, account number) with custom CSS matching the checkout themeACHCheckoutButton— submit button that triggers nonce collection and form validationPoyntACHCollectProvider— dedicated React context for the ACH collect instance and nonce loading state, separate from the credit card collect providerlazyPaymentComponentRegistrywith lazy-loaded form and button componentsLandmarkicon and label/description resolution for the ACH tabConditionalPaymentProviderswraps children in the ACH provider only when GoDaddy Payments is configured andsession.paymentMethods.ach.processor === 'godaddy'LazyPaymentMethodRendererreturnsnullfor the ACH method unless GoDaddy Payments has anappIdand the session listsachwith thegodaddyprocessor (and similarlyhides the GoDaddy CC form when no
appIdis configured)CreateCheckoutSessionMutation,GetCheckoutSessionQuery, and the introspection schema to includeach { processor, checkoutTypes }PaymentMethodType.ACH = 'ach'achandexpresspayment method config🧾 Inline Billing for ACH & Pickup Fix for Credit Card
Refactored billing-address logic in
payment-form.tsxandpayment-methods/credit-card/container.tsx:INLINE_BILLING_PAYMENT_METHODSlist (card,ach) — these collect billing inline, so the standalone billing block / address toggle is suppressed for bothPaymentAddressTogglenow only renders for non-inline-billing methodsshouldShowBillingNamesOnlynow correctly evaluates(!useShippingAddress || isPickup)so the names-only billing block appears when neededGoDaddyACHFormmirrors the same logic, including names-only fallback whenenableBillingAddressCollection === false💰 Order Summary: Tips, Fees, Shipping, Taxes
total + tip) so customers see the true amount they'll be chargedFeesline inDraftOrderTotals(with skeleton +checkout.summary.totals.fees.beforeextension target). Wired throughfeeTotalfromuseDraftOrderTotalsandan
update-draft-order-feesmutation-key loading stateshowShippingLine,showTaxesLine,showFeesLineinCheckoutForm. Merchants who disable collection but pre-applya value still see it reflected in the summary:
(isShipping && enableShipping) || shipping > 0enableTaxCollection || taxTotal > 0feeTotal > 0shippingis now read directly fromtotals.shippingTotal.valueinstead of summingorder.shippingLines(removes the unuseduseDraftOrdercall)✏️ Custom Tip Input Rewrite
Replaced
<input type="number">with a polished currency input using the "format on blur" pattern (same UX as Stripe, Square, Shopify):"10."or""are preserved for natural editing"10.5"→"10.50")@tanstack/react-pacer'suseDebouncedValue)$vs suffix€)convertMajorToMinorUnitshardened: now returns0forNaN, negative, or otherwise invalid inputgrid-cols-1 sm:grid-cols-3/grid-cols-1 sm:grid-cols-2)🐛 Bug Fixes
Pay Nowbuttons now flipisLoadingNoncetotrueonly after validation succeeds, and reset it correctly onerror, on failedvalidatedevents, and inside the
confirmCheckoutcatchblock. The button is also short-circuited when already disabled or whencollectisn't ready$0line items: changeditem.originalPrice && …→item.originalPrice != null && …so items with a0original price correctly render the price column instead of being falsy-skippeduseId()(gdpay-card-element-…,gdpay-ach-element-…), preventing collisions whenmultiple checkouts mount on the same page
applicationIddeps: ApplePay, GooglePay, Paze, Express, credit card, and ACH forms now computeapplicationIdonce at the component level and include it in theiruseEffectdepsinstead of re-deriving inline (previously caused subtle re-mount churn)
🌐 Localizations
achpayment method name ("Bank Account"/ localized equivalents) and description across all 20 localesfeestotals label across all localesAUTHORIZATION_FAILEDerror message ("Failed to authorize payment"/ localized equivalents) across all 20 localesChangeset
Test Plan